thought this might come handy for the mu coders who are out there, since i left myself and have all kinds of stuff lying around useless guess dont mind releasing some, after all sharing is caring
Structs
Lahap ProtectionCode:struct tagInterfaceState { /*<bitfield this+0x0>*/ /*|0x4|*/ unsigned long use:2; /*<bitfield this+0x0>*/ /*|0x4|*/ unsigned long state:4; /*<bitfield this+0x0>*/ /*|0x4|*/ unsigned long type:0xA; }; THE CODE BELOW GOES TO OBJECTSTRUCT /*<thisrel this+0xe74>*/ /*|0x4|*/ struct tagInterfaceState m_IfState;
this piece of code checks the states, and if someone tries to dupe, gs returns a false and breaks the action. yet simple but effective.Code:case 0xBC: if(ObjTable[aIndex].m_IfState.use > 0 && ObjTable[aIndex].m_IfState.type != 12) return false; break;
in addition you can implement a logger and/or an individual system, some kind of punishment system for example.
Example 1
Example 2Code:case 0xBC: if(ObjTable[aIndex].m_IfState.use > 0 && ObjTable[aIndex].m_IfState.type != 12) LogAddFunc(2,"[Anti-Hack][Trade Dupe] [Lahap] (%s)(%s)",gObj->AccountID,gObj->Name); return false; break;
DefinitionsCode:case 0xBC: if(ObjTable[aIndex].m_IfState.use > 0 && ObjTable[aIndex].m_IfState.type != 12) LogAddFunc(2,"[Anti-Hack][Trade Dupe] [Lahap] (%s)(%s)",gObj->AccountID,gObj->Name); DupeProtection(aIndex); return false; break; ----- void DupeProtection(aIndex) { if (DupePunishmentSystem = 0) { return; } if (PunishmentType = 1) { GCServerMsgStringSend("Kiss My Ass Nawb",aIndex,1); } if (PunishmentType = 2) { GCServerMsgStringSend("Hai, You Just Got BANNED",aIndex,1); SQL.Execute(UPDATE MuOnline.dbo.MEMB_INFO SET ctl1_code = '1' WHERE memb___id = '%s'",gObj->AccountID); } else { do nothing } }
This is useful only up to .18 gs since it has been fixed by webzen on .66 and later versions.Code:#define LogAddFunc ((void(*) (unsigned char cor,char* Texto,...)) 0x00403CC9) <- For 1.00.18 GS
Have Fun, Shatter![]()



Reply With Quote


