There are some pitfalls as well. First, remember to call the method
ISession::put_loadAddress
to set the base address of a module before any other invocation, otherwise retrieved function addresses would be invalid. Besides, the documentation of GetModuleInformation
which can be used to get the base address of a module is wrong: providing NULL for the first parameter hProcess
for current calling process, as is described in MSDN, leads to unexpected failure. Use INVALID_HANDLE_VALUE
(-1) or GetCurrentProcess()
instead.
No comments:
Post a Comment