MCPcopy Create free account
hub / github.com/NtQuery/Scylla / injectImprecPlugin

Method injectImprecPlugin

Scylla/DllInjectionPlugin.cpp:71–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71void DllInjectionPlugin::injectImprecPlugin(Plugin & plugin, std::map<DWORD_PTR, ImportModuleThunk> & moduleList, DWORD_PTR imageBase, DWORD_PTR imageSize)
72{
73 Plugin newPlugin;
74 size_t mapSize = (wcslen(plugin.fullpath) + 1) * sizeof(WCHAR);
75
76 HANDLE hImprecMap = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE|SEC_COMMIT, 0, (DWORD)mapSize, TEXT(PLUGIN_IMPREC_EXCHANGE_DLL_PATH));
77
78 if (hImprecMap == NULL)
79 {
80#ifdef DEBUG_COMMENTS
81 Scylla::debugLog.log(L"injectImprecPlugin :: CreateFileMapping failed 0x%X", GetLastError());
82#endif
83 return;
84 }
85
86 LPVOID lpImprecViewOfFile = MapViewOfFile(hImprecMap, FILE_MAP_ALL_ACCESS, 0, 0, 0);
87
88 if (lpImprecViewOfFile == NULL)
89 {
90#ifdef DEBUG_COMMENTS
91 Scylla::debugLog.log(L"injectImprecPlugin :: MapViewOfFile failed 0x%X", GetLastError());
92#endif
93 CloseHandle(hImprecMap);
94 return;
95 }
96
97 CopyMemory(lpImprecViewOfFile,plugin.fullpath, mapSize);
98
99 UnmapViewOfFile(lpImprecViewOfFile);
100
101 newPlugin.fileSize = plugin.fileSize;
102 wcscpy_s(newPlugin.pluginName, plugin.pluginName);
103 wcscpy_s(newPlugin.fullpath, Scylla::plugins.imprecWrapperDllPath);
104
105 injectPlugin(newPlugin,moduleList,imageBase,imageSize);
106
107 CloseHandle(hImprecMap);
108}
109
110
111

Callers 1

pluginActionHandlerMethod · 0.80

Calls 1

logMethod · 0.80

Tested by

no test coverage detected