fixed a bug in LibraryLoader.exe as non-administrator (Global -> Local kernel namespace for the file name to debug)

This commit is contained in:
Mr. eXoDia 2015-04-04 03:56:57 +02:00
parent 3462c000e0
commit b9dd68f5c7
4 changed files with 2 additions and 2 deletions

View File

@ -188,7 +188,7 @@ __declspec(dllexport) void* TITCALL InitDLLDebugW(wchar_t* szFileName, bool Rese
DebugReserveModuleBase = DebugModuleImageBase; DebugReserveModuleBase = DebugModuleImageBase;
PPROCESS_INFORMATION ReturnValue = (PPROCESS_INFORMATION)InitDebugW(szDebuggerName, szCommandLine, szCurrentFolder); PPROCESS_INFORMATION ReturnValue = (PPROCESS_INFORMATION)InitDebugW(szDebuggerName, szCommandLine, szCurrentFolder);
wchar_t szName[256] = L""; wchar_t szName[256] = L"";
swprintf(szName, 256, L"Global\\szLibraryName%X", (unsigned int)ReturnValue->dwProcessId); swprintf(szName, 256, L"Local\\szLibraryName%X", (unsigned int)ReturnValue->dwProcessId);
DebugDLLFileMapping = CreateFileMappingW(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, 512 * sizeof(wchar_t), szName); DebugDLLFileMapping = CreateFileMappingW(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, 512 * sizeof(wchar_t), szName);
if(DebugDLLFileMapping) if(DebugDLLFileMapping)
{ {

View File

@ -6,7 +6,7 @@ int main()
{ {
memset(szLibraryPath, 0, sizeof(szLibraryPath)); memset(szLibraryPath, 0, sizeof(szLibraryPath));
wchar_t szName[256] = L""; wchar_t szName[256] = L"";
wsprintfW(szName, L"Global\\szLibraryName%X", (unsigned int)GetCurrentProcessId()); wsprintfW(szName, L"Local\\szLibraryName%X", (unsigned int)GetCurrentProcessId());
HANDLE hMapFile = OpenFileMappingW(FILE_MAP_READ, false, szName); HANDLE hMapFile = OpenFileMappingW(FILE_MAP_READ, false, szName);
if(hMapFile) if(hMapFile)
{ {