This function gets a module file name.WINAPI DWORD GetModuleFileName( HMODULE hModule, LPWSTR lpFilename, DWORD nSize );ParametershModule [in] Handle to the module whose executable file name is being requested. If this parameter is NULL, GetModuleFileName returns the path for the file used to create the calling process. lpFilename [out] Pointer to a buffer that is filled in with the path and file name of the given module. nSize [in] Specifies the length, in characters, of the lpFilename buffer. If the length of the path and file name exceeds this limit, the string is truncated. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcekernl/html/_wcesdk_GetModuleFileName.asp
HMODULE hModule,
LPWSTR lpFilename,
DWORD nSize
);ParametershModule
[in] Handle to the module whose executable file name is being requested. If this parameter is NULL, GetModuleFileName returns the path for the file used to create the calling process.
lpFilename
[out] Pointer to a buffer that is filled in with the path and file name of the given module.
nSize
[in] Specifies the length, in characters, of the lpFilename buffer. If the length of the path and file name exceeds this limit, the string is truncated. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcekernl/html/_wcesdk_GetModuleFileName.asp
先VirtualQuery()出当前代码段的base address,第一个参数就是eip的值
把base address当作HMODULE来用,再调GetModuleFileName()