MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / GetExeInfo

Function GetExeInfo

emmy_tool/src/windows/utility.cpp:10–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <thread>
9
10bool GetExeInfo(LPCSTR fileName, ExeInfo& info) {
11 LOADED_IMAGE loadedImage;
12 if (!MapAndLoad(const_cast<PSTR>(fileName), nullptr, &loadedImage, FALSE, TRUE)) {
13 return false;
14 }
15
16 info.managed = false;
17 if (loadedImage.FileHeader->Signature == IMAGE_NT_SIGNATURE) {
18 const DWORD netHeaderAddress =
19 loadedImage.FileHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress;
20
21 if (netHeaderAddress) {
22 info.managed = true;
23 }
24 }
25
26 info.entryPoint = loadedImage.FileHeader->OptionalHeader.AddressOfEntryPoint;
27 info.i386 = loadedImage.FileHeader->FileHeader.Machine == IMAGE_FILE_MACHINE_I386;
28
29 UnMapAndLoad(&loadedImage);
30
31 return true;
32}
33
34int GetProcessByName(const char* name) {
35 DWORD pid = 0;

Callers 3

LaunchMethod · 0.85
ArchFileMethod · 0.85
ArchPidMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected