void init(HMODULE hModule) { Path rootPath; loadDLLPath(hModule, rootPath); instance = new Instance(rootPath.c_str()); void* debugSection = NULL; Instance::ImageSection section; section.init((void*)0x400000, 0x1000); size_t ptr = 0; PEHelper::seekSection(MemoryReader(§ion), ".debug", ptr); debugSection = (void*)ptr; Path configPath(CONFIG_PATH); instance->init(debugSection, configPath.c_str()); }
EXTERN_DLL_EXPORT void* Init(void* debugSection, ident_t package) { if (instance) { if (debugSection == NULL) { Instance::ImageSection section; section.init((void*)0x400000, 0x1000); size_t ptr = 0; PEHelper::seekSection(MemoryReader(§ion), ".debug", ptr); debugSection = (void*)ptr; } Path configPath; Path::loadPath(configPath, CONFIG_PATH); instance->init(debugSection, package, configPath); return instance; } else return 0; }
void* init() { instance = new Instance(CONFIG_PATH); void* debugSection = NULL; void* messageSection = NULL; Instance::ImageSection section; section.init((void*)IMAGE_BASE, 0x1000); size_t ptr = 0; MemoryReader reader(§ion); ELFHelper::seekDebugSegment(reader, ptr); debugSection = (void*)ptr; PEHelper::seekSection(MemoryReader(§ion), ".mdata", ptr); messageSection = (void*)ptr; instance->init(debugSection, messageSection, CONFIG_PATH); return instance; }