The magic drop mechanics of the game is a bit complicated. I'm looking at it. Hopefully I'll get this to work
I got a magicfind hack working on CE.
My discord is "Scott#5275" i can send you the CE I have; Here is the lua code for it.
Code: Select all
[ENABLE]
alloc(coefficient,4)
registersymbol(coefficient)
{
"Game.exe"+15875B: 74 0A - je Game.exe+158767
"Game.exe"+15875D: 8B C6 - mov eax,esi
"Game.exe"+15875F: 6B C0 64 - imul eax,eax,64
"Game.exe"+158762: 99 - cdq
"Game.exe"+158763: F7 F9 - idiv ecx
"Game.exe"+158765: 8B F0 - mov esi,eax
"Game.exe"+158767: 8B 47 08 - mov eax,[edi+08]
"Game.exe"+15876A: 3B F0 - cmp esi,eax
"Game.exe"+15876C: 7F 02 - jg Game.exe+158770
"Game.exe"+15876E: 8B F0 - mov esi,eax
// ---------- INJECTING HERE ----------
"Game.exe"+158770: 8B 45 14 - mov eax,[ebp+14]
"Game.exe"+158773: 0F B7 40 06 - movzx eax,word ptr [eax+06]
// ---------- DONE INJECTING ----------
"Game.exe"+158777: 0F AF C6 - imul eax,esi
"Game.exe"+15877A: 99 - cdq
"Game.exe"+15877B: 81 E2 FF 03 00 00 - and edx,000003FF
"Game.exe"+158781: 03 C2 - add eax,edx
"Game.exe"+158783: C1 F8 0A - sar eax,0A
"Game.exe"+158786: F7 D8 - neg eax
"Game.exe"+158788: 03 F0 - add esi,eax
"Game.exe"+15878A: 85 F6 - test esi,esi
"Game.exe"+15878C: 0F 8E 21 FF FF FF - jng Game.exe+1586B3
"Game.exe"+158792: 8B 4D 0C - mov ecx,[ebp+0C]
}
aobscanmodule(aobMagicFind,D2Game.dll,8B 54 24 28 0F B7 42 06)
registersymbol(addressMagicFind)
alloc(injectionMagicFind,64)
label(exitCoefficient)
label(addressMagicFind)
label(returnMagicFind)
injectionMagicFind:
pushf // save flags state
push eax
// esi containt an integer that'll be used to determine item quality
// the higher values means harder to get high quality item
// note that set items are acually considered less qualitative then uniques
mov eax, esi
mov esi,0
cmp [coefficient],0
je exitCoefficient // maximum quality for selected loot table will always drop
push edx // save register state
mov edx,0 // prepare for division
idiv [coefficient] // make quality items coefficient times more likely to drop
mov esi,eax
pop edx // restore register state
exitCoefficient:
pop eax
popf // restore flags state
// original code
mov edx,[esp+28]
movzx eax,word ptr [edx+06]
jmp returnMagicFind
aobMagicFind:
addressMagicFind:
jmp injectionMagicFind
nop
nop
nop
returnMagicFind:
[DISABLE]
addressMagicFind:
db 8B 54 24 28 0F B7 42 06
unregistersymbol(addressMagicFind)
dealloc(injectionMagicFind)
unregistersymbol(coefficient)
dealloc(coefficient)
I also would like to add, it is possible to edit the items in your inventory. Each item is assigned a code (ex. #1G, not accurate but still has a code) if you can find out item codes you can change item in your inventory and test stuff out.