月上夢之戀【NASM】是一款源碼調(diào)試:使用工具nasm,nasm可以出編譯許多平臺(tái)的下的執(zhí)行文件。從調(diào)試的角度來看,使用GAS的好處是可以在生成的目標(biāo)代碼中包含符號(hào)表(symbol table),這樣就可以使用 GDB
使用說明
比如我們拿中文版的植物大戰(zhàn)僵尸CALL僵尸:
//[參數(shù)] [常量] 用法
pushad
push [參數(shù)]
push [參數(shù)]
mov eax,[變量]
mov esi,0x40DDC0
call esi
popad
ret
//轉(zhuǎn)換結(jié)果
pushad
push dword [ebp+0x08]
push dword [ebp+0x0C]
mov eax,dword [ebp-0x04]
mov esi,0x40DDC0
call esi
popad
ret
以前找的一個(gè)游戲的CALL
原型基本上就是下面那個(gè)樣子
mov ecx, dword[ebp+0x14]
mov edx, dword[ebp+0x18]
sub esp, 0x10
mov eax, esp
mov dword[eax], ecx
mov ecx, dword[ebp+0x1c]
mov ebx, dword[esi+0x00000d20]
mov dword[eax+0x04], edx
mov edx, dword[ebp+0x20]
mov dword[eax+0x08], ecx
mov ecx, dword[ebp+0x30]
mov dword[eax+0x0c], edx
mov eax, dword[ebp+0x34]
mov edx, dword[ebp+0x2c]
push eax
mov eax, dword[ebp+0x28]
push ecx
mov ecx, dword[ebp+0x24]
push edx
mov edx, dword[ebp+0x10]
push eax
mov eax, dword[ebp+0x0c]
push ecx
mov ecx, dword[ebp+0x08]
push 0x00000032 分?jǐn)?shù)
push 0x000001cc x坐標(biāo)
push 0x000003cc y坐標(biāo)
mov eax, 0x1143FA58 基址
mov ebx, 0x006d7740
call ebx
那么我們直接這樣寫
mov ecx, dword[ebp+0x14]
mov edx, dword[ebp+0x18]
sub esp, 0x10
mov eax, esp
mov dword[eax], ecx
mov ecx, dword[ebp+0x1c]
mov ebx, dword[esi+0x00000d20]
mov dword[eax+0x04], edx
mov edx, dword[ebp+0x20]
mov dword[eax+0x08], ecx
mov ecx, dword[ebp+0x30]
mov dword[eax+0x0c], edx
mov eax, dword[ebp+0x34]
mov edx, dword[ebp+0x2c]
push eax
mov eax, dword[ebp+0x28]
push ecx
mov ecx, dword[ebp+0x24]
push edx
mov edx, dword[ebp+0x10]
push eax
mov eax, dword[ebp+0x0c]
push ecx
mov ecx, dword[ebp+0x08]
push [參數(shù)]
push [參數(shù)]
push [參數(shù)]
mov eax,[變量]
mov ebx, 0x006d7740
call ebx
那么我們在編程傳遞的時(shí)候,就要傳遞三個(gè)參數(shù) 一個(gè)變量 這兒我用的是易語言
更新說明
1.去除無用功能 [去除窗口邊框] [還原窗口邊框] [窗口隱藏/還原] [窗口側(cè)邊]
2.匯編代碼結(jié)構(gòu)重構(gòu):增加快捷轉(zhuǎn)換 [參數(shù)] [變量]