I am trying create a tool for performing DLL-Injection
by writing the the DLL in the Memory of a running process using VirtualAclloc()
API and then finding the offset of the entrypoint and passing it to the CreateRemoteThread()
API by adding the entry point offset to the base address of the VirtualAlloc
function.
As I don't have any arguments that needs to be passed to lpStartAddress
while calling CreateRemoteThread()
, I initialized lpParameter
as NULL.
LPVOID lpParameter = NULL;
...
...
thread_handle = CreateRemoteThread(process_handle, NULL, 0, (LPTHREAD_START_ROUTINE)(base_address + offset), lpParameter, 0, NULL);
While compiling the code I am getting the error :
LPVOID: Unknown Size" and the message "Expression must be a pointer to a complete object type.
Is there a way I can pass the value of lpParameter
as NULL?