I have the following assembly code :
..... lea eax, [ebp+ThreadID] push eax ; lpThreadID push 0 ; dwCreationFlags push 0 ; lpParameter push offset StartAddress ; lpStartAddress push 0 ; dwStackSize call CreateThread ....
So, I try to translate it in a C-like pseudocode:
DWORD* LPWORD eax_lpThreadID = NULL; DWORD dwCreationFlags; void *LPVOID lpParameter; SIZE_T dwStackSize; LPSECURITY ATTRIBUTES lpThreadAttributes; HANDLE handle_to_new_Thread = CreateThread(lpThreadAttributes, dwStackSize, ..., lpParameter, dwCreationFlags, eax_lpThreadID );
As you can see, I do not include the 3rd parameter, namely the parameter
LPTHREAD_START_ROUTINE lpStartAddress, because I have problems understanding it.
In this SO thread i have read that a
LPTHREAD_START_ROUTINE is a function pointer defined as:
typedef DWORD (__stdcall *LPTHREAD_START_ROUTINE) ( [in] LPVOID lpThreadParameter );
That would mean that the 4th parameter
lpThreadParameter is a parameter of this.
But how can I integrate that information into my pseudo C code program ?
I am little bit confused about that. Can someone explain it to me? The other attributes/parameters are clear....