Code:
// EMS v114.1 Kami
[Enable]
Alloc(Kami,128)
Alloc(ItemHook,128)
Alloc(GetMobXY,512)
Alloc(NewTeleportXY,128)
Alloc(PressKey,128)
Alloc(TeleTopLeft,128)
Alloc(ItemX,4)
Alloc(ItemY,4)
Label(GetMobXYFalse)
Label(GetMobXYTrue)
Label(TeleportEnd)
Label(NextMob)
Label(Loot)
Label(KamiExit)
//MapleStory keycodes
define(CTRL,001D0000)
define(SHIFT,002A0000)
define(INSERT,01520000)
define(DEL,01530000)
define(HOME,01470000)
define(END,014F0000)
define(PAGEUP,01490000)
define(PAGEDOWN,01510000)
define(ALT,00380000)
define(Z,002C0000)
GetMobXY:
// TSingleton<CMobPool>::ms_pInstance (Mob Base):
// 8B 0D ? ? ? ? ? E8 ? ? ? ? 8B ? 85 ? 74 ? 8B ? ? 8B
mov esi,[0199B290] // v114.1
test esi,esi
je GetMobXYFalse
mov edx,[esi+10] // mob count
test edx,edx
je GetMobXYFalse
mov esi,[esi+28] // mob 1
test esi,esi
je GetMobXYFalse
mov edx,[esi+04] // mob 2 - 0x10
test edx,edx
je GetMobXYFalse
// mob 3 offset 83 ? ? ? ? ? ? 0F 84 ? ? ? ? 83 ? ? 39 ? ? ? ? ? 0F 8E ? ? ? ? 68 ? ? ? ? 8D ? ? ? E8 ? ? ? ? 68 ? ? ? ? 8D ? ? ? C7 ? ? ? ? ? ? ? E8 ? ? ? ? 8B ? ? ? ? ? C6 ? ? ? ? 85
mov edx,[edx+1B8] // v114.1
test edx,edx
je GetMobXYFalse
mov edx,[edx+24] // mob 4
test edx,edx
je GetMobXYFalse
mov ebx,[edx+60] // mob invx
or ebx,[edx+64] // mob invy
test ebx,ebx
jne GetMobXYTrue
mov esi,[esi-0C] // next mob - 0x10
test esi,esi
je GetMobXYFalse
NextMob:
mov edx,[esi+14] // mob 2
test edx,edx
je GetMobXYFalse
// mob 3 offset 83 ? ? ? ? ? ? 0F 84 ? ? ? ? 83 ? ? 39 ? ? ? ? ? 0F 8E ? ? ? ? 68 ? ? ? ? 8D ? ? ? E8 ? ? ? ? 68 ? ? ? ? 8D ? ? ? C7 ? ? ? ? ? ? ? E8 ? ? ? ? 8B ? ? ? ? ? C6 ? ? ? ? 85
mov edx,[edx+1B8] // v114.1
test edx,edx
je GetMobXYFalse
mov edx,[edx+24] // mob 4
test edx,edx
je GetMobXYFalse
mov ebx,[edx+60] // mob invx
or ebx,[edx+64] // mob invy
test ebx,ebx
jne GetMobXYTrue
mov esi,[esi+04] // next mob
test esi,esi
je GetMobXYFalse
jmp NextMob
GetMobXYFalse:
xor eax,eax
ret
GetMobXYTrue:
lea eax,[edx+58] // mob x
ret
NewTeleportXY:
// TSingleton<CUserLocal>::ms_pInstance (char base)
// A1 ? ? ? ? 85 C0 75 ? 5F C3 8D
mov esi,[01996DE4] // v114.1
lea ecx,[esi+04]
// 8B ? ? ? ? ? 85 ? 74 ? 83 ? ? 74 ? 83 ? ? C3
// mov eax,[ecx+00007xxxx], usually the last result (8th)
// or just get the value of edx at FF D2 89 84 24 ? ? ? ? 8D 84 24 ? ? ? ? 50 8B CF
call 01274CE0 // v114.1
test eax,eax
je TeleportEnd
push ebx
push edx
push 00
mov ecx,eax
// 8B ? 24 ? 8B ? ? 8B ? ? ? 8D ? ? 8B ? ? ? ? ? ? FF ? 85 C0 ? ? ? ? ? ? ? ? ? E8
call 012E8710 // v114.1
TeleportEnd:
ret
PressKey:
// TSingleton<CWndMan>::ms_pInstance
// 8B 15 ? ? ? ? 85 D2 74 23
mov esi,[0199B39C] // v114.1
push edx // lparam (keycode)
push 00 // unused wparam
call 0131A2E0 // CWndMan::OnKey v114.1
ret
Kami:
// mov ecx, eax below 8B ? ? FF ? 8B ? B8 ? ? ? ? F7 ? C1 ? ? 8B ? C1 ? ? 03 ? 83 ? ? 74 ? 81 ? ? ? ? ? 75 ? 80 ? ? ? ? ? ? 74
cmp dword ptr [esp], 01199A4A // v114.1
pushad
jne KamiExit
// TSingleton<CUserLocal>::ms_pInstance (char base)
// A1 ? ? ? ? 85 C0 75 ? 5F C3 8D
mov eax,[01996DE4]
test eax,eax
je KamiExit
call GetMobXY
test eax,eax
je Loot
//jmp Loot
mov ebx,[eax+4]
sub ebx,#0
mov edx,[eax]
sub edx,#50
call NewTeleportXY
//mov edx, CTRL // Change attack key here
//Call PressKey
jmp KamiExit
Loot:
// TSingleton<CDropPool>::ms_pInstance (item base):
// 89 3D ? ? ? ? 8D 4E ? C7 06
mov esi,[0199B8D4] // v114.1
mov esi,[esi+14] // item count offset (shouldnt change)
cmp esi,0
je TeleTopLeft
mov edx, Z // Change loot key here
call PressKey
mov ebx,[ItemY]
mov edx,[ItemX]
call NewTeleportXY
jmp KamiExit
TeleTopLeft:
// TSingleton<CWvsPhysicalSpace2D>::ms_pInstance (map base)
// A1 ? ? ? ? 8B 50 ? 83 C0
mov edx,[0199B298] // v114.1
mov edx,[edx+1C] // left offset (shouldnt change)
mov ebx,[0199B298] // v114.1
mov ebx,[ebx+20] // top offset (shouldnt change)
call NewTeleportXY
KamiExit:
popad
jmp 011A8860 // v114.1
// original value of the pointer
ItemHook:
// 85 C0 75 ? 8D ? 24 ? C7 ? 24 ? ? ? ? ? E8 ? ? ? ? 8B
cmp [esp],00666384 // v114.1
jne PtInRect
push eax
mov eax,[esp+0C]
mov [ItemX],eax
mov eax,[esp+10]
mov [ItemY],eax
pop eax
jmp PtInRect
// base: C7 06 ? ? ? ? C7 46 04 ? ? ? ? C7 46 08 ? ? ? ? C7 86 AC 00 00 00 ? ? ? ? 89 18 89 9E
// offset: 8B ? ? FF ? 8B ? B8 ? ? ? ? F7 ? C1 ? ? 8B ? C1 ? ? 03 ? 83 ? ? 74 ? 81 ? ? ? ? ? 75 ? 80 ? ? ? ? ? ? 74
017E85F8+70: // v114.1
dd Kami
// pointer call above 85 C0 75 ? 8D ? 24 ? C7 ? 24 ? ? ? ? ? E8 ? ? ? ? 8B
019AABD0: // v114.1
dd ItemHook
[Disable]
017E85F8+70: // v114.1
dd 011A8860 // v114.1
// original value of the pointer
019AABD0: // v114.1
dd PtInRect
Dealloc(Kami)
Dealloc(ItemHook)
Dealloc(GetMobXY)
Dealloc(NewTeleportXY)
Dealloc(PressKey)
Dealloc(TeleTopLeft)
Dealloc(ItemX)
Dealloc(ItemY)