Pregunta

I am trying to make a small win32 "Hello, world!" application in pure assembly. Now after looking around on how to even locate the kernel32.dll, I, after some time, found this: http://skypher.com/wiki/index.php/Hacking/Shellcode/kernel32. This technique returns a pointer to where kernel32.dll is located in memory.

Now on a different website where a similar technique was presented, they wrote

Now all you need to do is locate the "LoadLibrary" and "GetProcAddress" functions in there and you're good to go!

Of course, this is true. I could easily write any win32 application if I only had the exact jump location of these two functions.

Does anyone know how to locate the two (or technically, only "GetProcAddress" would do) in that DLL? Or are there any cheap alternatives (besides using a higher-level language)?

Thanks in advance,

-Kierrow

¿Fue útil?

Solución

Since you found how to retrieve a pointer to kernel32.dll, you could just traverse the Export Table of kernel32 and look for "GetProcAddress". Once you get the pointer to the function, just invoke it. As Raymond Chen mentioned, to do this, just have a look at the Portable Executable Format specification.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top