1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| #include<stdio.h> #include<stdlib.h> #include<windows.h>
int main() { char writedata[]={100,0,0,0}; DWORD oldprot,number = 0; HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS,FALSE,432); if(handle == NULL) { printf("open process error\n"); system("pause"); return 0; } VirtualProtectEx(handle, (LPVOID)0x426A30, 4, PAGE_EXECUTE_READWRITE, &oldprot);
printf("%X,%X,%X,%X,%X\n",handle, (LPVOID)0x426A30, &writedata, 4, &number); system("pause"); __asm { push edx; lea edx,number push edx push 4 lea edx,writedata push edx push 0x426A30 mov edx,handle push edx; push 0 mov eax,0x115 mov edx,0x7FFE0300 call dword ptr [edx] pop edx; pop edx; pop edx; pop edx; pop edx; pop edx; pop edx; }
VirtualProtectEx(handle, (LPVOID)0x426A30, 4, oldprot, &oldprot); system("pause");
return 0; }
|