1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
int mesoFilterAmt = 10; //Mesos at or below this amount will be filtered
int itemFilterType = 0;
char ItemMem[6];
std::vector<DWORD> itemFilterList;
DWORD ItemAddy = 0x005059CC, ItemRet = ItemAddy+6;
__declspec() void __stdcall ItemFilter()
{
DWORD* data = itemFilterList.data();
__asm
{
PUSH esi
MOV esi, mesoFilterAmt
CMP eax, esi
JLE FilterMeso
CMP itemFilterType, 0x00
JE RejectFilter
JMP AcceptFilter
AcceptFilter :
MOV ESI, data
IfAccept :
CMP EAX, [esi]
JE EndFilter
CMP[esi], 0x00 //Check to see if we're at the end of the item list
JE NoMatch
ADD esi, 0x04 //Go to the next element in the array
JMP IfAccept
RejectFilter :
MOV esi, data //We use the same filter for good and bad items.
IfReject :
CMP eax, [esi]
JE NoMatch
CMP[esi], 0x00
JE EndFilter
ADD esi, 0x04
JMP IfReject
NoMatch :
MOV eax, 0x00
EndFilter :
POP esi
MOV[edi + 0x34], eax
MOV edi, [ebp - 0x14]
JMP DWORD PTR[ItemRet]
FilterMeso :
MOV[edi + 0x30], 0x00
JMP EndFilter
}
}
void AddItem(DWORD ItemID)
{
itemFilterList.push_back(ItemID);
}
void ClearItem()
{
itemFilterList.erase(itemFilterList.begin(), itemFilterList.end());
itemFilterList.resize(0);
}
|