Problem with NTCreateProcess again

c++ / delphi package - dll injection and api hooking
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Giving in PChar(PFile) into GetModuleFileNameEx is plain wrong. I mean GetModuleFileNameEx will try to write chars into PFile, but actually PFile is empty and has no space for the chars. You tell GetModuleFileNameEx, that the buffer is MAX_PATH long, but it's not. You need to use SetLength before calling GetModuleFileNameEx.

IntToStr(SectionHandle) can't help, since the process explorer shows it in hex, not in integer format.
Post Reply