#include <stdio.h>
#include <windows.h>
typedef void (*MYFUNC)(HWND,LPTSTR,LPTSTR,int);
int main(int argc, char* argv[])
{
HMODULE hLib = LoadLibrary( "user32.dll" );
// MYFUNC pMsgBoxA = NULL;
// pMsgBoxA = (MYFUNC)GetProcAddress( hLib , "MessageBoxA" );
// printf("MessageBoxA addr = %x" , pMsgBoxA );
// MessageBox( NULL , "My msgbox" , "bufflo" , MB_OKCANCEL );
///*
__asm{
push ebp;
mov ebp , esp;
sub esp , 80h;
mov byte ptr[ebp-12h], 6dh; //m
mov byte ptr[ebp-11h], 79h; //y
mov byte ptr[ebp-10h], 20h; //空格
mov byte ptr[ebp-0fh], 6dh; //m
mov byte ptr[ebp-0eh], 73h; //s
mov byte ptr[ebp-0dh], 67h; //g
mov byte ptr[ebp-0ch], 62h; //b
mov byte ptr[ebp-0bh], 6fh; //o
mov byte ptr[ebp-0ah], 78h; //x
mov byte ptr[ebp-09h], 0h;
lea esi , [ebp-12h];
mov byte ptr[ebp-07h], 62h; //b
mov byte ptr[ebp-06h], 75h; //u
mov byte ptr[ebp-05h], 66h; //f
mov byte ptr[ebp-04h], 66h; //f
mov byte ptr[ebp-03h], 6ch; //l
mov byte ptr[ebp-02h], 6fh; //o
mov byte ptr[ebp-01h], 0h;
lea edi , [ebp-07h];
push 1;
push esi;
push edi;
push 0;
mov eax,77d507eah;
call eax;
}//*/
return 0;
}
请问:这个用汇编执行messagebox API的代码,为什么运行后会这样,报错误呢?
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)