fork download
  1. __declspec(naked) HMODULE GetKernel32(void)
  2. {
  3. __asm
  4. {
  5. push esi
  6. mov eax, fs:[0x30] ; PEB base
  7. mov eax, [eax + 0x0C] ; goto PEB_LDR_DATA
  8. mov eax, [eax + 0x1C] ; first entry in the list of loaded modules
  9. mov eax, [eax] ; second entry
  10. mov eax, [eax] ; third entry (kernel32.dll)
  11. mov eax, [eax + 0x08] ; kernel32 base memory
  12. pop esi
  13. ret
  14. }
  15. }
  16.  
  17. __declspec(naked) DWORD FindGetProcAddr(void)
  18. {
  19. HMODULE KERNELBASE = GetKernel32();
  20. __asm
  21. {
  22. ret
  23. }
  24. }
  25.  
  26. int main(int argc, char *argv[])
  27. {
  28. FindGetProcAddr();
  29. }
  30.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1:1: warning: return type defaults to 'int' [-Wimplicit-int]
 __declspec(naked) HMODULE GetKernel32(void)
 ^
prog.c: In function '__declspec':
prog.c:1:19: error: unknown type name 'HMODULE'
 __declspec(naked) HMODULE GetKernel32(void)
                   ^
prog.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 {
 ^
prog.c:17:1: error: expected declaration specifiers before '__declspec'
 __declspec(naked) DWORD FindGetProcAddr(void)
 ^
prog.c:27:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
 {
 ^
prog.c:1:1: warning: type of 'naked' defaults to 'int' [-Wimplicit-int]
 __declspec(naked) HMODULE GetKernel32(void)
 ^
prog.c:29:1: error: expected '{' at end of input
 }
 ^
prog.c:29:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
stdout
Standard output is empty