MCPcopy Create free account
hub / github.com/DrewKestell/BloogBot / LoadClr

Function LoadClr

Loader/dllmain.cpp:198–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void LoadClr()
199{
200 wchar_t buffer[255];
201 if (!GetModuleFileNameW(g_myDllModule, buffer, 255))
202 return;
203
204 std::wstring modulePath(buffer);
205
206 // Get just the directory path.
207 modulePath = modulePath.substr(0, modulePath.find_last_of('\\') + 1);
208 modulePath = modulePath.append(LOAD_DLL_FILE_NAME);
209
210 // Copy the string, or we end up with junk data by the time we send it off
211 // to our thread routine.
212 dllLocation = new wchar_t[modulePath.length() + 1];
213 wcscpy(dllLocation, modulePath.c_str());
214 dllLocation[modulePath.length()] = '\0';
215
216 g_hThread = (HANDLE)_beginthreadex(NULL, 0, ThreadMain, NULL, 0, NULL);
217}
218
219BOOL WINAPI DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
220{

Callers 1

DllMainFunction · 0.85

Calls 2

appendMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected