diff --git a/.gitignore b/.gitignore index dc59db22..14a4a9aa 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ debug/ doxygen*/ doc/ COV/ +minidump/ # Global filetypes to ignore *.depend diff --git a/src/dbg/debugger.cpp b/src/dbg/debugger.cpp index 3c05b6ca..31fa808c 100644 --- a/src/dbg/debugger.cpp +++ b/src/dbg/debugger.cpp @@ -929,7 +929,7 @@ static void cbLoadDll(LOAD_DLL_DEBUG_INFO* LoadDll) if((bBreakOnNextDll || settingboolget("Events", "DllEntry")) && !bAlreadySetEntry) { - duint oep = GetPE32Data(DLLDebugFileName, 0, UE_OEP); + duint oep = GetPE32DataW(StringUtils::Utf8ToUtf16(DLLDebugFileName).c_str(), 0, UE_OEP); if(oep) { char command[256] = ""; @@ -1463,7 +1463,7 @@ DWORD WINAPI threadAttachLoop(void* lpParameter) static PROCESS_INFORMATION pi_attached; fdProcessInfo = &pi_attached; //do some init stuff - bFileIsDll = IsFileDLL(szFileName, 0); + bFileIsDll = IsFileDLLW(StringUtils::Utf8ToUtf16(szFileName).c_str(), 0); GuiAddRecentFile(szFileName); ecount = 0; //NOTE: set custom handlers diff --git a/src/dbg/jit.cpp b/src/dbg/jit.cpp index 41981ca8..6ed18425 100644 --- a/src/dbg/jit.cpp +++ b/src/dbg/jit.cpp @@ -73,7 +73,7 @@ static bool readwritejitkey(wchar_t* jit_key_value, DWORD* jit_key_vale_size, ch if (write) { - lRv = RegCreateKeyEx(HKEY_LOCAL_MACHINE, JIT_REG_KEY, 0, NULL, REG_OPTION_NON_VOLATILE, key_flags, NULL, &hKey, &dwDisposition); + lRv = RegCreateKeyExW(HKEY_LOCAL_MACHINE, JIT_REG_KEY, 0, NULL, REG_OPTION_NON_VOLATILE, key_flags, NULL, &hKey, &dwDisposition); if (lRv != ERROR_SUCCESS) return false; @@ -81,7 +81,7 @@ static bool readwritejitkey(wchar_t* jit_key_value, DWORD* jit_key_vale_size, ch } else { - lRv = RegOpenKeyEx(HKEY_LOCAL_MACHINE, JIT_REG_KEY, 0, key_flags, &hKey); + lRv = RegOpenKeyExW(HKEY_LOCAL_MACHINE, JIT_REG_KEY, 0, key_flags, &hKey); if (lRv != ERROR_SUCCESS) { if (error != NULL) diff --git a/src/dbg/jit.h b/src/dbg/jit.h index 8527a927..ebd47be3 100644 --- a/src/dbg/jit.h +++ b/src/dbg/jit.h @@ -3,7 +3,7 @@ #include "_global.h" #define ATTACH_CMD_LINE "\" -a %ld -e %ld" -#define JIT_REG_KEY TEXT("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug") +#define JIT_REG_KEY L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug" #define JIT_ENTRY_MAX_SIZE 512 #define JIT_ENTRY_DEF_SIZE (MAX_PATH + sizeof(ATTACH_CMD_LINE) + 2) diff --git a/src/dbg/memory.cpp b/src/dbg/memory.cpp index d97ed075..ea584241 100644 --- a/src/dbg/memory.cpp +++ b/src/dbg/memory.cpp @@ -53,17 +53,16 @@ void MemUpdateMap() if (!ModNameFromAddr(pageStart, curPage.info, true)) { // Module lookup failed; check if it's a file mapping + wchar_t szMappedName[sizeof(curPage.info)] = L""; if ((mbi.Type == MEM_MAPPED) && - (GetMappedFileName(fdProcessInfo->hProcess, mbi.AllocationBase, curPage.info, MAX_MODULE_SIZE) != 0)) + (GetMappedFileNameW(fdProcessInfo->hProcess, mbi.AllocationBase, szMappedName, MAX_MODULE_SIZE) != 0)) { - // Get the file name only - char* fileStart = strrchr(curPage.info, '\\'); - size_t fileLen = strlen(fileStart); - - if (fileStart) - memmove(curPage.info, fileStart + 1, fileLen); - - curPage.info[fileLen] = '\0'; + bool bFileNameOnly = false; //TODO: setting for this + auto fileStart = wcsrchr(szMappedName, L'\\'); + if (bFileNameOnly && fileStart) + strcpy_s(curPage.info, StringUtils::Utf16ToUtf8(fileStart + 1).c_str()); + else + strcpy_s(curPage.info, StringUtils::Utf16ToUtf8(szMappedName).c_str()); } }