What arguments are passed to the entry point of the PE (Portable Executable) file?

If you are building a PE file (.exe, a portable executable for Win32), it has an entry point that you could name _start, _mainor whatever you like.

Question: Is this entry point called some arguments? If so, are they available on the stack? If so, do I need an entry point function to clear the stack? Where can I find documentation about this?

+4
source share
1 answer

There is no process in which there is no information about its arguments on the stack at the entry point. You must call GetCommandLineor access information in PEB through RTL_USER_PROCESS_PARAMETERS , but this is not a stable API.

Each language support library (e.g. CRT) should also do this.

+5
source

Source: https://habr.com/ru/post/1609858/


All Articles