From d4b6dd670c527631476a9527e67d6804cc6107cd Mon Sep 17 00:00:00 2001 From: "mr.exodia" Date: Thu, 20 Mar 2014 00:55:40 +0100 Subject: [PATCH] BRIDGE: removed CPU title API GUI: added settings dialog DBG: added settings (breaking at various callbacks) DBG: remove singleshoot breakpoints from the database DBG: safe dprintf function DBG: set module + thread in window title DBG: remove memory breakpoints from modules when unloaded DBG: fixed a few bugs with the recent file list --- .gitignore | 1 + x64_dbg_bridge/bridgemain.cpp | 15 +- x64_dbg_bridge/bridgemain.h | 10 +- x64_dbg_dbg/_exports.cpp | 33 ++ x64_dbg_dbg/_global.cpp | 10 + x64_dbg_dbg/_global.h | 1 + x64_dbg_dbg/addrinfo.cpp | 3 + x64_dbg_dbg/breakpoint.cpp | 2 +- x64_dbg_dbg/breakpoint.h | 6 +- x64_dbg_dbg/console.cpp | 6 +- x64_dbg_dbg/debugger.cpp | 213 +++++++-- x64_dbg_gui/Project/DebuggerX64.pro | 9 +- x64_dbg_gui/Project/Src/Bridge/Bridge.cpp | 22 +- x64_dbg_gui/Project/Src/Bridge/Bridge.h | 4 +- x64_dbg_gui/Project/Src/Gui/MainWindow.cpp | 31 +- x64_dbg_gui/Project/Src/Gui/MainWindow.h | 4 +- x64_dbg_gui/Project/Src/Gui/MainWindow.ui | 71 +-- .../Project/Src/Gui/SettingsDialog.cpp | 245 ++++++++++ x64_dbg_gui/Project/Src/Gui/SettingsDialog.h | 83 ++++ x64_dbg_gui/Project/Src/Gui/SettingsDialog.ui | 435 ++++++++++++++++++ x64_dbg_gui/Project/Src/Gui/StatusLabel.cpp | 1 - x64_dbg_gui/Project/images/settings.png | Bin 0 -> 736 bytes x64_dbg_gui/Project/resource.qrc | 1 + 23 files changed, 1094 insertions(+), 112 deletions(-) create mode 100644 x64_dbg_gui/Project/Src/Gui/SettingsDialog.cpp create mode 100644 x64_dbg_gui/Project/Src/Gui/SettingsDialog.h create mode 100644 x64_dbg_gui/Project/Src/Gui/SettingsDialog.ui create mode 100644 x64_dbg_gui/Project/images/settings.png diff --git a/.gitignore b/.gitignore index 1f4970e4..ef33ba44 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,4 @@ x64_dbg_gui/Project/Src/Bridge/x32_bridge.lib x64_dbg_gui/Project/Src/Bridge/x64_bridge.lib help/output/* *.autosave +*.~vsd diff --git a/x64_dbg_bridge/bridgemain.cpp b/x64_dbg_bridge/bridgemain.cpp index 1e7ffa73..f9aa2ea5 100644 --- a/x64_dbg_bridge/bridgemain.cpp +++ b/x64_dbg_bridge/bridgemain.cpp @@ -570,6 +570,11 @@ BRIDGE_IMPEXP void DbgGetThreadList(THREADLIST* list) _dbg_sendmessage(DBG_GET_THREAD_LIST, list, 0); } +BRIDGE_IMPEXP void DbgSettingsUpdated() +{ + _dbg_sendmessage(DBG_SETTINGS_UPDATED, 0, 0); +} + //GUI BRIDGE_IMPEXP void GuiDisasmAt(duint addr, duint cip) { @@ -620,11 +625,6 @@ BRIDGE_IMPEXP void GuiUpdateWindowTitle(const char* filename) _gui_sendmessage(GUI_UPDATE_WINDOW_TITLE, (void*)filename, 0); } -BRIDGE_IMPEXP void GuiUpdateCPUTitle(const char* modname) -{ - _gui_sendmessage(GUI_UPDATE_CPU_TITLE, (void*)modname, 0); -} - BRIDGE_IMPEXP HWND GuiGetWindowHandle() { return (HWND)_gui_sendmessage(GUI_GET_WINDOW_HANDLE, 0, 0); @@ -759,6 +759,11 @@ BRIDGE_IMPEXP void GuiUpdateThreadView() _gui_sendmessage(GUI_UPDATE_THREAD_VIEW, 0, 0); } +BRIDGE_IMPEXP void GuiAddRecentFile(const char* file) +{ + _gui_sendmessage(GUI_ADD_RECENT_FILE, (void*)file, 0); +} + //Main BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { diff --git a/x64_dbg_bridge/bridgemain.h b/x64_dbg_bridge/bridgemain.h index b0bdfccc..f16d7787 100644 --- a/x64_dbg_bridge/bridgemain.h +++ b/x64_dbg_bridge/bridgemain.h @@ -116,7 +116,8 @@ enum DBGMSG DBG_MODBASE_FROM_NAME, // param1=const char* modname, param2=unused DBG_DISASM_AT, // param1=duint addr, param2=DISASM_INSTR* instr DBG_STACK_COMMENT_GET, // param1=duint addr, param2=STACK_COMMENT* comment - DBG_GET_THREAD_LIST // param1=THREADALLINFO* list, param2=unused + DBG_GET_THREAD_LIST, // param1=THREADALLINFO* list, param2=unused + DBG_SETTINGS_UPDATED // param1=unused, param2=unused }; enum SCRIPTLINETYPE @@ -421,6 +422,7 @@ BRIDGE_IMPEXP duint DbgModBaseFromName(const char* name); BRIDGE_IMPEXP void DbgDisasmAt(duint addr, DISASM_INSTR* instr); BRIDGE_IMPEXP bool DbgStackCommentGet(duint addr, STACK_COMMENT* comment); BRIDGE_IMPEXP void DbgGetThreadList(THREADLIST* list); +BRIDGE_IMPEXP void DbgSettingsUpdated(); //Gui enums enum GUIMSG @@ -433,7 +435,6 @@ enum GUIMSG GUI_UPDATE_DISASSEMBLY_VIEW, // param1=unused, param2=unused GUI_UPDATE_BREAKPOINTS_VIEW, // param1=unused, param2=unused GUI_UPDATE_WINDOW_TITLE, // param1=(const char*)file, param2=unused - GUI_UPDATE_CPU_TITLE, // param1=(const char*)mod, param2=unused GUI_SET_INFO_LINE, // param1=(int)line, param2=(const char*)text GUI_GET_WINDOW_HANDLE, // param1=unused, param2=unused GUI_DUMP_AT, // param1=(duint)va param2=unused @@ -460,7 +461,8 @@ enum GUIMSG GUI_REF_SETPROGRESS, // param1=int progress, param2=unused GUI_STACK_DUMP_AT, // param1=duint addr, param2=duint csp GUI_UPDATE_DUMP_VIEW, // param1=unused, param2=unused - GUI_UPDATE_THREAD_VIEW // param1=unused, param2=unused + GUI_UPDATE_THREAD_VIEW, // param1=unused, param2=unused + GUI_ADD_RECENT_FILE // param1=(const char*)file, param2=unused }; //GUI structures @@ -481,7 +483,6 @@ BRIDGE_IMPEXP void GuiUpdateRegisterView(); BRIDGE_IMPEXP void GuiUpdateDisassemblyView(); BRIDGE_IMPEXP void GuiUpdateBreakpointsView(); BRIDGE_IMPEXP void GuiUpdateWindowTitle(const char* filename); -BRIDGE_IMPEXP void GuiUpdateCPUTitle(const char* modname); BRIDGE_IMPEXP HWND GuiGetWindowHandle(); BRIDGE_IMPEXP void GuiDumpAt(duint va); BRIDGE_IMPEXP void GuiScriptAdd(int count, const char** lines); @@ -508,6 +509,7 @@ BRIDGE_IMPEXP void GuiReferenceSetProgress(int progress); BRIDGE_IMPEXP void GuiStackDumpAt(duint addr, duint csp); BRIDGE_IMPEXP void GuiUpdateDumpView(); BRIDGE_IMPEXP void GuiUpdateThreadView(); +BRIDGE_IMPEXP void GuiAddRecentFile(const char* file); #ifdef __cplusplus } diff --git a/x64_dbg_dbg/_exports.cpp b/x64_dbg_dbg/_exports.cpp index 8e15363d..31d250df 100644 --- a/x64_dbg_dbg/_exports.cpp +++ b/x64_dbg_dbg/_exports.cpp @@ -626,6 +626,39 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par threadgetlist((THREADLIST*)param1); } break; + + case DBG_SETTINGS_UPDATED: + { + uint setting; + if(BridgeSettingGetUint("Engine", "CalculationType", &setting)) + { + switch(setting) + { + case 0: //calc_signed + valuesetsignedcalc(true); + break; + case 1: //calc_unsigned + valuesetsignedcalc(false); + break; + } + } + if(BridgeSettingGetUint("Engine", "BreakpointType", &setting)) + { + switch(setting) + { + case 0: //break_int3short + SetBPXOptions(UE_BREAKPOINT_INT3); + break; + case 1: //break_int3long + SetBPXOptions(UE_BREAKPOINT_LONG_INT3); + break; + case 2: //break_ud2 + SetBPXOptions(UE_BREAKPOINT_UD2); + break; + } + } + } + break; } return 0; } diff --git a/x64_dbg_dbg/_global.cpp b/x64_dbg_dbg/_global.cpp index 5ff66903..958acd80 100644 --- a/x64_dbg_dbg/_global.cpp +++ b/x64_dbg_dbg/_global.cpp @@ -179,3 +179,13 @@ bool GetFileNameFromHandle(HANDLE hFile, char* szFileName) CloseHandle(hFileMap); return false; } + +bool settingboolget(const char* section, const char* name) +{ + uint setting; + if(!BridgeSettingGetUint(section, name, &setting)) + return false; + if(setting) + return true; + return false; +} \ No newline at end of file diff --git a/x64_dbg_dbg/_global.h b/x64_dbg_dbg/_global.h index 53e82ec5..2ae3b6c4 100644 --- a/x64_dbg_dbg/_global.h +++ b/x64_dbg_dbg/_global.h @@ -109,5 +109,6 @@ bool DirExists(const char* dir); bool DevicePathToPath(const char* devicepath, char* path, size_t path_size); bool PathToDevicePath(const char* path, char* devicepath, size_t devicepath_size); bool GetFileNameFromHandle(HANDLE hFile, char* szFileName); +bool settingboolget(const char* section, const char* name); #endif // _GLOBAL_H diff --git a/x64_dbg_dbg/addrinfo.cpp b/x64_dbg_dbg/addrinfo.cpp index 6e8a5967..a172d235 100644 --- a/x64_dbg_dbg/addrinfo.cpp +++ b/x64_dbg_dbg/addrinfo.cpp @@ -59,6 +59,9 @@ void dbclose() //NOTE: remove breakpoints without module if(!sqlexec(userdb, "DELETE FROM breakpoints WHERE mod IS NULL")) dprintf("SQL Error: %s\n", sqllasterror()); + //NOTE: remove singleshoot breakpoints (mostly temporary breakpoints) + if(!sqlexec(userdb, "DELETE FROM breakpoints WHERE singleshoot=1 AND type=0")) + dprintf("SQL Error: %s\n", sqllasterror()); dbsave(); wait(WAITID_USERDB); //wait for the SQLite operation to complete before closing lock(WAITID_USERDB); diff --git a/x64_dbg_dbg/breakpoint.cpp b/x64_dbg_dbg/breakpoint.cpp index da2dca78..f209fd95 100644 --- a/x64_dbg_dbg/breakpoint.cpp +++ b/x64_dbg_dbg/breakpoint.cpp @@ -319,4 +319,4 @@ void bptobridge(const BREAKPOINT* bp, BRIDGEBP* bridge) default: bridge->type=bp_none; } -} +} \ No newline at end of file diff --git a/x64_dbg_dbg/breakpoint.h b/x64_dbg_dbg/breakpoint.h index a1e3b2a1..95ec0503 100644 --- a/x64_dbg_dbg/breakpoint.h +++ b/x64_dbg_dbg/breakpoint.h @@ -7,9 +7,9 @@ //enums enum BP_TYPE { - BPNORMAL, - BPHARDWARE, - BPMEMORY + BPNORMAL=0, + BPHARDWARE=1, + BPMEMORY=2 }; //structs diff --git a/x64_dbg_dbg/console.cpp b/x64_dbg_dbg/console.cpp index ff35a6de..dfbec136 100644 --- a/x64_dbg_dbg/console.cpp +++ b/x64_dbg_dbg/console.cpp @@ -1,5 +1,7 @@ #include "console.h" +static char msg[66000]; + void dputs(const char* text) { dprintf("%s\n", text); @@ -9,7 +11,7 @@ void dprintf(const char* format, ...) { va_list args; va_start(args, format); - char msg[deflen]=""; - vsprintf(msg, format, args); + *msg=0; + vsnprintf(msg, sizeof(msg), format, args); GuiAddLogMessage(msg); } diff --git a/x64_dbg_dbg/debugger.cpp b/x64_dbg_dbg/debugger.cpp index 012c4ad1..4e56df58 100644 --- a/x64_dbg_dbg/debugger.cpp +++ b/x64_dbg_dbg/debugger.cpp @@ -84,7 +84,9 @@ void DebugUpdateGui(uint disasm_addr, bool stack) char modname[MAX_MODULE_SIZE]=""; if(!modnamefromaddr(disasm_addr, modname, true)) *modname=0; - GuiUpdateCPUTitle(modname); + char title[1024]=""; + sprintf(title, "File: %s - PID: %X - Module: %s - Thread: %X", szBaseFileName, fdProcessInfo->dwProcessId, modname, ((DEBUG_EVENT*)GetDebugData())->dwThreadId); + GuiUpdateWindowTitle(title); GuiUpdateAllViews(); } @@ -378,6 +380,8 @@ static bool cbRemoveModuleBreakpoints(const BREAKPOINT* bp) DeleteBPX(bp->addr); break; case BPMEMORY: + if(bp->enabled) + RemoveMemoryBPX(bp->addr, 0); break; case BPHARDWARE: if(bp->enabled) @@ -478,28 +482,35 @@ static void cbCreateProcess(CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo) bpenumall(cbSetModuleBreakpoints, modname); if(!bFileIsDll and !bIsAttached) //Set entry breakpoint { + pDebuggedBase=(uint)CreateProcessInfo->lpBaseOfImage; //debugged base = executable char command[256]=""; - sprintf(command, "bp "fhex",\"entry breakpoint\",ss", CreateProcessInfo->lpStartAddress); - cmddirectexec(dbggetcommandlist(), command); - pDebuggedBase=(uint)CreateProcessInfo->lpBaseOfImage; - DWORD NumberOfCallBacks=0; - TLSGrabCallBackData(DebugFileName, 0, &NumberOfCallBacks); - if(NumberOfCallBacks) + if(settingboolget("Events", "TlsCallbacks")) { - dprintf("TLS Callbacks: %d\n", NumberOfCallBacks); - uint* TLSCallBacks=(uint*)emalloc(NumberOfCallBacks*sizeof(uint), "cbCreateProcess:TLSCallBacks"); - if(!TLSGrabCallBackData(DebugFileName, TLSCallBacks, &NumberOfCallBacks)) - dputs("failed to get TLS callback addresses!"); - else + DWORD NumberOfCallBacks=0; + TLSGrabCallBackData(DebugFileName, 0, &NumberOfCallBacks); + if(NumberOfCallBacks) { - for(int i=0; ilpStartAddress); + cmddirectexec(dbggetcommandlist(), command); } } GuiUpdateBreakpointsView(); @@ -535,6 +546,28 @@ static void cbCreateThread(CREATE_THREAD_DEBUG_INFO* CreateThread) PLUG_CB_CREATETHREAD callbackInfo; callbackInfo.CreateThread=CreateThread; plugincbcall(CB_CREATETHREAD, &callbackInfo); + DWORD dwThreadId=((DEBUG_EVENT*)GetDebugData())->dwThreadId; + dprintf("Thread %X created\n", dwThreadId); + + if(settingboolget("Events", "ThreadStart")) + { + //update GUI + DebugUpdateGui(GetContextData(UE_CIP), true); + GuiSetDebugState(paused); + //lock + lock(WAITID_RUN); + PLUG_CB_PAUSEDEBUG pauseInfo; + pauseInfo.reserved=0; + plugincbcall(CB_PAUSEDEBUG, &pauseInfo); + wait(WAITID_RUN); + } + + if(settingboolget("Events", "ThreadEntry")) + { + char command[256]=""; + sprintf(command, "bp "fhex",\"Thread %X\",ss", CreateThread->lpStartAddress, dwThreadId); + cmddirectexec(dbggetcommandlist(), command); + } } static void cbExitThread(EXIT_THREAD_DEBUG_INFO* ExitThread) @@ -545,28 +578,45 @@ static void cbExitThread(EXIT_THREAD_DEBUG_INFO* ExitThread) callbackInfo.dwThreadId=dwThreadId; plugincbcall(CB_EXITTHREAD, &callbackInfo); threadexit(dwThreadId); + dprintf("Thread %X exit\n", dwThreadId); + + if(settingboolget("Events", "ThreadEnd")) + { + //update GUI + DebugUpdateGui(GetContextData(UE_CIP), true); + GuiSetDebugState(paused); + //lock + lock(WAITID_RUN); + PLUG_CB_PAUSEDEBUG pauseInfo; + pauseInfo.reserved=0; + plugincbcall(CB_PAUSEDEBUG, &pauseInfo); + wait(WAITID_RUN); + } } static void cbSystemBreakpoint(void* ExceptionData) { + //log message + dputs("system breakpoint reached!"); + bSkipExceptions=false; //we are not skipping first-chance exceptions + //plugin callbacks PLUG_CB_SYSTEMBREAKPOINT callbackInfo; callbackInfo.reserved=0; - - //TODO: handle stuff (TLS, main entry, etc) - //log message - dputs("system breakpoint reached!"); - //update GUI - DebugUpdateGui(GetContextData(UE_CIP), true); - GuiSetDebugState(paused); - //lock - lock(WAITID_RUN); - bSkipExceptions=false; - PLUG_CB_PAUSEDEBUG pauseInfo; - pauseInfo.reserved=0; - plugincbcall(CB_PAUSEDEBUG, &pauseInfo); plugincbcall(CB_SYSTEMBREAKPOINT, &callbackInfo); - wait(WAITID_RUN); + + if(settingboolget("Events", "SystemBreakpoint")) + { + //update GUI + DebugUpdateGui(GetContextData(UE_CIP), true); + GuiSetDebugState(paused); + //lock + lock(WAITID_RUN); + PLUG_CB_PAUSEDEBUG pauseInfo; + pauseInfo.reserved=0; + plugincbcall(CB_PAUSEDEBUG, &pauseInfo); + wait(WAITID_RUN); + } } static void cbLoadDll(LOAD_DLL_DEBUG_INFO* LoadDll) @@ -593,18 +643,44 @@ static void cbLoadDll(LOAD_DLL_DEBUG_INFO* LoadDll) { pDebuggedBase=(uint)base; char command[256]=""; - sprintf(command, "bp "fhex",\"entry breakpoint\",ss", pDebuggedBase+pDebuggedEntry); - cmddirectexec(dbggetcommandlist(), command); - //SetBPX(pDebuggedBase+pDebuggedEntry, UE_SINGLESHOOT, (void*)cbEntryBreakpoint); + if(settingboolget("Events", "EntryBreakpoint")) + { + sprintf(command, "bp "fhex",\"entry breakpoint\",ss", pDebuggedBase+pDebuggedEntry); + cmddirectexec(dbggetcommandlist(), command); + } } GuiUpdateBreakpointsView(); - //TODO: plugin callback + //plugin callback PLUG_CB_LOADDLL callbackInfo; callbackInfo.LoadDll=LoadDll; callbackInfo.modInfo=&modInfo; callbackInfo.modname=modname; plugincbcall(CB_LOADDLL, &callbackInfo); + + if(settingboolget("Events", "DllLoad")) + { + //update GUI + DebugUpdateGui(GetContextData(UE_CIP), true); + GuiSetDebugState(paused); + //lock + lock(WAITID_RUN); + PLUG_CB_PAUSEDEBUG pauseInfo; + pauseInfo.reserved=0; + plugincbcall(CB_PAUSEDEBUG, &pauseInfo); + wait(WAITID_RUN); + } + + if(settingboolget("Events", "DllEntry")) + { + uint oep=GetPE32Data(DLLDebugFileName, 0, UE_OEP); + if(oep) + { + char command[256]=""; + sprintf(command, "bp "fhex",\"DllMain (%s)\",ss", oep+(uint)base, modname); + cmddirectexec(dbggetcommandlist(), command); + } + } } static void cbUnloadDll(UNLOAD_DLL_DEBUG_INFO* UnloadDll) @@ -620,14 +696,47 @@ static void cbUnloadDll(UNLOAD_DLL_DEBUG_INFO* UnloadDll) bpenumall(cbRemoveModuleBreakpoints, modname); SymUnloadModule64(fdProcessInfo->hProcess, (DWORD64)base); dprintf("DLL Unloaded: "fhex" %s\n", base, modname); + + if(settingboolget("Events", "DllÙnload")) + { + //update GUI + DebugUpdateGui(GetContextData(UE_CIP), true); + GuiSetDebugState(paused); + //lock + lock(WAITID_RUN); + PLUG_CB_PAUSEDEBUG pauseInfo; + pauseInfo.reserved=0; + plugincbcall(CB_PAUSEDEBUG, &pauseInfo); + wait(WAITID_RUN); + } } static void cbOutputDebugString(OUTPUT_DEBUG_STRING_INFO* DebugString) { - //TODO: handle debug strings PLUG_CB_OUTPUTDEBUGSTRING callbackInfo; callbackInfo.DebugString=DebugString; plugincbcall(CB_OUTPUTDEBUGSTRING, &callbackInfo); + if(!DebugString->fUnicode) //ASCII + { + char* DebugText=(char*)emalloc(DebugString->nDebugStringLength+1, "cbOutputDebugString:DebugText"); + memset(DebugText, 0, DebugString->nDebugStringLength+1); + if(memread(fdProcessInfo->hProcess, DebugString->lpDebugStringData, DebugText, DebugString->nDebugStringLength, 0)) + dprintf("DebugString: \"%s\"\n", DebugText); + efree(DebugText, "cbOutputDebugString:DebugText"); + } + + if(settingboolget("Events", "DebugStrings")) + { + //update GUI + DebugUpdateGui(GetContextData(UE_CIP), true); + GuiSetDebugState(paused); + //lock + lock(WAITID_RUN); + PLUG_CB_PAUSEDEBUG pauseInfo; + pauseInfo.reserved=0; + plugincbcall(CB_PAUSEDEBUG, &pauseInfo); + wait(WAITID_RUN); + } } static void cbException(EXCEPTION_DEBUG_INFO* ExceptionData) @@ -723,7 +832,7 @@ static DWORD WINAPI threadDebugLoop(void* lpParameter) unlock(WAITID_STOP); return 0; } - BridgeSettingSet("Recent Files", "01", szFileName); + GuiAddRecentFile(szFileName); varset("$hp", (uint)fdProcessInfo->hProcess, true); varset("$pid", fdProcessInfo->dwProcessId, true); ecount=0; @@ -753,8 +862,6 @@ static DWORD WINAPI threadDebugLoop(void* lpParameter) plugincbcall(CB_INITDEBUG, &initInfo); //run debug loop (returns when process debugging is stopped) DebugLoop(); - //remove entry breakpoint from database - bpdel(pDebuggedBase+pDebuggedEntry, BPNORMAL); //call plugin callback PLUG_CB_STOPDEBUG stopInfo; stopInfo.reserved=0; @@ -870,20 +977,24 @@ CMDRESULT cbDebugSetBPXOptions(int argc, char* argv[]) if(!argget(*argv, argtype, 0, false)) return STATUS_ERROR; const char* a=0; + uint setting_type; if(strstr(argtype, "long")) { + setting_type=1; //break_int3long a="TYPE_LONG_INT3"; - type=UE_BREAKPOINT_TYPE_LONG_INT3; + type=UE_BREAKPOINT_LONG_INT3; } else if(strstr(argtype, "ud2")) { + setting_type=2; //break_ud2 a="TYPE_UD2"; - type=UE_BREAKPOINT_TYPE_UD2; + type=UE_BREAKPOINT_UD2; } else if(strstr(argtype, "short")) { + setting_type=0; //break_int3short a="TYPE_INT3"; - type=UE_BREAKPOINT_TYPE_INT3; + type=UE_BREAKPOINT_INT3; } else { @@ -891,6 +1002,7 @@ CMDRESULT cbDebugSetBPXOptions(int argc, char* argv[]) return STATUS_ERROR; } SetBPXOptions(type); + BridgeSettingSetUint("Engine", "BreakpointType", setting_type); dprintf("default breakpoint type set to: %s\n", a); return STATUS_CONTINUE; } @@ -940,9 +1052,24 @@ CMDRESULT cbDebugSetBPX(int argc, char* argv[]) //bp addr [,name [,type]] dputs("breakpoint already set!"); return STATUS_CONTINUE; } - if(IsBPXEnabled(addr) or !memread(fdProcessInfo->hProcess, (void*)addr, &oldbytes, sizeof(short), 0) or !SetBPX(addr, type, (void*)cbUserBreakpoint) or !bpnew(addr, true, singleshoot, oldbytes, BPNORMAL, type, bpname)) + if(IsBPXEnabled(addr)) { - dprintf("error setting breakpoint at "fhex"!\n", addr); + dprintf("error setting breakpoint at "fhex"!\n (IsBPXEnabled)", addr); + return STATUS_ERROR; + } + else if(!memread(fdProcessInfo->hProcess, (void*)addr, &oldbytes, sizeof(short), 0)) + { + dprintf("error setting breakpoint at "fhex"!\n (memread)", addr); + return STATUS_ERROR; + } + else if(!SetBPX(addr, type, (void*)cbUserBreakpoint)) + { + dprintf("error setting breakpoint at "fhex"! (SetBPX)\n", addr); + return STATUS_ERROR; + } + else if(!bpnew(addr, true, singleshoot, oldbytes, BPNORMAL, type, bpname)) + { + dprintf("error setting breakpoint at "fhex"!\n (bpnew)", addr); return STATUS_ERROR; } dprintf("breakpoint at "fhex" set!\n", addr); diff --git a/x64_dbg_gui/Project/DebuggerX64.pro b/x64_dbg_gui/Project/DebuggerX64.pro index 7387efce..70ae07e9 100644 --- a/x64_dbg_gui/Project/DebuggerX64.pro +++ b/x64_dbg_gui/Project/DebuggerX64.pro @@ -57,7 +57,8 @@ SOURCES += \ Src/BasicView/RegistersView.cpp \ Src/BasicView/SearchListView.cpp \ Src/BasicView/ReferenceView.cpp \ - Src/BasicView/ThreadView.cpp + Src/BasicView/ThreadView.cpp \ + Src/Gui/SettingsDialog.cpp HEADERS += \ @@ -95,7 +96,8 @@ HEADERS += \ Src/BasicView/SymbolView.h \ Src/BasicView/SearchListView.h \ Src/BasicView/ReferenceView.h \ - Src/BasicView/ThreadView.h + Src/BasicView/ThreadView.h \ + Src/Gui/SettingsDialog.h INCLUDEPATH += \ Src \ @@ -117,7 +119,8 @@ FORMS += \ Src/BasicView/WordEditDialog.ui \ Src/BasicView/LineEditDialog.ui \ Src/BasicView/SymbolView.ui \ - Src/BasicView/SearchListView.ui + Src/BasicView/SearchListView.ui \ + Src/Gui/SettingsDialog.ui INCLUDEPATH += $$PWD/Src/Bridge diff --git a/x64_dbg_gui/Project/Src/Bridge/Bridge.cpp b/x64_dbg_gui/Project/Src/Bridge/Bridge.cpp index 4a794c87..54cf870d 100644 --- a/x64_dbg_gui/Project/Src/Bridge/Bridge.cpp +++ b/x64_dbg_gui/Project/Src/Bridge/Bridge.cpp @@ -77,11 +77,6 @@ void Bridge::emitUpdateWindowTitle(QString filename) emit updateWindowTitle(filename); } -void Bridge::emitUpdateCPUTitle(QString modname) -{ - emit updateCPUTitle(modname); -} - void Bridge::emitSetInfoLine(int line, QString text) { emit setInfoLine(line, text); @@ -220,6 +215,11 @@ void Bridge::emitUpdateThreads() emit updateThreads(); } +void Bridge::emitAddRecentFile(QString file) +{ + emit addRecentFile(file); +} + /************************************************************************************ Static Functions ************************************************************************************/ @@ -293,12 +293,6 @@ __declspec(dllexport) void* _gui_sendmessage(GUIMSG type, void* param1, void* pa } break; - case GUI_UPDATE_CPU_TITLE: - { - Bridge::getBridge()->emitUpdateCPUTitle(QString(reinterpret_cast(param1))); - } - break; - case GUI_SET_INFO_LINE: { Bridge::getBridge()->emitSetInfoLine((int)(int_t)param1, QString(reinterpret_cast(param2))); @@ -462,6 +456,12 @@ __declspec(dllexport) void* _gui_sendmessage(GUIMSG type, void* param1, void* pa } break; + case GUI_ADD_RECENT_FILE: + { + Bridge::getBridge()->emitAddRecentFile(QString(reinterpret_cast(param1))); + } + break; + default: { } diff --git a/x64_dbg_gui/Project/Src/Bridge/Bridge.h b/x64_dbg_gui/Project/Src/Bridge/Bridge.h index 767ac594..b8b6a1a6 100644 --- a/x64_dbg_gui/Project/Src/Bridge/Bridge.h +++ b/x64_dbg_gui/Project/Src/Bridge/Bridge.h @@ -34,7 +34,6 @@ public: void emitUpdateRegisters(); void emitUpdateBreakpoints(); void emitUpdateWindowTitle(QString filename); - void emitUpdateCPUTitle(QString modname); void emitSetInfoLine(int line, QString text); void emitClearInfoBox(); void emitDumpAt(int_t va); @@ -60,6 +59,7 @@ public: void emitStackDumpAt(uint_t va, uint_t csp); void emitUpdateDump(); void emitUpdateThreads(); + void emitAddRecentFile(QString file); //Public variables void* winId; @@ -76,7 +76,6 @@ signals: void updateRegisters(); void updateBreakpoints(); void updateWindowTitle(QString filename); - void updateCPUTitle(QString modname); void setInfoLine(int line, QString text); void dumpAt(int_t va); void scriptAdd(int count, const char** lines); @@ -101,6 +100,7 @@ signals: void stackDumpAt(uint_t va, uint_t csp); void updateDump(); void updateThreads(); + void addRecentFile(QString file); private: QMutex mBridgeMutex; diff --git a/x64_dbg_gui/Project/Src/Gui/MainWindow.cpp b/x64_dbg_gui/Project/Src/Gui/MainWindow.cpp index 8b3f6106..679446a5 100644 --- a/x64_dbg_gui/Project/Src/Gui/MainWindow.cpp +++ b/x64_dbg_gui/Project/Src/Gui/MainWindow.cpp @@ -125,9 +125,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi connect(mSymbolView,SIGNAL(showCpu()),this,SLOT(displayCpuWidget())); connect(ui->actionReferences,SIGNAL(triggered()),this,SLOT(displayReferencesWidget())); connect(ui->actionThreads,SIGNAL(triggered()),this,SLOT(displayThreadsWidget())); + connect(ui->actionSettings,SIGNAL(triggered()),this,SLOT(openSettings())); connect(Bridge::getBridge(), SIGNAL(updateWindowTitle(QString)), this, SLOT(updateWindowTitleSlot(QString))); - connect(Bridge::getBridge(), SIGNAL(updateCPUTitle(QString)), this, SLOT(updateCPUTitleSlot(QString))); + connect(Bridge::getBridge(), SIGNAL(addRecentFile(QString)), this, SLOT(addRecentFile(QString))); const char* errormsg=DbgInit(); if(errormsg) @@ -165,7 +166,8 @@ void MainWindow::loadMRUList(int maxItems) char currentFile[MAX_PATH]=""; if(!BridgeSettingGet("Recent Files", QString().sprintf("%.2d", i+1).toUtf8().constData(), currentFile)) break; - mMRUList.push_back(currentFile); + if(QString(currentFile).size()) + mMRUList.push_back(currentFile); } updateMRUMenu(); } @@ -180,6 +182,8 @@ void MainWindow::saveMRUList() void MainWindow::addMRUEntry(QString entry) { + if(!entry.size()) + return; //remove duplicate entry if it exists removeMRUEntry(entry); mMRUList.insert(mMRUList.begin(), entry); @@ -189,6 +193,8 @@ void MainWindow::addMRUEntry(QString entry) void MainWindow::removeMRUEntry(QString entry) { + if(!entry.size()) + return; std::vector::iterator it; for (it = mMRUList.begin(); it != mMRUList.end(); ++it) @@ -450,14 +456,6 @@ void MainWindow::updateWindowTitleSlot(QString filename) setWindowTitle(QString(mWindowMainTitle)); } -void MainWindow::updateCPUTitleSlot(QString modname) -{ - if(modname.length()) - mCpuWidget->setWindowTitle(QString("CPU - ")+modname); - else - mCpuWidget->setWindowTitle(QString("CPU")); -} - void MainWindow::execeStepOver() { DbgCmdExec("eStepOver"); @@ -504,3 +502,16 @@ void MainWindow::displayThreadsWidget() mThreadView->setFocus(); setTab(mThreadView); } + +void MainWindow::openSettings() +{ + SettingsDialog settings(this); + settings.exec(); +} + +void MainWindow::addRecentFile(QString file) +{ + addMRUEntry(file); + updateMRUMenu(); + saveMRUList(); +} diff --git a/x64_dbg_gui/Project/Src/Gui/MainWindow.h b/x64_dbg_gui/Project/Src/Gui/MainWindow.h index e81eb69b..3c876058 100644 --- a/x64_dbg_gui/Project/Src/Gui/MainWindow.h +++ b/x64_dbg_gui/Project/Src/Gui/MainWindow.h @@ -16,6 +16,7 @@ #include "SymbolView.h" #include "ReferenceView.h" #include "ThreadView.h" +#include "SettingsDialog.h" namespace Ui { class MainWindow; @@ -48,7 +49,6 @@ public slots: void restartDebugging(); void displayBreakpointWidget(); void updateWindowTitleSlot(QString filename); - void updateCPUTitleSlot(QString modname); void execeStepOver(); void execeStepInto(); void execeRun(); @@ -57,6 +57,8 @@ public slots: void displaySymbolWidget(); void displayReferencesWidget(); void displayThreadsWidget(); + void openSettings(); + void addRecentFile(QString file); private: Ui::MainWindow *ui; diff --git a/x64_dbg_gui/Project/Src/Gui/MainWindow.ui b/x64_dbg_gui/Project/Src/Gui/MainWindow.ui index d62a6c7f..d9ef5bc2 100644 --- a/x64_dbg_gui/Project/Src/Gui/MainWindow.ui +++ b/x64_dbg_gui/Project/Src/Gui/MainWindow.ui @@ -28,11 +28,11 @@ - File + &File - Recent Files + &Recent Files @@ -43,7 +43,7 @@ - View + &View @@ -56,7 +56,7 @@ - Debug + &Debug @@ -76,20 +76,27 @@ - Help + &Help - Plugins + &Plugins + + + &Options + + + + @@ -155,7 +162,7 @@ :/icons/images/folder-horizontal-open.png:/icons/images/folder-horizontal-open.png - Open + &Open F3 @@ -167,7 +174,7 @@ :/icons/images/control-exit.png:/icons/images/control-exit.png - Exit + E&xit Alt+X @@ -179,7 +186,7 @@ :/icons/images/arrow-run.png:/icons/images/arrow-run.png - Run + &Run F9 @@ -191,7 +198,7 @@ :/icons/images/control-pause.png:/icons/images/control-pause.png - Pause + &Pause F12 @@ -203,7 +210,7 @@ :/icons/images/arrow-restart.png:/icons/images/arrow-restart.png - Restart + Re&start Ctrl+F2 @@ -215,7 +222,7 @@ :/icons/images/control-stop.png:/icons/images/control-stop.png - Close + &Close Alt+F2 @@ -227,7 +234,7 @@ :/icons/images/arrow-step-into.png:/icons/images/arrow-step-into.png - Step into + Step &into F7 @@ -239,7 +246,7 @@ :/icons/images/arrow-step-over.png:/icons/images/arrow-step-over.png - Step over + Step &over F8 @@ -251,7 +258,7 @@ :/icons/images/terminal-command.png:/icons/images/terminal-command.png - Command + Co&mmand Ctrl+Return @@ -263,7 +270,7 @@ :/icons/images/arrow-step-rtr.png:/icons/images/arrow-step-rtr.png - Execute till return + E&xecute till return Ctrl+F9 @@ -275,7 +282,7 @@ :/icons/images/memory-map.png:/icons/images/memory-map.png - Memory Map + &Memory Map Alt+M @@ -287,7 +294,7 @@ :/icons/images/log.png:/icons/images/log.png - Log Window + &Log Window Alt+L @@ -320,7 +327,7 @@ :/icons/images/breakpoint.png:/icons/images/breakpoint.png - Breakpoints + &Breakpoints Alt+B @@ -356,7 +363,7 @@ :/icons/images/arrow-run.png:/icons/images/arrow-run.png - Run (skip exceptions) + Run (&skip exceptions) Shift+F9 @@ -380,7 +387,7 @@ :/icons/images/script-code.png:/icons/images/script-code.png - Script + &Script Script @@ -395,7 +402,7 @@ :/icons/images/arrow-run-cursor.png:/icons/images/arrow-run-cursor.png - Run until selection + Run &until selection Run until selection @@ -410,7 +417,7 @@ :/icons/images/processor-cpu.png:/icons/images/processor-cpu.png - CPU + &CPU CPU @@ -425,7 +432,7 @@ :/icons/images/pdb.png:/icons/images/pdb.png - Symbol Info + Symbol &Info Symbol Info @@ -440,7 +447,7 @@ :/icons/images/search.png:/icons/images/search.png - References + &References References @@ -455,7 +462,7 @@ :/icons/images/arrow-threads.png:/icons/images/arrow-threads.png - Threads + &Threads Threads @@ -464,6 +471,18 @@ Alt+T + + + + :/icons/images/settings.png:/icons/images/settings.png + + + &Preferences + + + Settings + + diff --git a/x64_dbg_gui/Project/Src/Gui/SettingsDialog.cpp b/x64_dbg_gui/Project/Src/Gui/SettingsDialog.cpp new file mode 100644 index 00000000..01d4a3c4 --- /dev/null +++ b/x64_dbg_gui/Project/Src/Gui/SettingsDialog.cpp @@ -0,0 +1,245 @@ +#include "SettingsDialog.h" +#include "ui_SettingsDialog.h" + +SettingsDialog::SettingsDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::SettingsDialog) +{ + ui->setupUi(this); + //set window flags + setModal(true); + setWindowFlags(Qt::Dialog | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::MSWindowsFixedSizeDialogHint); + setFixedSize(this->size()); //fixed size + LoadSettings(); //load settings from file +} + +SettingsDialog::~SettingsDialog() +{ + delete ui; +} + +void SettingsDialog::GetSettingBool(const char* section, const char* name, bool* set) +{ + duint currentSetting; + if(!set || !BridgeSettingGetUint(section, name, ¤tSetting)) + return; + if(currentSetting) + *set=true; + else + *set=false; +} + +Qt::CheckState SettingsDialog::bool2check(bool checked) +{ + if(checked) + return Qt::Checked; + return Qt::Unchecked; +} + +void SettingsDialog::LoadSettings() +{ + //Defaults + memset(&settings, 0, sizeof(SettingsStruct)); + settings.eventSystemBreakpoint=true; + settings.eventTlsCallbacks=true; + settings.eventEntryBreakpoint=true; + settings.engineCalcType=calc_unsigned; + settings.engineBreakpointType=break_int3short; + + //Events tab + GetSettingBool("Events", "SystemBreakpoint", &settings.eventSystemBreakpoint); + GetSettingBool("Events", "TlsCallbacks", &settings.eventTlsCallbacks); + GetSettingBool("Events", "EntryBreakpoint", &settings.eventEntryBreakpoint); + GetSettingBool("Events", "DllEntry", &settings.eventDllEntry); + GetSettingBool("Events", "ThreadEntry", &settings.eventThreadEntry); + GetSettingBool("Events", "DllLoad", &settings.eventDllLoad); + GetSettingBool("Events", "DllUnload", &settings.eventDllUnload); + GetSettingBool("Events", "ThreadStart", &settings.eventThreadStart); + GetSettingBool("Events", "ThreadEnd", &settings.eventThreadEnd); + GetSettingBool("Events", "DebugStrings", &settings.eventDebugStrings); + ui->chkSystemBreakpoint->setCheckState(bool2check(settings.eventSystemBreakpoint)); + ui->chkTlsCallbacks->setCheckState(bool2check(settings.eventTlsCallbacks)); + ui->chkEntryBreakpoint->setCheckState(bool2check(settings.eventEntryBreakpoint)); + ui->chkDllEntry->setCheckState(bool2check(settings.eventDllEntry)); + ui->chkThreadEntry->setCheckState(bool2check(settings.eventThreadEntry)); + ui->chkDllLoad->setCheckState(bool2check(settings.eventDllLoad)); + ui->chkDllUnload->setCheckState(bool2check(settings.eventDllUnload)); + ui->chkThreadStart->setCheckState(bool2check(settings.eventThreadStart)); + ui->chkThreadEnd->setCheckState(bool2check(settings.eventThreadEnd)); + ui->chkDebugStrings->setCheckState(bool2check(settings.eventDebugStrings)); + + //Engine tab + duint cur; + if(BridgeSettingGetUint("Engine", "CalculationType", &cur)) + { + switch(cur) + { + case calc_signed: + case calc_unsigned: + settings.engineCalcType=(CalcType)cur; + break; + } + } + if(BridgeSettingGetUint("Engine", "BreakpointType", &cur)) + { + switch(cur) + { + case break_int3short: + case break_int3long: + case break_ud2: + settings.engineBreakpointType=(BreakpointType)cur; + break; + } + } + switch(settings.engineCalcType) + { + case calc_signed: + ui->radioSigned->setChecked(true); + break; + case calc_unsigned: + ui->radioUnsigned->setChecked(true); + break; + } + switch(settings.engineBreakpointType) + { + case break_int3short: + ui->radioInt3Short->setChecked(true); + break; + case break_int3long: + ui->radioInt3Long->setChecked(true); + break; + case break_ud2: + ui->radioUd2->setChecked(true); + break; + } +} + +void SettingsDialog::SaveSettings() +{ + //Events tab + BridgeSettingSetUint("Events", "SystemBreakpoint", settings.eventSystemBreakpoint); + BridgeSettingSetUint("Events", "TlsCallbacks", settings.eventTlsCallbacks); + BridgeSettingSetUint("Events", "EntryBreakpoint", settings.eventEntryBreakpoint); + BridgeSettingSetUint("Events", "DllEntry", settings.eventDllEntry); + BridgeSettingSetUint("Events", "ThreadEntry", settings.eventThreadEntry); + BridgeSettingSetUint("Events", "DllLoad", settings.eventDllLoad); + BridgeSettingSetUint("Events", "DllUnload", settings.eventDllUnload); + BridgeSettingSetUint("Events", "ThreadStart", settings.eventThreadStart); + BridgeSettingSetUint("Events", "ThreadEnd", settings.eventThreadEnd); + BridgeSettingSetUint("Events", "DebugStrings", settings.eventDebugStrings); + + //Engine tab + BridgeSettingSetUint("Engine", "CalculationType", settings.engineCalcType); + BridgeSettingSetUint("Engine", "BreakpointType", settings.engineBreakpointType); +} + +void SettingsDialog::on_chkSystemBreakpoint_stateChanged(int arg1) +{ + if(arg1==Qt::Unchecked) + settings.eventSystemBreakpoint=false; + else + settings.eventSystemBreakpoint=true; +} + +void SettingsDialog::on_chkTlsCallbacks_stateChanged(int arg1) +{ + if(arg1==Qt::Unchecked) + settings.eventTlsCallbacks=false; + else + settings.eventTlsCallbacks=true; +} + +void SettingsDialog::on_chkEntryBreakpoint_stateChanged(int arg1) +{ + if(arg1==Qt::Unchecked) + settings.eventEntryBreakpoint=false; + else + settings.eventEntryBreakpoint=true; +} + +void SettingsDialog::on_chkDllEntry_stateChanged(int arg1) +{ + if(arg1==Qt::Unchecked) + settings.eventDllEntry=false; + else + settings.eventDllEntry=true; +} + +void SettingsDialog::on_chkThreadEntry_stateChanged(int arg1) +{ + if(arg1==Qt::Unchecked) + settings.eventThreadEntry=false; + else + settings.eventThreadEntry=true; +} + +void SettingsDialog::on_chkDllLoad_stateChanged(int arg1) +{ + if(arg1==Qt::Unchecked) + settings.eventDllLoad=false; + else + settings.eventDllLoad=true; +} + +void SettingsDialog::on_chkDllUnload_stateChanged(int arg1) +{ + if(arg1==Qt::Unchecked) + settings.eventDllUnload=false; + else + settings.eventDllUnload=true; +} + +void SettingsDialog::on_chkThreadStart_stateChanged(int arg1) +{ + if(arg1==Qt::Unchecked) + settings.eventThreadStart=false; + else + settings.eventThreadStart=true; +} + +void SettingsDialog::on_chkThreadEnd_stateChanged(int arg1) +{ + if(arg1==Qt::Unchecked) + settings.eventThreadEnd=false; + else + settings.eventThreadEnd=true; +} + +void SettingsDialog::on_chkDebugStrings_stateChanged(int arg1) +{ + if(arg1==Qt::Unchecked) + settings.eventDebugStrings=false; + else + settings.eventDebugStrings=true; +} + +void SettingsDialog::on_radioUnsigned_clicked() +{ + settings.engineCalcType=calc_unsigned; +} + +void SettingsDialog::on_radioSigned_clicked() +{ + settings.engineCalcType=calc_signed; +} + +void SettingsDialog::on_radioInt3Short_clicked() +{ + settings.engineBreakpointType=break_int3short; +} + +void SettingsDialog::on_radioInt3Long_clicked() +{ + settings.engineBreakpointType=break_int3long; +} + +void SettingsDialog::on_radioUd2_clicked() +{ + settings.engineBreakpointType=break_ud2; +} + +void SettingsDialog::on_btnSave_clicked() +{ + SaveSettings(); + DbgSettingsUpdated(); +} diff --git a/x64_dbg_gui/Project/Src/Gui/SettingsDialog.h b/x64_dbg_gui/Project/Src/Gui/SettingsDialog.h new file mode 100644 index 00000000..0d31083a --- /dev/null +++ b/x64_dbg_gui/Project/Src/Gui/SettingsDialog.h @@ -0,0 +1,83 @@ +#ifndef SETTINGSDIALOG_H +#define SETTINGSDIALOG_H + +#include +#include "Bridge.h" + +namespace Ui { +class SettingsDialog; +} + +class SettingsDialog : public QDialog +{ + Q_OBJECT + +public: + explicit SettingsDialog(QWidget *parent = 0); + ~SettingsDialog(); + +private slots: + void on_chkSystemBreakpoint_stateChanged(int arg1); + void on_chkTlsCallbacks_stateChanged(int arg1); + void on_chkEntryBreakpoint_stateChanged(int arg1); + void on_chkDllEntry_stateChanged(int arg1); + void on_chkThreadEntry_stateChanged(int arg1); + void on_chkDllLoad_stateChanged(int arg1); + void on_chkDllUnload_stateChanged(int arg1); + void on_chkThreadStart_stateChanged(int arg1); + void on_chkThreadEnd_stateChanged(int arg1); + void on_chkDebugStrings_stateChanged(int arg1); + void on_radioUnsigned_clicked(); + void on_radioSigned_clicked(); + void on_radioInt3Short_clicked(); + void on_radioInt3Long_clicked(); + void on_radioUd2_clicked(); + void on_btnSave_clicked(); + +private: + //enums + enum CalcType + { + calc_signed=0, + calc_unsigned=1 + }; + + enum BreakpointType + { + break_int3short=0, + break_int3long=1, + break_ud2=2 + }; + + //structures + struct SettingsStruct + { + //Event Tab + bool eventSystemBreakpoint; + bool eventTlsCallbacks; + bool eventEntryBreakpoint; + bool eventDllEntry; + bool eventThreadEntry; + bool eventDllLoad; + bool eventDllUnload; + bool eventThreadStart; + bool eventThreadEnd; + bool eventDebugStrings; + //Engine Tab + CalcType engineCalcType; + BreakpointType engineBreakpointType; + //Exception Tab + }; + + //variables + Ui::SettingsDialog *ui; + SettingsStruct settings; + + //functions + void GetSettingBool(const char* section, const char* name, bool* set); + Qt::CheckState bool2check(bool checked); + void LoadSettings(); + void SaveSettings(); +}; + +#endif // SETTINGSDIALOG_H diff --git a/x64_dbg_gui/Project/Src/Gui/SettingsDialog.ui b/x64_dbg_gui/Project/Src/Gui/SettingsDialog.ui new file mode 100644 index 00000000..14cb90e8 --- /dev/null +++ b/x64_dbg_gui/Project/Src/Gui/SettingsDialog.ui @@ -0,0 +1,435 @@ + + + SettingsDialog + + + + 0 + 0 + 262 + 201 + + + + + 0 + 0 + + + + Settings + + + + :/icons/images/settings.png:/icons/images/settings.png + + + true + + + + + 2 + 2 + 261 + 161 + + + + true + + + 0 + + + + Events + + + + + 10 + 10 + 46 + 13 + + + + Break on: + + + + + + 20 + 30 + 111 + 17 + + + + System Breakpoint + + + false + + + + + + 20 + 50 + 111 + 17 + + + + TLS Callbacks + + + false + + + + + + 20 + 70 + 111 + 17 + + + + Entry Breakpoint + + + false + + + + + + 140 + 30 + 111 + 17 + + + + DLL Load + + + + + + 140 + 50 + 111 + 17 + + + + DLL Unload + + + + + + 140 + 70 + 111 + 17 + + + + Thread Start + + + + + + 140 + 90 + 111 + 17 + + + + Thread End + + + + + + 140 + 110 + 111 + 17 + + + + Debug Strings + + + + + + 20 + 90 + 111 + 17 + + + + DLL Entry + + + + + + 20 + 110 + 111 + 17 + + + + Thread Entry + + + + + + Engine + + + + + 10 + 10 + 91 + 16 + + + + Calculation Type: + + + + + + 10 + 60 + 121 + 16 + + + + Default Breakpoint Type: + + + + + + 20 + 30 + 142 + 19 + + + + + + + &Signed + + + true + + + + + + + &Unsigned + + + + + + + + + 20 + 80 + 175 + 19 + + + + + + + INT3 + + + true + + + + + + + Long INT3 + + + + + + + UD2 + + + + + + + + + Exceptions + + + + + 10 + 30 + 151 + 81 + + + + + Courier New + 8 + + + + Qt::ScrollBarAlwaysOn + + + + + + 10 + 10 + 101 + 16 + + + + Ignored Exceptions: + + + + + + 170 + 30 + 77 + 83 + + + + + + + Add &Range + + + + + + + &Delete Range + + + + + + + Add &Last + + + + + + + + + + + 100 + 170 + 75 + 23 + + + + Save + + + true + + + + + + 180 + 170 + 75 + 23 + + + + Cancel + + + + + + + + + btnCancel + clicked() + SettingsDialog + reject() + + + 358 + 252 + + + 357 + 236 + + + + + btnSave + clicked() + SettingsDialog + accept() + + + 286 + 250 + + + 279 + 236 + + + + + diff --git a/x64_dbg_gui/Project/Src/Gui/StatusLabel.cpp b/x64_dbg_gui/Project/Src/Gui/StatusLabel.cpp index 77fac8ed..01e70d78 100644 --- a/x64_dbg_gui/Project/Src/Gui/StatusLabel.cpp +++ b/x64_dbg_gui/Project/Src/Gui/StatusLabel.cpp @@ -37,7 +37,6 @@ void StatusLabel::debugStateChangedSlot(DBGSTATE state) this->setText("Terminated"); this->setStyleSheet("QLabel { background-color : #c0c0c0; }"); GuiUpdateWindowTitle(""); - GuiUpdateCPUTitle(""); break; default: break; diff --git a/x64_dbg_gui/Project/images/settings.png b/x64_dbg_gui/Project/images/settings.png new file mode 100644 index 0000000000000000000000000000000000000000..efc599dccd80edc8de876fac9972c73f7eca5be8 GIT binary patch literal 736 zcmV<60w4W}P)hGF=|Oun8VWu1<|P*eAy^1lg_2fMXiUVG z*kVmf6gMU&wvxZyb-pwkdh_6e*%{{hzIktF-V-!UqyJeVK7l}h3OY6j>-X zFe)s>$N>WfTxdE?$nEw>vDiBac)9$Oc6PoHu&%BncAiv(3v6|o z$X!K|n~}&|NS2FyBdrvVzy6xbZ4wMIa=^d=7n)8J`I5jckB*K#PbSwjx4S=Vx7!~j z5*ZDK7&&0zfD29Q9qEq=W3pPUew)oUZLwHR!mq7;(=wTyb}$DHxccU;CJJaV(NVTz zY=;2y!#c$eYydG&;}c)!kL}xAXOr0qtZnKA(2K)u6aVpo6}COLKde>%3NQcyI)!o1 S)6Yi$0000images/pdb.png images/search.png images/arrow-threads.png + images/settings.png