├── .clang-format ├── .editorconfig ├── .github ├── FUNDING.yml └── workflows │ └── build.yaml ├── .gitignore ├── .gitmodules ├── .travis.yml ├── BUGS ├── CHANGELOG ├── CMakeLists.txt ├── COPYING ├── README.md ├── TODO ├── appveyor.yml ├── cmake └── Modules │ ├── AddWarnings.cmake │ ├── DetectArchitecture.cmake │ ├── DetectCompiler.cmake │ ├── DetectGitBranch.cmake │ ├── DetectOS.cmake │ ├── EnableSTLDebug.cmake │ ├── EnableSanitizers.cmake │ ├── FindCapstone.cmake │ └── ProjectDefaults.cmake ├── cspell.config.yaml ├── edb.1 ├── edb.appdata.xml ├── edb.desktop ├── include ├── API.h ├── ArchProcessor.h ├── BasicBlock.h ├── BinaryString.h ├── ByteShiftArray.h ├── Configuration.h ├── Expression.h ├── Expression.tcc ├── FloatX.h ├── Function.h ├── GraphEdge.h ├── GraphNode.h ├── GraphWidget.h ├── HexStringValidator.h ├── IAnalyzer.h ├── IBinary.h ├── IBreakpoint.h ├── IDebugEvent.h ├── IDebugEventHandler.h ├── IDebugger.h ├── IPlugin.h ├── IProcess.h ├── IRegion.h ├── IState.h ├── ISymbolGenerator.h ├── ISymbolManager.h ├── IThread.h ├── Instruction.h ├── MemoryRegions.h ├── Module.h ├── Patch.h ├── Prototype.h ├── QLongValidator.h ├── QULongValidator.h ├── QtHelper.h ├── Register.h ├── RegisterRef.h ├── RegisterViewModelBase.h ├── State.h ├── Status.h ├── Symbol.h ├── Theme.h ├── ThreadsModel.h ├── Types.h ├── Util.h ├── Value.h ├── arch │ ├── arm-generic │ │ └── ArchTypes.h │ └── x86-generic │ │ └── ArchTypes.h ├── edb.h ├── os │ ├── unix │ │ ├── OSTypes.h │ │ └── linux │ │ │ └── linker.h │ └── win32 │ │ └── OSTypes.h ├── string_hash.h ├── util │ ├── Container.h │ ├── Error.h │ ├── Float.h │ ├── Font.h │ ├── Integer.h │ ├── Math.h │ └── String.h └── version.h.in ├── lib ├── CMakeLists.txt ├── libELF │ ├── CMakeLists.txt │ └── include │ │ └── libELF │ │ ├── elf_auxv.h │ │ ├── elf_binary.h │ │ ├── elf_dyn.h │ │ ├── elf_header.h │ │ ├── elf_model.h │ │ ├── elf_move.h │ │ ├── elf_nhdr.h │ │ ├── elf_phdr.h │ │ ├── elf_rel.h │ │ ├── elf_rela.h │ │ ├── elf_shdr.h │ │ ├── elf_sym.h │ │ ├── elf_syminfo.h │ │ ├── elf_types.h │ │ ├── elf_verdaux.h │ │ ├── elf_verdef.h │ │ ├── elf_vernaux.h │ │ └── elf_verneed.h └── libPE │ ├── CMakeLists.txt │ └── include │ └── libPE │ └── pe_binary.h ├── pkg ├── deb │ └── create-deb-qt5.sh └── fedora │ └── edb.spec ├── plugins ├── Analyzer │ ├── Analyzer.cpp │ ├── Analyzer.h │ ├── AnalyzerWidget.cpp │ ├── AnalyzerWidget.h │ ├── CMakeLists.txt │ ├── DialogXRefs.cpp │ ├── DialogXRefs.h │ ├── DialogXRefs.ui │ ├── OptionsPage.cpp │ ├── OptionsPage.h │ ├── OptionsPage.ui │ ├── SpecifiedFunctions.cpp │ ├── SpecifiedFunctions.h │ └── SpecifiedFunctions.ui ├── Assembler │ ├── Assembler.cpp │ ├── Assembler.h │ ├── Assembler.qrc │ ├── CMakeLists.txt │ ├── DialogAssembler.cpp │ ├── DialogAssembler.h │ ├── DialogAssembler.ui │ ├── OptionsPage.cpp │ ├── OptionsPage.h │ ├── OptionsPage.ui │ └── xml │ │ └── assemblers.xml ├── Backtrace │ ├── Backtrace.cpp │ ├── Backtrace.h │ ├── CMakeLists.txt │ ├── CallStack.cpp │ ├── CallStack.h │ ├── DialogBacktrace.cpp │ ├── DialogBacktrace.h │ └── DialogBacktrace.ui ├── BinaryInfo │ ├── BinaryInfo.cpp │ ├── BinaryInfo.h │ ├── CMakeLists.txt │ ├── DialogHeader.cpp │ ├── DialogHeader.h │ ├── DialogHeader.ui │ ├── DialogRegions.cpp │ ├── DialogRegions.h │ ├── DialogRegions.ui │ ├── ELF32.cpp │ ├── ELF64.cpp │ ├── ELFXX.cpp │ ├── ELFXX.h │ ├── OptionsPage.cpp │ ├── OptionsPage.h │ ├── OptionsPage.ui │ ├── PE32.cpp │ ├── PE32.h │ ├── demangle.h │ ├── symbols.cpp │ └── symbols.h ├── BinarySearcher │ ├── BinarySearcher.cpp │ ├── BinarySearcher.h │ ├── CMakeLists.txt │ ├── DialogAsciiString.cpp │ ├── DialogAsciiString.h │ ├── DialogAsciiString.ui │ ├── DialogBinaryString.cpp │ ├── DialogBinaryString.h │ ├── DialogBinaryString.ui │ ├── DialogResults.cpp │ ├── DialogResults.h │ └── DialogResults.ui ├── Bookmarks │ ├── BookmarkWidget.cpp │ ├── BookmarkWidget.h │ ├── BookmarkWidget.ui │ ├── Bookmarks.cpp │ ├── Bookmarks.h │ ├── BookmarksModel.cpp │ ├── BookmarksModel.h │ └── CMakeLists.txt ├── BreakpointManager │ ├── BreakpointManager.cpp │ ├── BreakpointManager.h │ └── CMakeLists.txt ├── CMakeLists.txt ├── CheckVersion │ ├── CMakeLists.txt │ ├── CheckVersion.cpp │ ├── CheckVersion.h │ ├── OptionsPage.cpp │ ├── OptionsPage.h │ └── OptionsPage.ui ├── DebuggerCore │ ├── CMakeLists.txt │ ├── DebuggerCoreBase.cpp │ ├── DebuggerCoreBase.h │ ├── arch │ │ ├── arm-generic │ │ │ ├── Breakpoint.cpp │ │ │ └── Breakpoint.h │ │ └── x86-generic │ │ │ ├── Breakpoint.cpp │ │ │ └── Breakpoint.h │ ├── unix │ │ ├── Posix.cpp │ │ ├── Posix.h │ │ ├── Unix.cpp │ │ ├── Unix.h │ │ ├── freebsd │ │ │ ├── DebuggerCore.cpp │ │ │ ├── DebuggerCore.h │ │ │ ├── PlatformCommon.cpp │ │ │ ├── PlatformCommon.h │ │ │ ├── PlatformEvent.cpp │ │ │ ├── PlatformEvent.h │ │ │ ├── PlatformProcess.cpp │ │ │ ├── PlatformProcess.h │ │ │ ├── PlatformRegion.cpp │ │ │ ├── PlatformRegion.h │ │ │ ├── PlatformState.cpp │ │ │ ├── PlatformState.h │ │ │ ├── PlatformThread.cpp │ │ │ └── PlatformThread.h │ │ ├── linux │ │ │ ├── DebuggerCore.cpp │ │ │ ├── DebuggerCore.h │ │ │ ├── DialogMemoryAccess.cpp │ │ │ ├── DialogMemoryAccess.h │ │ │ ├── DialogMemoryAccess.ui │ │ │ ├── FeatureDetect.cpp │ │ │ ├── FeatureDetect.h │ │ │ ├── PlatformCommon.cpp │ │ │ ├── PlatformCommon.h │ │ │ ├── PlatformEvent.cpp │ │ │ ├── PlatformEvent.h │ │ │ ├── PlatformFile.h │ │ │ ├── PlatformProcess.cpp │ │ │ ├── PlatformProcess.h │ │ │ ├── PlatformRegion.cpp │ │ │ ├── PlatformRegion.h │ │ │ ├── PlatformThread.cpp │ │ │ ├── PlatformThread.h │ │ │ ├── PrStatus.h │ │ │ └── arch │ │ │ │ ├── arm-generic │ │ │ │ ├── PlatformState.cpp │ │ │ │ ├── PlatformState.h │ │ │ │ └── PlatformThread.cpp │ │ │ │ └── x86-generic │ │ │ │ ├── PlatformState.cpp │ │ │ │ ├── PlatformState.h │ │ │ │ └── PlatformThread.cpp │ │ ├── openbsd │ │ │ ├── DebuggerCore.cpp │ │ │ ├── DebuggerCore.h │ │ │ ├── PlatformEvent.cpp │ │ │ ├── PlatformEvent.h │ │ │ ├── PlatformProcess.cpp │ │ │ ├── PlatformProcess.h │ │ │ ├── PlatformRegion.cpp │ │ │ ├── PlatformRegion.h │ │ │ ├── PlatformState.cpp │ │ │ └── PlatformState.h │ │ └── osx │ │ │ ├── DebuggerCore.cpp │ │ │ ├── DebuggerCore.h │ │ │ ├── PlatformEvent.cpp │ │ │ ├── PlatformEvent.h │ │ │ ├── PlatformProcess.cpp │ │ │ ├── PlatformProcess.h │ │ │ ├── PlatformRegion.cpp │ │ │ ├── PlatformRegion.h │ │ │ ├── PlatformState.cpp │ │ │ └── PlatformState.h │ └── win32 │ │ ├── DebuggerCore.cpp │ │ ├── DebuggerCore.h │ │ ├── PlatformEvent.cpp │ │ ├── PlatformEvent.h │ │ ├── PlatformProcess.cpp │ │ ├── PlatformProcess.h │ │ ├── PlatformRegion.cpp │ │ ├── PlatformRegion.h │ │ ├── PlatformState.cpp │ │ ├── PlatformState.h │ │ ├── PlatformThread.cpp │ │ └── PlatformThread.h ├── DebuggerErrorConsole │ ├── CMakeLists.txt │ ├── Plugin.cpp │ └── Plugin.h ├── DumpState │ ├── CMakeLists.txt │ ├── DumpState.cpp │ ├── DumpState.h │ ├── OptionsPage.cpp │ ├── OptionsPage.h │ └── OptionsPage.ui ├── FasLoader │ ├── CMakeLists.txt │ ├── Fas │ │ ├── Core.cpp │ │ ├── Core.hpp │ │ ├── Exception.cpp │ │ ├── Exception.hpp │ │ ├── Header.hpp │ │ ├── PluginSymbol.hpp │ │ ├── Symbol.hpp │ │ └── fas.txt │ ├── FasLoader.cpp │ └── FasLoader.hpp ├── FunctionFinder │ ├── CMakeLists.txt │ ├── DialogFunctions.cpp │ ├── DialogFunctions.h │ ├── DialogFunctions.ui │ ├── DialogResults.cpp │ ├── DialogResults.h │ ├── DialogResults.ui │ ├── FunctionFinder.cpp │ ├── FunctionFinder.h │ ├── ResultsModel.cpp │ └── ResultsModel.h ├── HardwareBreakpoints │ ├── CMakeLists.txt │ ├── DialogHwBreakpoints.cpp │ ├── DialogHwBreakpoints.h │ ├── DialogHwBreakpoints.ui │ ├── HardwareBreakpoints.cpp │ ├── HardwareBreakpoints.h │ ├── libHardwareBreakpoints.cpp │ └── libHardwareBreakpoints.h ├── HeapAnalyzer │ ├── CMakeLists.txt │ ├── DialogHeap.cpp │ ├── DialogHeap.h │ ├── DialogHeap.ui │ ├── HeapAnalyzer.cpp │ ├── HeapAnalyzer.h │ ├── ResultViewModel.cpp │ └── ResultViewModel.h ├── InstructionInspector │ ├── CMakeLists.txt │ ├── Plugin.cpp │ └── Plugin.h ├── ODbgRegisterView │ ├── BitFieldDescription.cpp │ ├── BitFieldDescription.h │ ├── BitFieldFormatter.cpp │ ├── BitFieldFormatter.h │ ├── CMakeLists.txt │ ├── Canvas.cpp │ ├── Canvas.h │ ├── DialogEditGPR.cpp │ ├── DialogEditGPR.h │ ├── DialogEditSimdRegister.cpp │ ├── DialogEditSimdRegister.h │ ├── EntryGridKeyUpDownEventFilter.cpp │ ├── EntryGridKeyUpDownEventFilter.h │ ├── FieldWidget.cpp │ ├── FieldWidget.h │ ├── FpuValueField.h │ ├── GprEdit.cpp │ ├── GprEdit.h │ ├── MultiBitFieldWidget.cpp │ ├── MultiBitFieldWidget.h │ ├── NumberEdit.cpp │ ├── NumberEdit.h │ ├── ODbgRV_Common.h │ ├── ODbgRV_Util.h │ ├── Plugin.cpp │ ├── Plugin.h │ ├── RegisterGroup.cpp │ ├── RegisterGroup.h │ ├── RegisterView.cpp │ ├── RegisterView.h │ ├── SimdValueManager.cpp │ ├── SimdValueManager.h │ ├── ValueField.cpp │ ├── ValueField.h │ ├── VolatileNameField.cpp │ ├── VolatileNameField.h │ └── arch │ │ ├── arm-generic │ │ ├── armGroups.cpp │ │ └── armGroups.h │ │ └── x86-generic │ │ ├── DialogEditFPU.cpp │ │ ├── DialogEditFPU.h │ │ ├── Float80Edit.cpp │ │ ├── Float80Edit.h │ │ ├── ODbgRV_x86Common.h │ │ ├── x86FPUValueField.cpp │ │ ├── x86Groups.cpp │ │ └── x86Groups.h ├── OpcodeSearcher │ ├── CMakeLists.txt │ ├── DialogOpcodes.cpp │ ├── DialogOpcodes.h │ ├── DialogOpcodes.ui │ ├── DialogResults.cpp │ ├── DialogResults.h │ ├── DialogResults.ui │ ├── OpcodeSearcher.cpp │ ├── OpcodeSearcher.h │ ├── ResultsModel.cpp │ └── ResultsModel.h ├── ProcessProperties │ ├── CMakeLists.txt │ ├── DialogProcessProperties.cpp │ ├── DialogProcessProperties.h │ ├── DialogProcessProperties.ui │ ├── DialogResults.cpp │ ├── DialogResults.h │ ├── DialogResults.ui │ ├── DialogStrings.cpp │ ├── DialogStrings.h │ ├── DialogStrings.ui │ ├── ProcessProperties.cpp │ ├── ProcessProperties.h │ ├── ResultsModel.cpp │ └── ResultsModel.h ├── ROPTool │ ├── CMakeLists.txt │ ├── DialogROPTool.cpp │ ├── DialogROPTool.h │ ├── DialogROPTool.ui │ ├── DialogResults.cpp │ ├── DialogResults.h │ ├── DialogResults.ui │ ├── ROPTool.cpp │ ├── ROPTool.h │ ├── ResultsModel.cpp │ └── ResultsModel.h ├── References │ ├── CMakeLists.txt │ ├── DialogReferences.cpp │ ├── DialogReferences.h │ ├── DialogReferences.ui │ ├── References.cpp │ └── References.h └── SymbolViewer │ ├── CMakeLists.txt │ ├── DialogSymbolViewer.cpp │ ├── DialogSymbolViewer.h │ ├── DialogSymbolViewer.ui │ ├── SymbolViewer.cpp │ └── SymbolViewer.h └── src ├── BasicBlock.cpp ├── BinaryString.cpp ├── BinaryString.ui ├── ByteShiftArray.cpp ├── CMakeLists.txt ├── CommentServer.cpp ├── CommentServer.h ├── Configuration.cpp ├── DataViewInfo.cpp ├── DataViewInfo.h ├── DebugEventHandlers.cpp ├── DebugEventHandlers.h ├── Debugger.cpp ├── Debugger.h ├── Debugger.ui ├── DebuggerInternal.h ├── DialogAbout.cpp ├── DialogAbout.h ├── DialogAbout.ui ├── DialogArguments.cpp ├── DialogArguments.h ├── DialogArguments.ui ├── DialogAttach.cpp ├── DialogAttach.h ├── DialogAttach.ui ├── DialogBreakpoints.cpp ├── DialogBreakpoints.h ├── DialogBreakpoints.ui ├── DialogInputBinaryString.cpp ├── DialogInputBinaryString.h ├── DialogInputBinaryString.ui ├── DialogInputValue.cpp ├── DialogInputValue.h ├── DialogInputValue.ui ├── DialogMemoryRegions.cpp ├── DialogMemoryRegions.h ├── DialogMemoryRegions.ui ├── DialogOpenProgram.cpp ├── DialogOpenProgram.h ├── DialogOptions.cpp ├── DialogOptions.h ├── DialogOptions.ui ├── DialogPlugins.cpp ├── DialogPlugins.h ├── DialogPlugins.ui ├── DialogThreads.cpp ├── DialogThreads.h ├── DialogThreads.ui ├── ExpressionDialog.cpp ├── ExpressionDialog.h ├── FixedFontSelector.cpp ├── FixedFontSelector.h ├── FixedFontSelector.ui ├── FloatX.cpp ├── Font.cpp ├── Function.cpp ├── HexStringValidator.cpp ├── LongDoubleX86.asm ├── MemoryRegions.cpp ├── PluginModel.cpp ├── PluginModel.h ├── ProcessModel.cpp ├── ProcessModel.h ├── QLongValidator.cpp ├── QULongValidator.cpp ├── RecentFileManager.cpp ├── RecentFileManager.h ├── RegionBuffer.cpp ├── RegionBuffer.h ├── Register.cpp ├── RegisterViewModelBase.cpp ├── State.cpp ├── SymbolManager.cpp ├── SymbolManager.h ├── Theme.cpp ├── ThreadsModel.cpp ├── arch ├── arm-generic │ ├── ArchProcessor.cpp │ ├── RegisterViewModel.cpp │ └── RegisterViewModel.h └── x86-generic │ ├── ArchProcessor.cpp │ ├── RegisterViewModel.cpp │ ├── RegisterViewModel.h │ └── errno-names-linux.h ├── capstone-edb ├── Inspection.cpp ├── Instruction.cpp └── include │ ├── Formatter.h │ ├── Inspection.h │ ├── Instruction.h │ └── Operand.h ├── edb.cpp ├── graph ├── GraphEdge.cpp ├── GraphNode.cpp ├── GraphWidget.cpp ├── GraphicsScene.cpp ├── GraphicsScene.h ├── GraphvizHelper.cpp └── GraphvizHelper.h ├── main.cpp ├── res ├── breeze-dark-edb.qrc ├── breeze-edb.qrc ├── debugger.qrc ├── edb.rc ├── icons │ ├── breeze-dark-edb │ │ ├── 16x16 │ │ │ ├── application-exit.svg │ │ │ ├── code-context.svg │ │ │ ├── configure.svg │ │ │ ├── dialog-close.svg │ │ │ ├── dialog-information.svg │ │ │ ├── document-export.svg │ │ │ ├── document-import.svg │ │ │ ├── document-open-recent.svg │ │ │ ├── document-open.svg │ │ │ ├── edit-clear-list.svg │ │ │ ├── edit-find.svg │ │ │ ├── edit-undo.svg │ │ │ ├── help-about.svg │ │ │ ├── help-contents.svg │ │ │ ├── list-add.svg │ │ │ ├── list-remove.svg │ │ │ ├── tab-close.png │ │ │ ├── tab-new.png │ │ │ ├── view-refresh.svg │ │ │ └── view-restore.svg │ │ ├── 24x24 │ │ │ ├── dialog-information.svg │ │ │ └── distribute-graph.svg │ │ ├── 64x64 │ │ │ ├── debug-close.png │ │ │ ├── debug-kill.png │ │ │ ├── debug-pause.png │ │ │ ├── debug-restart.png │ │ │ ├── debug-run.png │ │ │ ├── debug-step-into.png │ │ │ ├── debug-step-out.png │ │ │ ├── debug-step-over.png │ │ │ ├── dialog-information.svg │ │ │ ├── memory-slot.png │ │ │ └── plugin.png │ │ └── index.theme │ ├── breeze-edb │ │ ├── 16x16 │ │ │ ├── application-exit.svg │ │ │ ├── code-context.svg │ │ │ ├── configure.svg │ │ │ ├── dialog-close.svg │ │ │ ├── dialog-information.svg │ │ │ ├── document-export.svg │ │ │ ├── document-import.svg │ │ │ ├── document-open-recent.svg │ │ │ ├── document-open.svg │ │ │ ├── edit-clear-list.svg │ │ │ ├── edit-find.svg │ │ │ ├── edit-undo.svg │ │ │ ├── help-about.svg │ │ │ ├── help-contents.svg │ │ │ ├── list-add.svg │ │ │ ├── list-remove.svg │ │ │ ├── tab-close.png │ │ │ ├── tab-new.png │ │ │ ├── view-refresh.svg │ │ │ └── view-restore.svg │ │ ├── 24x24 │ │ │ ├── dialog-information.svg │ │ │ └── distribute-graph.svg │ │ ├── 64x64 │ │ │ ├── debug-close.png │ │ │ ├── debug-kill.png │ │ │ ├── debug-pause.png │ │ │ ├── debug-restart.png │ │ │ ├── debug-run.png │ │ │ ├── debug-step-into.png │ │ │ ├── debug-step-out.png │ │ │ ├── debug-step-over.png │ │ │ ├── dialog-information.svg │ │ │ ├── memory-slot.png │ │ │ └── plugin.png │ │ └── index.theme │ └── edb │ │ └── index.theme ├── images │ ├── arrow-right-red.svg │ ├── arrow-right.svg │ ├── breakpoint.svg │ ├── edb.ico │ ├── edb.png │ ├── edb.svg │ ├── edb100-logo.png │ └── edb48-logo.png ├── themes.qrc ├── themes │ ├── dark.ini │ ├── light.ini │ ├── system-dark.ini │ └── system-light.ini ├── translations │ ├── .gitkeep │ └── edb_zh_CN.ts └── xml │ ├── functions.xml │ └── syscalls.xml ├── session ├── SessionError.cpp ├── SessionError.h ├── SessionManager.cpp └── SessionManager.h ├── test ├── CMakeLists.txt └── Test.cpp └── widgets ├── NavigationHistory.cpp ├── NavigationHistory.h ├── QDisassemblyView.cpp ├── QDisassemblyView.h ├── RegisterViewDelegate.cpp ├── RegisterViewDelegate.h ├── SyntaxHighlighter.cpp ├── SyntaxHighlighter.h ├── TabWidget.cpp └── TabWidget.h /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | 12 | # Matches multiple files with brace expansion notation 13 | # Set default charset 14 | [*.{c,h,cpp,hpp,tcc}] 15 | charset = utf-8 16 | indent_style = tab 17 | indent_size = 4 18 | trim_trailing_whitespace = true 19 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: eteran 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | CMakeLists.txt.user* 2 | build 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/qhexview"] 2 | path = src/qhexview 3 | url = https://github.com/eteran/qhexview.git 4 | [submodule "lib/gdtoa-desktop"] 5 | path = lib/gdtoa-desktop 6 | url = https://github.com/10110111/gdtoa-desktop.git 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | dist: bionic 4 | 5 | cache: apt 6 | 7 | compiler: 8 | - gcc 9 | 10 | env: 11 | global: 12 | - MAKEFLAGS="-j2" 13 | 14 | before_script: 15 | - mkdir build && cd build && cmake .. 16 | 17 | script: 18 | - make 19 | 20 | os: 21 | - linux 22 | 23 | addons: 24 | apt: 25 | packages: 26 | - build-essential 27 | - cmake 28 | - libcapstone-dev 29 | - libgraphviz-dev 30 | - libqt5svg5-dev 31 | - libqt5xmlpatterns5-dev 32 | - pkg-config 33 | - qt5-default 34 | - qtbase5-dev 35 | -------------------------------------------------------------------------------- /BUGS: -------------------------------------------------------------------------------- 1 | This file has been superseded by the issue tracker at: https://github.com/eteran/edb-debugger/issues 2 | -------------------------------------------------------------------------------- /TODO: -------------------------------------------------------------------------------- 1 | This file has been superseded by the issue tracker at: https://github.com/eteran/edb-debugger/issues 2 | -------------------------------------------------------------------------------- /cmake/Modules/AddWarnings.cmake: -------------------------------------------------------------------------------- 1 | 2 | include("DetectCompiler") 3 | 4 | function(TARGET_ADD_WARNINGS TARGET) 5 | if((TARGET_COMPILER_GCC) OR (TARGET_COMPILER_CLANG)) 6 | target_compile_options(${TARGET} 7 | PUBLIC 8 | -W 9 | -Wall 10 | #-Wshadow 11 | -Wnon-virtual-dtor 12 | #-Wold-style-cast 13 | -Wcast-align 14 | -Wunused 15 | -Woverloaded-virtual 16 | -pedantic 17 | #-Wconversion 18 | #-Wsign-conversion 19 | #-Wnull-dereference 20 | -Wdouble-promotion 21 | -Wformat=2 22 | -Wno-unused-macros 23 | -Wno-switch-enum 24 | -Wno-unknown-pragmas 25 | -Wimplicit-fallthrough 26 | ) 27 | 28 | if(TARGET_COMPILER_CLANG) 29 | target_compile_options(${TARGET} 30 | PUBLIC 31 | #-Wexit-time-destructors 32 | #-Wglobal-constructors 33 | #-Wshadow-uncaptured-local 34 | #-Wshorten-64-to-32 35 | -Wconditional-uninitialized 36 | -Wmissing-prototypes 37 | ) 38 | 39 | elseif(TARGET_COMPILER_GCC) 40 | target_compile_options(${TARGET} 41 | PUBLIC 42 | #-Wduplicated-branches 43 | #-Wduplicated-cond 44 | #-Wsuggest-attribute=const 45 | #-Wsuggest-attribute=noreturn 46 | #-Wsuggest-attribute=pure 47 | #-Wsuggest-final-methods 48 | #-Wsuggest-final-types 49 | #-Wuseless-cast 50 | -Wlogical-op 51 | -Wsuggest-override 52 | ) 53 | endif() 54 | endif() 55 | endfunction() 56 | -------------------------------------------------------------------------------- /cmake/Modules/DetectArchitecture.cmake: -------------------------------------------------------------------------------- 1 | 2 | if((CMAKE_SYSTEM_PROCESSOR MATCHES "i[3456]86") OR (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") OR (CMAKE_SYSTEM_PROCESSOR MATCHES "[aA][mM][dD]64")) 3 | set(TARGET_ARCH_FAMILY_X86 1) 4 | if (CMAKE_SIZEOF_VOID_P EQUAL 8) 5 | set(TARGET_ARCH_X64 1) 6 | set(TARGET_ARCH_NAME "x86-64") 7 | elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) 8 | set(TARGET_ARCH_X86 1) 9 | set(TARGET_ARCH_NAME "x86") 10 | endif() 11 | elseif((CMAKE_SYSTEM_PROCESSOR MATCHES "armv[0-9]+") OR (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")) 12 | set(TARGET_ARCH_FAMILY_ARM 1) 13 | if (CMAKE_SIZEOF_VOID_P EQUAL 8) 14 | set(TARGET_ARCH_ARM64 1) 15 | set(TARGET_ARCH_NAME "arm64") 16 | elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) 17 | set(TARGET_ARCH_ARM32 1) 18 | set(TARGET_ARCH_NAME "arm32") 19 | endif() 20 | else() 21 | message(FATAL_ERROR "Unsupported Architecture: ${CMAKE_SYSTEM_PROCESSOR}") 22 | endif() 23 | -------------------------------------------------------------------------------- /cmake/Modules/DetectCompiler.cmake: -------------------------------------------------------------------------------- 1 | 2 | if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") 3 | set(TARGET_COMPILER_MSVC 1) 4 | elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") 5 | set(TARGET_COMPILER_CLANG 1) 6 | elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU") 7 | set(TARGET_COMPILER_GCC 1) 8 | else() 9 | message(FATAL_ERROR "Unsupported Compiler: ${CMAKE_CXX_COMPILER_ID}") 10 | endif() 11 | -------------------------------------------------------------------------------- /cmake/Modules/DetectGitBranch.cmake: -------------------------------------------------------------------------------- 1 | 2 | function(git_get_branch RESULT) 3 | find_package(Git) 4 | if(Git_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git") 5 | execute_process( 6 | COMMAND git rev-parse HEAD 7 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 8 | OUTPUT_VARIABLE OUTPUT 9 | OUTPUT_STRIP_TRAILING_WHITESPACE 10 | ) 11 | set(${RESULT} ${OUTPUT} PARENT_SCOPE) 12 | else() 13 | set(${RESULT} "Unknown" PARENT_SCOPE) 14 | endif() 15 | endfunction() 16 | -------------------------------------------------------------------------------- /cmake/Modules/DetectOS.cmake: -------------------------------------------------------------------------------- 1 | 2 | if (CMAKE_SYSTEM_NAME MATCHES "Windows") 3 | set(TARGET_PLATFORM_WINDOWS 1) 4 | elseif (CMAKE_SYSTEM_NAME MATCHES "Linux") 5 | set(TARGET_PLATFORM_LINUX 1) 6 | elseif (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") 7 | set(TARGET_PLATFORM_FREEBSD 1) 8 | elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") 9 | set(TARGET_PLATFORM_MACOS 1) 10 | else() 11 | message(FATAL_ERROR "Unsupported OS: ${CMAKE_SYSTEM_NAME}") 12 | endif () 13 | -------------------------------------------------------------------------------- /cmake/Modules/EnableSTLDebug.cmake: -------------------------------------------------------------------------------- 1 | 2 | include("DetectCompiler") 3 | 4 | if((TARGET_COMPILER_GCC) OR (TARGET_COMPILER_CLANG)) 5 | 6 | option(ENABLE_STL_DEBUG "Enable STL container debugging") 7 | 8 | if(ENABLE_STL_DEBUG) 9 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_DEBUG") 10 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GLIBCXX_DEBUG") 11 | endif() 12 | endif() 13 | -------------------------------------------------------------------------------- /cmake/Modules/EnableSanitizers.cmake: -------------------------------------------------------------------------------- 1 | 2 | include("DetectCompiler") 3 | 4 | function(JOIN VALUES GLUE OUTPUT) 5 | string (REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}") 6 | set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE) 7 | endfunction() 8 | 9 | if((TARGET_COMPILER_GCC) OR (TARGET_COMPILER_CLANG)) 10 | option(ENABLE_ASAN "Enable address sanitizer") 11 | option(ENABLE_MSAN "Enable memory sanitizer") 12 | option(ENABLE_USAN "Enable undefined sanitizer") 13 | option(ENABLE_TSAN "Enable thread sanitizer") 14 | 15 | set(SANITIZERS "") 16 | 17 | if(ENABLE_ASAN) 18 | list(APPEND SANITIZERS "address") 19 | endif() 20 | 21 | if(ENABLE_MSAN) 22 | list(APPEND SANITIZERS "memory") 23 | endif() 24 | 25 | if(ENABLE_USAN) 26 | list(APPEND SANITIZERS "undefined") 27 | endif() 28 | 29 | if(ENABLE_TSAN) 30 | list(APPEND SANITIZERS "thread") 31 | endif() 32 | 33 | JOIN("${SANITIZERS}" "," LIST_OF_SANITIZERS) 34 | endif() 35 | 36 | if(LIST_OF_SANITIZERS) 37 | if(NOT "${LIST_OF_SANITIZERS}" STREQUAL "") 38 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${LIST_OF_SANITIZERS}") 39 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=${LIST_OF_SANITIZERS}") 40 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${LIST_OF_SANITIZERS}") 41 | endif() 42 | endif() 43 | 44 | -------------------------------------------------------------------------------- /cmake/Modules/FindCapstone.cmake: -------------------------------------------------------------------------------- 1 | if (UNIX) 2 | find_package(PkgConfig REQUIRED) 3 | pkg_check_modules(CAPSTONE REQUIRED capstone>=3.0.4) 4 | elseif (WIN32) 5 | # CAPSTONE_SDK should be the path to a directory containing a subdirectory "include/capstone" 6 | # with all the include headers of capstone and another subdirectory "lib" with "capstone_dll.lib" or "libcapstone.dll". 7 | if (NOT DEFINED CAPSTONE_SDK) 8 | set(CAPSTONE_SDK NOTFOUND CACHE PATH "Path to the Capstone SDK") 9 | message(SEND_ERROR "Path to Capstone SDK is missing. Please specify CAPSTONE_SDK.") 10 | endif() 11 | 12 | find_path(CAPSTONE_INCLUDE_DIRS 13 | capstone/capstone.h 14 | PATHS ${CAPSTONE_SDK}/include 15 | ) 16 | 17 | if (NOT CAPSTONE_INCLUDE_DIRS) 18 | message(SEND_ERROR "Include directory for Capstone not found. Please specify CAPSTONE_SDK.") 19 | endif() 20 | 21 | find_library(CAPSTONE_LIBRARIES 22 | NAMES capstone_dll libcapstone 23 | HINTS "${CAPSTONE_SDK}/lib" 24 | ) 25 | 26 | if (NOT CAPSTONE_LIBRARIES) 27 | message(SEND_ERROR "Library directory for Capstone not found. Please specify CAPSTONE_SDK.") 28 | endif() 29 | endif() 30 | -------------------------------------------------------------------------------- /cmake/Modules/ProjectDefaults.cmake: -------------------------------------------------------------------------------- 1 | 2 | include("DetectCompiler") 3 | 4 | if(NOT CMAKE_BUILD_TYPE) 5 | set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build." FORCE) 6 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "RelWithDebInfo" "MinSizeRel") 7 | endif() 8 | 9 | # Generate compile_commands.json to make it easier to work with clang based tools 10 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 11 | 12 | if(TARGET_COMPILER_MSVC) 13 | add_definitions(-DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS) 14 | endif() 15 | -------------------------------------------------------------------------------- /cspell.config.yaml: -------------------------------------------------------------------------------- 1 | version: "0.2" 2 | ignorePaths: [] 3 | dictionaryDefinitions: [] 4 | dictionaries: [] 5 | words: 6 | - Antialiasing 7 | - CLASSINFO 8 | - darkprof 9 | - debuggee 10 | - demangled 11 | - DEMANGLING 12 | - disassemblers 13 | - Doubleword 14 | - doublewords 15 | - DWORD 16 | - DWORDS 17 | - ELFCLASS 18 | - ELFDATA 19 | - ELFOSABI 20 | - eteran 21 | - Fabien 22 | - hexview 23 | - Kabatsayev 24 | - konsole 25 | - Mercês 26 | - METATYPE 27 | - Midlight 28 | - Mohd 29 | - nasm 30 | - Nicoleau 31 | - nofork 32 | - Noto 33 | - Olly 34 | - Ollydbg 35 | - Opfer 36 | - Pixmap 37 | - Polyline 38 | - qcommonstyle 39 | - qgetenv 40 | - qlonglong 41 | - qobject 42 | - qreal 43 | - qsnprintf 44 | - Quadword 45 | - quadwords 46 | - qulonglong 47 | - QWORD 48 | - QWORDS 49 | - Ruslan 50 | - Scrollbars 51 | - Shahril 52 | - Sorokin 53 | - stepover 54 | - tbyte 55 | - Teran 56 | - TSTP 57 | - xmmword 58 | - yasm 59 | - ymmword 60 | - zmmword 61 | ignoreWords: [] 62 | import: [] 63 | -------------------------------------------------------------------------------- /edb.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=edb 3 | GenericName="Evan's Debugger" 4 | Comment="edb is a cross platform x86/x86-64 debugger" 5 | Exec=edb 6 | Icon=edb 7 | Terminal=false 8 | Type=Application 9 | Categories=Development;Qt;Debugger; 10 | -------------------------------------------------------------------------------- /include/API.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef API_H_20090529_ 20 | #define API_H_20090529_ 21 | 22 | #include 23 | 24 | #ifdef QT_PLUGIN 25 | #define EDB_EXPORT Q_DECL_IMPORT 26 | #else 27 | #define EDB_EXPORT Q_DECL_EXPORT 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/HexStringValidator.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2013 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef HEX_STRING_VALIDATOR_H_20130625_ 20 | #define HEX_STRING_VALIDATOR_H_20130625_ 21 | 22 | #include 23 | 24 | class QString; 25 | class QObject; 26 | 27 | class HexStringValidator final : public QValidator { 28 | Q_OBJECT 29 | public: 30 | HexStringValidator(QObject *parent); 31 | 32 | public: 33 | void fixup(QString &input) const override; 34 | State validate(QString &input, int &pos) const override; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/IDebugEventHandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef IDEBUG_EVENT_HANDLER_H_20061101_ 20 | #define IDEBUG_EVENT_HANDLER_H_20061101_ 21 | 22 | #include "Types.h" 23 | #include 24 | 25 | class IDebugEvent; 26 | 27 | class IDebugEventHandler { 28 | public: 29 | virtual ~IDebugEventHandler() = default; 30 | 31 | public: 32 | virtual edb::EventStatus handleEvent(const std::shared_ptr &event) = 0; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /include/ISymbolGenerator.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef ISYMBOL_GENERATOR_H_20130808_ 20 | #define ISYMBOL_GENERATOR_H_20130808_ 21 | 22 | class QString; 23 | 24 | class ISymbolGenerator { 25 | public: 26 | virtual ~ISymbolGenerator() = default; 27 | 28 | public: 29 | virtual bool generateSymbolFile(const QString &filename, const QString &symbol_file) = 0; 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /include/Instruction.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include "../src/capstone-edb/include/Instruction.h" 20 | -------------------------------------------------------------------------------- /include/Module.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef MODULE_H_20191119_ 20 | #define MODULE_H_20191119_ 21 | 22 | #include "Types.h" 23 | #include 24 | 25 | struct Module { 26 | QString name; 27 | edb::address_t baseAddress; 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/Patch.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2017 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef PATCH_H_20191119_ 20 | #define PATCH_H_20191119_ 21 | 22 | #include "Types.h" 23 | #include 24 | 25 | struct Patch { 26 | edb::address_t address; 27 | QByteArray origBytes; 28 | QByteArray newBytes; 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /include/Prototype.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef PROTOTYPE_H_20070320_ 20 | #define PROTOTYPE_H_20070320_ 21 | 22 | #include 23 | #include 24 | 25 | namespace edb { 26 | 27 | struct Argument { 28 | QString name; 29 | QString type; 30 | }; 31 | 32 | struct Prototype { 33 | QString name; 34 | QString type; 35 | bool noreturn; 36 | std::vector arguments; 37 | }; 38 | 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /include/QtHelper.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef QT_HELPER_H_20191119_ 3 | #define QT_HELPER_H_20191119_ 4 | 5 | #include 6 | 7 | #define Q_DECLARE_NAMESPACE_TR(context) \ 8 | inline QString tr(const char *sourceText, const char *disambiguation = Q_NULLPTR, int n = -1) { \ 9 | return QCoreApplication::translate(#context, sourceText, disambiguation, n); \ 10 | } 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /include/RegisterRef.h: -------------------------------------------------------------------------------- 1 | 2 | // inspired from code from mozilla: https://github.com/mozilla/rr/blob/master/src/Registers.cc 3 | 4 | #ifndef REGISTER_REF_H_20191119_ 5 | #define REGISTER_REF_H_20191119_ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | class RegisterRef { 14 | public: 15 | constexpr RegisterRef(const char *name, const void *ptr, std::size_t size) 16 | : name_(name), ptr_(ptr), size_(size) { 17 | } 18 | 19 | constexpr RegisterRef() = default; 20 | RegisterRef(const RegisterRef &) = default; 21 | RegisterRef &operator=(const RegisterRef &) = default; 22 | 23 | public: 24 | [[nodiscard]] const void *data() const { return ptr_; } 25 | 26 | public: 27 | [[nodiscard]] bool operator==(const RegisterRef &rhs) const { return size_ == rhs.size_ && std::memcmp(ptr_, rhs.ptr_, size_) == 0; } 28 | [[nodiscard]] bool operator!=(const RegisterRef &rhs) const { return size_ != rhs.size_ || std::memcmp(ptr_, rhs.ptr_, size_) != 0; } 29 | 30 | public: 31 | [[nodiscard]] bool valid() const { return ptr_ != nullptr; } 32 | 33 | public: 34 | // The name of this register. 35 | const char *name_ = nullptr; 36 | 37 | // The ptr to register in state structure. 38 | const void *ptr_ = nullptr; 39 | 40 | // The size of the register. 0 means we cannot read it. 41 | std::size_t size_ = 0; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /include/Symbol.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef SYMBOL_H_20110401_ 20 | #define SYMBOL_H_20110401_ 21 | 22 | #include "API.h" 23 | #include "Types.h" 24 | #include 25 | #include 26 | 27 | class Symbol { 28 | public: 29 | QString file; 30 | QString name; 31 | QString name_no_prefix; 32 | edb::address_t address; 33 | uint32_t size; 34 | char type; 35 | 36 | [[nodiscard]] bool isCode() const { return type == 't' || type == 'T' || type == 'P'; } 37 | [[nodiscard]] bool isData() const { return !isCode(); } 38 | [[nodiscard]] bool isWeak() const { return type == 'W'; } 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /include/Types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef TYPES_H_20071127_ 20 | #define TYPES_H_20071127_ 21 | 22 | #include "Value.h" 23 | #include 24 | 25 | namespace edb { 26 | 27 | enum EventStatus { 28 | DEBUG_STOP, // do nothing, the UI will instigate the next event 29 | DEBUG_CONTINUE, // the event has been addressed, continue as normal 30 | DEBUG_CONTINUE_STEP, // the event has been addressed, step as normal 31 | DEBUG_CONTINUE_BP, // the event was a BP, which we need to ignore 32 | DEBUG_EXCEPTION_NOT_HANDLED, // pass the event unmodified back thread and continue 33 | DEBUG_NEXT_HANDLER 34 | }; 35 | 36 | } 37 | 38 | /* Comment Type */ 39 | struct Comment { 40 | edb::address_t address; 41 | QString comment; 42 | }; 43 | 44 | #include "ArchTypes.h" 45 | #endif 46 | -------------------------------------------------------------------------------- /include/arch/arm-generic/ArchTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef ARCH_TYPES_H_20071127_ 20 | #define ARCH_TYPES_H_20071127_ 21 | 22 | #include "Instruction.h" 23 | #include "Types.h" 24 | 25 | namespace edb { 26 | 27 | using Instruction = CapstoneEDB::Instruction; 28 | using Operand = CapstoneEDB::Operand; 29 | 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /include/arch/x86-generic/ArchTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef ARCH_TYPES_H_20071127_ 20 | #define ARCH_TYPES_H_20071127_ 21 | 22 | #include "Instruction.h" 23 | #include "Types.h" 24 | 25 | namespace edb { 26 | 27 | using seg_reg_t = value16; 28 | using Instruction = CapstoneEDB::Instruction; 29 | using Operand = CapstoneEDB::Operand; 30 | 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /include/os/unix/OSTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef OSTYPES_H_20060625_ 20 | #define OSTYPES_H_20060625_ 21 | 22 | #include // for pid_t/uid_t 23 | 24 | namespace edb { 25 | using ::pid_t; 26 | using ::uid_t; 27 | using tid_t = ::pid_t; 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/os/unix/linux/linker.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef LINKER_H_20170103_ 20 | #define LINKER_H_20170103_ 21 | 22 | namespace edb::linux_struct { 23 | 24 | // Bitness-templated version of struct r_debug defined in link.h 25 | template 26 | struct r_debug { 27 | int r_version; 28 | Addr r_map; // struct link_map* 29 | Addr r_brk; 30 | enum { 31 | RT_CONSISTENT, 32 | RT_ADD, 33 | RT_DELETE 34 | } r_state; 35 | Addr r_ldbase; 36 | }; 37 | 38 | // Bitness-templated version of struct link_map defined in link.h 39 | template 40 | struct link_map { 41 | Addr l_addr; 42 | Addr l_name; // char* 43 | Addr l_ld; // ElfW(Dyn)* 44 | Addr l_next, l_prev; // struct link_map* 45 | }; 46 | 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /include/os/win32/OSTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef OSTYPES_H_20070116_ 20 | #define OSTYPES_H_20070116_ 21 | 22 | #ifndef NOMINMAX 23 | #define NOMINMAX 24 | #endif 25 | 26 | #include 27 | 28 | namespace edb { 29 | using pid_t = DWORD; 30 | using uid_t = DWORD; // TODO(eteran): I think this needs to be an SID to make any sense 31 | using tid_t = DWORD; 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /include/string_hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef STRING_HASH_H_20110823_ 20 | #define STRING_HASH_H_20110823_ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | namespace edb { 27 | namespace detail { 28 | 29 | template 30 | constexpr uint64_t string_hash(const char (&array)[N]) { 31 | if constexpr (Index == 0) { 32 | return 0; 33 | } else { 34 | return string_hash(array) | ((array[Index - 1] & 0xffull) << (8 * (Index - 1))); 35 | } 36 | } 37 | 38 | } 39 | 40 | template > 41 | constexpr uint64_t string_hash(const char (&array)[N]) { 42 | return detail::string_hash(array); 43 | } 44 | 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /include/util/Error.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef UTIL_ERROR_H_2020227_ 3 | #define UTIL_ERROR_H_2020227_ 4 | 5 | #include 6 | #include 7 | 8 | namespace util { 9 | 10 | template 11 | void print(Stream &str) { 12 | str << "\n"; 13 | } 14 | 15 | template 16 | void print(Stream &str, Arg0 &&arg0, Args &&...args) { 17 | str << std::forward(arg0); 18 | print(str, std::forward(args)...); 19 | } 20 | 21 | } 22 | 23 | #define EDB_PRINT_AND_DIE(...) \ 24 | do { \ 25 | util::print(std::cerr, __FILE__, ":", __LINE__, ": ", Q_FUNC_INFO, ": Fatal error: ", __VA_ARGS__); \ 26 | std::abort(); \ 27 | } while (0) 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /include/util/Float.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef UTIL_FLOAT_H_2020227_ 3 | #define UTIL_FLOAT_H_2020227_ 4 | 5 | #include "FloatX.h" 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | namespace util { 12 | 13 | template 14 | std::optional full_string_to_float(const std::string &s) { 15 | 16 | static_assert( 17 | std::is_same_v || 18 | std::is_same_v || 19 | std::is_same_v, 20 | "Floating-point type not supported by this function"); 21 | 22 | // NOTE: Don't use std::istringstream: it doesn't support hexfloat. 23 | // Don't use std::sto{f,d,ld} either: they throw std::out_of_range on denormals. 24 | // Only std::strto{f,d,ld} are sane, for some definitions of sane... 25 | const char *const str = s.c_str(); 26 | char *end; 27 | Float value; 28 | errno = 0; 29 | 30 | if constexpr (std::is_same_v) { 31 | value = std::strtof(str, &end); 32 | } else if constexpr (std::is_same_v) { 33 | value = std::strtod(str, &end); 34 | } else if constexpr (std::is_same_v) { 35 | value = std::strtold(str, &end); 36 | } 37 | 38 | if (errno) { 39 | if ((errno == ERANGE && (value == 0 || std::isinf(value))) || errno != ERANGE) { 40 | return {}; 41 | } 42 | } 43 | 44 | if (end == str + s.size()) { 45 | return value; 46 | } 47 | 48 | return {}; 49 | } 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /include/util/Font.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FONT_H_ 3 | #define FONT_H_ 4 | 5 | #include "API.h" 6 | 7 | class QString; 8 | class QFont; 9 | class QFontMetrics; 10 | class QChar; 11 | 12 | namespace Font { 13 | 14 | enum Type { 15 | Plain = 0, 16 | Italic = 1, 17 | Bold = 2, 18 | }; 19 | 20 | EDB_EXPORT QFont fromString(const QString &fontName); 21 | EDB_EXPORT int maxWidth(const QFontMetrics &fm); 22 | EDB_EXPORT int characterWidth(const QFontMetrics &fm, QChar ch); 23 | EDB_EXPORT int stringWidth(const QFontMetrics &fm, const QString &s); 24 | 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /include/util/Integer.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef UTIL_INTEGER_H_2020227_ 3 | #define UTIL_INTEGER_H_2020227_ 4 | 5 | #include "Value.h" 6 | #include "util/Error.h" 7 | #include 8 | 9 | enum class NumberDisplayMode { 10 | Hex, 11 | Signed, 12 | Unsigned, 13 | Float 14 | }; 15 | 16 | namespace util { 17 | 18 | template 19 | constexpr std::make_unsigned_t to_unsigned(T x) { 20 | return x; 21 | } 22 | 23 | template 24 | QString format_int(T value, NumberDisplayMode mode) { 25 | switch (mode) { 26 | case NumberDisplayMode::Hex: 27 | return value.toHexString(); 28 | case NumberDisplayMode::Signed: 29 | return value.signedToString(); 30 | case NumberDisplayMode::Unsigned: 31 | return value.unsignedToString(); 32 | default: 33 | EDB_PRINT_AND_DIE("Unexpected integer display mode ", static_cast(mode)); 34 | } 35 | } 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /include/util/Math.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef UTIL_MATH_H_2020227_ 3 | #define UTIL_MATH_H_2020227_ 4 | 5 | namespace util { 6 | 7 | //------------------------------------------------------------------------------ 8 | // Name: percentage 9 | // Desc: calculates how much of a multi-region byte search we have completed 10 | //------------------------------------------------------------------------------ 11 | template 12 | int percentage(N1 regions_finished, N2 regions_total, N3 bytes_done, N4 bytes_total) { 13 | 14 | // how much percent does each region account for? 15 | const auto region_step = 1.0f / static_cast(regions_total) * 100.0f; 16 | 17 | // how many regions are done? 18 | const float regions_complete = region_step * regions_finished; 19 | 20 | // how much of the current region is done? 21 | const float region_percent = region_step * static_cast(bytes_done) / static_cast(bytes_total); 22 | 23 | return static_cast(regions_complete + region_percent); 24 | } 25 | 26 | //------------------------------------------------------------------------------ 27 | // Name: percentage 28 | // Desc: calculates how much of a single-region byte search we have completed 29 | //------------------------------------------------------------------------------ 30 | template 31 | int percentage(N1 bytes_done, N2 bytes_total) { 32 | return percentage(0, 1, bytes_done, bytes_total); 33 | } 34 | 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/util/String.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef UTIL_STRING_H_2020227_ 3 | #define UTIL_STRING_H_2020227_ 4 | 5 | #include 6 | 7 | namespace util { 8 | 9 | /** 10 | * @brief is_numeric 11 | * @param s 12 | * @return true if the string only contains decimal digits 13 | */ 14 | inline bool is_numeric(const QString &s) { 15 | for (QChar ch : s) { 16 | if (!ch.isDigit()) { 17 | return false; 18 | } 19 | } 20 | 21 | return true; 22 | } 23 | 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /include/version.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef VERSION_H_20061109_ 20 | #define VERSION_H_20061109_ 21 | 22 | #define EDB_VERSION_STRING "@PROJECT_VERSION@" 23 | 24 | #cmakedefine GIT_BRANCH "@GIT_BRANCH@" 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /lib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.1) 2 | add_subdirectory(libELF) 3 | add_subdirectory(libPE) 4 | 5 | if(UNIX) 6 | if(TARGET_ARCH_FAMILY_X86 AND NOT GDTOA_FOUND) 7 | add_subdirectory(gdtoa-desktop) 8 | endif() 9 | endif() 10 | 11 | 12 | -------------------------------------------------------------------------------- /lib/libELF/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.1) 2 | 3 | add_library(ELF INTERFACE 4 | ) 5 | 6 | target_include_directories(ELF 7 | INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include 8 | ) 9 | 10 | target_sources(ELF INTERFACE 11 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_model.h 12 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_auxv.h 13 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_binary.h 14 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_dyn.h 15 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_header.h 16 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_move.h 17 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_nhdr.h 18 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_phdr.h 19 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_rela.h 20 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_rel.h 21 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_shdr.h 22 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_sym.h 23 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_syminfo.h 24 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_types.h 25 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_verdaux.h 26 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_verdef.h 27 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_vernaux.h 28 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libELF/elf_verneed.h 29 | ) 30 | 31 | -------------------------------------------------------------------------------- /lib/libELF/include/libELF/elf_verdaux.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | Copyright (C) 1995-2003,2004,2005,2006,2007,2008,2009,2010,2011 6 | Free Software Foundation, Inc. 7 | 8 | This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 2 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see . 20 | */ 21 | 22 | #ifndef ELF_VERDAUX_H_20121007_ 23 | #define ELF_VERDAUX_H_20121007_ 24 | 25 | #include "elf_types.h" 26 | 27 | /* Auxialiary version information. */ 28 | struct elf32_verdaux { 29 | elf32_word vda_name; /* Version or dependency names */ 30 | elf32_word vda_next; /* Offset in bytes to next verdaux entry */ 31 | }; 32 | 33 | struct elf64_verdaux { 34 | elf64_word vda_name; /* Version or dependency names */ 35 | elf64_word vda_next; /* Offset in bytes to next verdaux entry */ 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /lib/libPE/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.1) 2 | 3 | add_library(PE INTERFACE 4 | ) 5 | 6 | target_include_directories(PE 7 | INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include 8 | ) 9 | 10 | target_sources(PE INTERFACE 11 | ${CMAKE_CURRENT_SOURCE_DIR}/include/libPE/pe_binary.h 12 | 13 | ) 14 | 15 | -------------------------------------------------------------------------------- /plugins/Analyzer/AnalyzerWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2013 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef ANALYZER_WIDGET_H_20190412_ 20 | #define ANALYZER_WIDGET_H_20190412_ 21 | 22 | #include 23 | #include 24 | 25 | class QPixmap; 26 | 27 | namespace AnalyzerPlugin { 28 | 29 | class AnalyzerWidget final : public QWidget { 30 | Q_OBJECT 31 | public: 32 | AnalyzerWidget(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 33 | 34 | protected: 35 | void paintEvent(QPaintEvent *event) override; 36 | void mousePressEvent(QMouseEvent *event) override; 37 | void mouseReleaseEvent(QMouseEvent *event) override; 38 | void mouseMoveEvent(QMouseEvent *event) override; 39 | 40 | private: 41 | std::unique_ptr cache_; 42 | bool mousePressed_ = false; 43 | int cacheNumFuncs_ = 0; 44 | }; 45 | 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /plugins/Analyzer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "Analyzer") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | Analyzer.cpp 14 | Analyzer.h 15 | AnalyzerWidget.cpp 16 | AnalyzerWidget.h 17 | DialogXRefs.cpp 18 | DialogXRefs.h 19 | DialogXRefs.ui 20 | OptionsPage.cpp 21 | OptionsPage.h 22 | OptionsPage.ui 23 | SpecifiedFunctions.cpp 24 | SpecifiedFunctions.h 25 | SpecifiedFunctions.ui 26 | ) 27 | 28 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 29 | 30 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 31 | 32 | target_add_warnings(${PLUGIN_NAME}) 33 | 34 | set_target_properties(${PLUGIN_NAME} 35 | PROPERTIES 36 | CXX_EXTENSIONS OFF 37 | CXX_STANDARD 17 38 | CXX_STANDARD_REQUIRED ON 39 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 40 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 41 | ) 42 | -------------------------------------------------------------------------------- /plugins/Analyzer/DialogXRefs.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "DialogXRefs.h" 3 | 4 | namespace AnalyzerPlugin { 5 | 6 | /** 7 | * @brief DialogXRefs::DialogXRefs 8 | * @param parent 9 | */ 10 | DialogXRefs::DialogXRefs(QWidget *parent, Qt::WindowFlags f) 11 | : QDialog(parent, f) { 12 | ui.setupUi(this); 13 | } 14 | 15 | /** 16 | * @brief DialogXRefs::on_listReferences_itemDoubleClicked 17 | * @param item 18 | */ 19 | void DialogXRefs::on_listReferences_itemDoubleClicked(QListWidgetItem *item) { 20 | 21 | edb::address_t site = item->data(Qt::UserRole).toULongLong(); 22 | edb::v1::jump_to_address(site); 23 | } 24 | 25 | /** 26 | * @brief DialogXRefs::addReference 27 | * @param ref 28 | */ 29 | void DialogXRefs::addReference(const std::pair &ref) { 30 | 31 | auto it = references_.find(ref); 32 | if (it == references_.end()) { 33 | references_.insert(ref); 34 | 35 | int offset; 36 | QString sym = edb::v1::find_function_symbol(ref.first, ref.first.toPointerString(), &offset); 37 | 38 | auto string = tr("%1. %2 -> %3").arg(ui.listReferences->count() + 1, 2, 10, QChar('0')).arg(sym).arg(ref.second.toPointerString()); 39 | 40 | auto item = new QListWidgetItem(string, ui.listReferences); 41 | item->setData(Qt::UserRole, static_cast(ref.first)); 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /plugins/Analyzer/DialogXRefs.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef DIALOG_XREFS_H_20191119_ 3 | #define DIALOG_XREFS_H_20191119_ 4 | 5 | #include "edb.h" 6 | #include "ui_DialogXRefs.h" 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | class QListWidgetItem; 13 | 14 | namespace AnalyzerPlugin { 15 | 16 | class DialogXRefs : public QDialog { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit DialogXRefs(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 21 | ~DialogXRefs() override = default; 22 | 23 | public Q_SLOTS: 24 | void on_listReferences_itemDoubleClicked(QListWidgetItem *item); 25 | 26 | public: 27 | void addReference(const std::pair &reference); 28 | 29 | private: 30 | Ui::DialogXRefs ui; 31 | std::set> references_; 32 | }; 33 | 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /plugins/Analyzer/OptionsPage.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef OPTIONS_PAGE_H_20090706_ 20 | #define OPTIONS_PAGE_H_20090706_ 21 | 22 | #include "ui_OptionsPage.h" 23 | #include 24 | 25 | namespace AnalyzerPlugin { 26 | 27 | class OptionsPage : public QWidget { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit OptionsPage(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 32 | ~OptionsPage() override = default; 33 | 34 | public: 35 | void showEvent(QShowEvent *event) override; 36 | 37 | private: 38 | void checkBoxToggled(bool checked = false); 39 | 40 | private: 41 | Ui::OptionsPage ui; 42 | }; 43 | 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /plugins/Analyzer/OptionsPage.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AnalyzerPlugin::OptionsPage 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Analyzer Plugin 15 | 16 | 17 | 18 | 19 | 20 | Use fuzzy logic to find functions 21 | 22 | 23 | 24 | 25 | 26 | 27 | Qt::Vertical 28 | 29 | 30 | 31 | 20 32 | 262 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /plugins/Assembler/Assembler.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | xml/assemblers.xml 4 | 5 | 6 | -------------------------------------------------------------------------------- /plugins/Assembler/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "Assembler") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets Xml XmlPatterns) 11 | 12 | qt5_add_resources(QRC_SOURCES 13 | Assembler.qrc 14 | ) 15 | 16 | foreach(FILE IN LISTS QRC_SOURCES) 17 | set_property(SOURCE ${FILE} PROPERTY SKIP_UNITY_BUILD_INCLUSION ON) 18 | endforeach() 19 | 20 | add_library(${PLUGIN_NAME} SHARED 21 | ${QRC_SOURCES} 22 | Assembler.cpp 23 | Assembler.h 24 | DialogAssembler.cpp 25 | DialogAssembler.h 26 | DialogAssembler.ui 27 | OptionsPage.cpp 28 | OptionsPage.h 29 | OptionsPage.ui 30 | ) 31 | 32 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets Qt5::Xml Qt5::XmlPatterns edb) 33 | 34 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 35 | 36 | target_add_warnings(${PLUGIN_NAME}) 37 | 38 | set_target_properties(${PLUGIN_NAME} 39 | PROPERTIES 40 | CXX_EXTENSIONS OFF 41 | CXX_STANDARD 17 42 | CXX_STANDARD_REQUIRED ON 43 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 44 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 45 | ) 46 | -------------------------------------------------------------------------------- /plugins/Assembler/OptionsPage.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef ASSEMBLER_OPTIONS_PAGE_H_20130611_ 20 | #define ASSEMBLER_OPTIONS_PAGE_H_20130611_ 21 | 22 | #include "ui_OptionsPage.h" 23 | #include 24 | 25 | namespace AssemblerPlugin { 26 | 27 | class OptionsPage : public QWidget { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit OptionsPage(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 32 | ~OptionsPage() override = default; 33 | 34 | public Q_SLOTS: 35 | void on_assemblerName_currentIndexChanged(const QString &text); 36 | 37 | private: 38 | Ui::OptionsPage ui; 39 | }; 40 | 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /plugins/Assembler/OptionsPage.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | AssemblerPlugin::OptionsPage 4 | 5 | 6 | 7 | 0 8 | 0 9 | 532 10 | 232 11 | 12 | 13 | 14 | Assembly Plugin 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Assembler Helper Application 23 | 24 | 25 | 26 | 27 | 28 | 29 | false 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Qt::Vertical 39 | 40 | 41 | 42 | 20 43 | 191 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /plugins/Backtrace/Backtrace.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Armen Boursalian 3 | aboursalian@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef BACKTRACE_H_20191119_ 20 | #define BACKTRACE_H_20191119_ 21 | 22 | #include "IPlugin.h" 23 | 24 | class QMenu; 25 | class QDialog; 26 | 27 | namespace BacktracePlugin { 28 | 29 | class Backtrace : public QObject, public IPlugin { 30 | Q_OBJECT 31 | Q_INTERFACES(IPlugin) 32 | Q_PLUGIN_METADATA(IID "edb.IPlugin/1.0") 33 | Q_CLASSINFO("author", "Armen Boursalian") 34 | Q_CLASSINFO("url", "https://github.com/Northern-Lights") 35 | 36 | public: 37 | explicit Backtrace(QObject *parent = nullptr); 38 | ~Backtrace() override; 39 | 40 | public: 41 | [[nodiscard]] QMenu *menu(QWidget *parent = nullptr) override; 42 | 43 | public Q_SLOTS: 44 | void showMenu(); 45 | 46 | private: 47 | QMenu *menu_ = nullptr; 48 | QPointer dialog_; 49 | }; 50 | 51 | } 52 | #endif 53 | -------------------------------------------------------------------------------- /plugins/Backtrace/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "Backtrace") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | Backtrace.cpp 14 | Backtrace.h 15 | CallStack.cpp 16 | CallStack.h 17 | DialogBacktrace.cpp 18 | DialogBacktrace.h 19 | DialogBacktrace.ui 20 | ) 21 | 22 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 23 | 24 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 25 | 26 | target_add_warnings(${PLUGIN_NAME}) 27 | 28 | set_target_properties(${PLUGIN_NAME} 29 | PROPERTIES 30 | CXX_EXTENSIONS OFF 31 | CXX_STANDARD 17 32 | CXX_STANDARD_REQUIRED ON 33 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 34 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 35 | ) 36 | -------------------------------------------------------------------------------- /plugins/Backtrace/CallStack.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Armen Boursalian 3 | aboursalian@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef CALL_STACK_H_20191119_ 20 | #define CALL_STACK_H_20191119_ 21 | 22 | #include "edb.h" 23 | #include 24 | 25 | class CallStack { 26 | public: 27 | CallStack(); 28 | ~CallStack() = default; 29 | 30 | public: 31 | // Struct that holds the caller and return addresses. 32 | struct StackFrame { 33 | edb::address_t ret; 34 | edb::address_t caller; 35 | }; 36 | 37 | private: 38 | void getCallStack(); 39 | 40 | public: 41 | [[nodiscard]] StackFrame *operator[](size_t index); 42 | [[nodiscard]] size_t size() const; 43 | [[nodiscard]] StackFrame *top(); 44 | [[nodiscard]] StackFrame *bottom(); 45 | void push(StackFrame frame); 46 | 47 | private: 48 | std::deque stackFrames_; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /plugins/BinaryInfo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "BinaryInfo") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | BinaryInfo.cpp 14 | BinaryInfo.h 15 | demangle.h 16 | DialogRegions.cpp 17 | DialogRegions.h 18 | DialogRegions.ui 19 | DialogHeader.ui 20 | DialogHeader.cpp 21 | DialogHeader.h 22 | ELF32.cpp 23 | ELF64.cpp 24 | ELFXX.cpp 25 | ELFXX.h 26 | OptionsPage.cpp 27 | OptionsPage.h 28 | OptionsPage.ui 29 | PE32.cpp 30 | PE32.h 31 | symbols.cpp 32 | symbols.h 33 | ) 34 | 35 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets PE ELF edb) 36 | 37 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 38 | 39 | target_add_warnings(${PLUGIN_NAME}) 40 | 41 | set_target_properties(${PLUGIN_NAME} 42 | PROPERTIES 43 | CXX_EXTENSIONS OFF 44 | CXX_STANDARD 17 45 | CXX_STANDARD_REQUIRED ON 46 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 47 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 48 | ) 49 | 50 | -------------------------------------------------------------------------------- /plugins/BinaryInfo/DialogHeader.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DIALOG_HEADER_H_20190403_ 20 | #define DIALOG_HEADER_H_20190403_ 21 | 22 | #include "IRegion.h" 23 | #include "Types.h" 24 | #include "ui_DialogHeader.h" 25 | #include 26 | #include 27 | 28 | class QStringListModel; 29 | class QSortFilterProxyModel; 30 | class QModelIndex; 31 | 32 | namespace BinaryInfoPlugin { 33 | 34 | class DialogHeader : public QDialog { 35 | Q_OBJECT 36 | 37 | public: 38 | explicit DialogHeader(const std::shared_ptr ®ion, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 39 | ~DialogHeader() override = default; 40 | 41 | private: 42 | Ui::DialogHeader ui; 43 | }; 44 | 45 | } 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /plugins/BinaryInfo/DialogRegions.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DIALOG_REGIONS_H_20111128_ 20 | #define DIALOG_REGIONS_H_20111128_ 21 | 22 | #include "Types.h" 23 | #include "ui_DialogRegions.h" 24 | #include 25 | 26 | class QStringListModel; 27 | class QSortFilterProxyModel; 28 | class QModelIndex; 29 | 30 | namespace BinaryInfoPlugin { 31 | 32 | class DialogRegions : public QDialog { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit DialogRegions(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 37 | ~DialogRegions() override = default; 38 | 39 | private: 40 | void showEvent(QShowEvent *event) override; 41 | 42 | private: 43 | Ui::DialogRegions ui; 44 | QSortFilterProxyModel *filterModel_ = nullptr; 45 | QPushButton *buttonExplore_ = nullptr; 46 | }; 47 | 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /plugins/BinaryInfo/ELF32.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include "ELFXX.h" 20 | #include "IDebugger.h" 21 | #include "edb.h" 22 | #include "string_hash.h" 23 | 24 | namespace BinaryInfoPlugin { 25 | 26 | /** 27 | * @brief ELF32::native 28 | * @return true if this binary is native to the arch edb was built for 29 | */ 30 | template <> 31 | bool ELF32::native() const { 32 | #if defined(EDB_X86) || defined(EDB_X86_64) 33 | return edb::v1::debugger_core->cpuType() == edb::string_hash("x86"); 34 | #elif defined(EDB_ARM32) || defined(EDB_ARM64) 35 | return edb::v1::debugger_core->cpuType() == edb::string_hash("arm"); 36 | #else 37 | #error "Unsupported Architecture" 38 | #endif 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /plugins/BinaryInfo/ELF64.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include "ELFXX.h" 20 | #include "IDebugger.h" 21 | #include "edb.h" 22 | #include "string_hash.h" 23 | 24 | namespace BinaryInfoPlugin { 25 | 26 | /** 27 | * @brief ELF64::native 28 | * @return true if this binary is native to the arch edb was built for 29 | */ 30 | template <> 31 | bool ELF64::native() const { 32 | #if defined(EDB_X86) || defined(EDB_X86_64) 33 | return edb::v1::debugger_core->cpuType() == edb::string_hash("x86-64"); 34 | #elif defined(EDB_ARM32) || defined(EDB_ARM64) 35 | return edb::v1::debugger_core->cpuType() == edb::string_hash("AArch64"); 36 | #else 37 | #error "Unsupported Architecture" 38 | #endif 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /plugins/BinaryInfo/OptionsPage.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Ruslan Kabatsayev 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef OPTIONS_PAGE_H_20151113_ 19 | #define OPTIONS_PAGE_H_20151113_ 20 | 21 | #include "ui_OptionsPage.h" 22 | #include 23 | #include 24 | 25 | namespace BinaryInfoPlugin { 26 | 27 | class OptionsPage : public QWidget { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit OptionsPage(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 32 | ~OptionsPage() override = default; 33 | 34 | public: 35 | void showEvent(QShowEvent *event) override; 36 | 37 | public Q_SLOTS: 38 | void on_checkBox_toggled(bool checked = false); 39 | void on_txtDebugDir_textChanged(const QString &text); 40 | void on_btnDebugDir_clicked(); 41 | 42 | private: 43 | Ui::OptionsPage ui; 44 | }; 45 | 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /plugins/BinaryInfo/demangle.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef EDB_DEMANGLE_H_20151113_ 3 | #define EDB_DEMANGLE_H_20151113_ 4 | 5 | #include 6 | #include 7 | 8 | #ifdef __GNUG__ 9 | #include 10 | #include 11 | 12 | #define DEMANGLING_SUPPORTED 13 | 14 | inline QString demangle(const QString &mangled) { 15 | if (!mangled.startsWith("_Z")) { 16 | return mangled; // otherwise we'll try to demangle C functions coinciding with types like "f" as "float", which is bad 17 | } 18 | 19 | int failed = 0; 20 | QStringList split = mangled.split("@"); // for cases like funcName@plt 21 | 22 | std::unique_ptr demangled(abi::__cxa_demangle(split.front().toStdString().c_str(), nullptr, nullptr, &failed), std::free); 23 | 24 | if (failed) { 25 | return mangled; 26 | } 27 | 28 | split.front() = QString(demangled.get()); 29 | return split.join("@"); 30 | } 31 | 32 | #else 33 | 34 | inline QString demangle(const QString &mangled) { 35 | return mangled; 36 | } 37 | 38 | #endif 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /plugins/BinaryInfo/symbols.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef SYMBOLS_H_20110312_ 20 | #define SYMBOLS_H_20110312_ 21 | 22 | class QString; 23 | #include 24 | 25 | namespace BinaryInfoPlugin { 26 | 27 | bool generate_symbols(const QString &filename, std::ostream &os = std::cout); 28 | 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /plugins/BinarySearcher/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "BinarySearcher") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | BinarySearcher.cpp 14 | BinarySearcher.h 15 | DialogAsciiString.cpp 16 | DialogAsciiString.h 17 | DialogAsciiString.ui 18 | DialogBinaryString.cpp 19 | DialogBinaryString.h 20 | DialogBinaryString.ui 21 | DialogResults.cpp 22 | DialogResults.h 23 | DialogResults.ui 24 | ) 25 | 26 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 27 | 28 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 29 | 30 | target_add_warnings(${PLUGIN_NAME}) 31 | 32 | set_target_properties(${PLUGIN_NAME} 33 | PROPERTIES 34 | CXX_EXTENSIONS OFF 35 | CXX_STANDARD 17 36 | CXX_STANDARD_REQUIRED ON 37 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 38 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 39 | ) 40 | 41 | -------------------------------------------------------------------------------- /plugins/BinarySearcher/DialogAsciiString.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DIALOG_ASCII_STRING_H_20082201_ 20 | #define DIALOG_ASCII_STRING_H_20082201_ 21 | 22 | #include "ui_DialogAsciiString.h" 23 | #include 24 | 25 | class QListWidgetItem; 26 | 27 | namespace BinarySearcherPlugin { 28 | 29 | class DialogAsciiString : public QDialog { 30 | Q_OBJECT 31 | 32 | public: 33 | explicit DialogAsciiString(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 34 | ~DialogAsciiString() override = default; 35 | 36 | protected: 37 | void showEvent(QShowEvent *event) override; 38 | 39 | private: 40 | void doFind(); 41 | 42 | private: 43 | Ui::DialogAsciiString ui; 44 | QPushButton *buttonFind_ = nullptr; 45 | }; 46 | 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /plugins/BinarySearcher/DialogBinaryString.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DIALOG_BINARY_STRING_H_20061101_ 20 | #define DIALOG_BINARY_STRING_H_20061101_ 21 | 22 | #include "ui_DialogBinaryString.h" 23 | #include 24 | #include 25 | 26 | class QListWidgetItem; 27 | 28 | namespace BinarySearcherPlugin { 29 | 30 | class DialogResults; 31 | 32 | class DialogBinaryString : public QDialog { 33 | Q_OBJECT 34 | 35 | public: 36 | explicit DialogBinaryString(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 37 | ~DialogBinaryString() override = default; 38 | 39 | private: 40 | void doFind(); 41 | 42 | private: 43 | Ui::DialogBinaryString ui; 44 | QPushButton *buttonFind_ = nullptr; 45 | QPointer results_; 46 | }; 47 | 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /plugins/Bookmarks/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "Bookmarks") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | Bookmarks.cpp 14 | Bookmarks.h 15 | BookmarkWidget.cpp 16 | BookmarkWidget.h 17 | BookmarksModel.cpp 18 | BookmarksModel.h 19 | BookmarkWidget.ui 20 | ) 21 | 22 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 23 | 24 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 25 | 26 | target_add_warnings(${PLUGIN_NAME}) 27 | 28 | set_target_properties(${PLUGIN_NAME} 29 | PROPERTIES 30 | CXX_EXTENSIONS OFF 31 | CXX_STANDARD 17 32 | CXX_STANDARD_REQUIRED ON 33 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 34 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 35 | ) 36 | -------------------------------------------------------------------------------- /plugins/BreakpointManager/BreakpointManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include "BreakpointManager.h" 20 | #include 21 | 22 | namespace BreakpointManagerPlugin { 23 | 24 | /** 25 | * @brief BreakpointManager::BreakpointManager 26 | * @param parent 27 | */ 28 | BreakpointManager::BreakpointManager(QObject *parent) 29 | : QObject(parent) { 30 | } 31 | 32 | /** 33 | * @brief BreakpointManager::~BreakpointManager 34 | */ 35 | BreakpointManager::~BreakpointManager() = default; 36 | 37 | /** 38 | * @brief BreakpointManager::menu 39 | * @param parent 40 | * @return 41 | */ 42 | QMenu *BreakpointManager::menu(QWidget *parent) { 43 | Q_ASSERT(parent); 44 | return nullptr; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /plugins/BreakpointManager/BreakpointManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef BREAKPOINT_MANAGER_H_20060430_ 20 | #define BREAKPOINT_MANAGER_H_20060430_ 21 | 22 | #include "IPlugin.h" 23 | 24 | class QMenu; 25 | class QDialog; 26 | 27 | namespace BreakpointManagerPlugin { 28 | 29 | class BreakpointManager : public QObject, public IPlugin { 30 | Q_OBJECT 31 | Q_INTERFACES(IPlugin) 32 | Q_PLUGIN_METADATA(IID "edb.IPlugin/1.0") 33 | Q_CLASSINFO("author", "Evan Teran") 34 | Q_CLASSINFO("url", "http://www.codef00.com") 35 | 36 | public: 37 | explicit BreakpointManager(QObject *parent = nullptr); 38 | ~BreakpointManager() override; 39 | 40 | public: 41 | [[nodiscard]] QMenu *menu(QWidget *parent = nullptr) override; 42 | }; 43 | 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /plugins/BreakpointManager/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "BreakpointManager") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | BreakpointManager.cpp 14 | BreakpointManager.h 15 | ) 16 | 17 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 18 | 19 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 20 | 21 | target_add_warnings(${PLUGIN_NAME}) 22 | 23 | set_target_properties(${PLUGIN_NAME} 24 | PROPERTIES 25 | CXX_EXTENSIONS OFF 26 | CXX_STANDARD 17 27 | CXX_STANDARD_REQUIRED ON 28 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 29 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 30 | ) 31 | -------------------------------------------------------------------------------- /plugins/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | 3 | add_definitions(-DQT_PLUGIN) 4 | 5 | add_subdirectory(DebuggerCore) 6 | add_subdirectory(Analyzer) 7 | add_subdirectory(Assembler) 8 | add_subdirectory(BinaryInfo) 9 | add_subdirectory(Bookmarks) 10 | add_subdirectory(BreakpointManager) 11 | add_subdirectory(CheckVersion) 12 | add_subdirectory(OpcodeSearcher) 13 | add_subdirectory(ProcessProperties) 14 | add_subdirectory(ROPTool) 15 | add_subdirectory(References) 16 | add_subdirectory(SymbolViewer) 17 | add_subdirectory(Backtrace) 18 | add_subdirectory(DumpState) 19 | add_subdirectory(FunctionFinder) 20 | add_subdirectory(DebuggerErrorConsole) 21 | add_subdirectory(BinarySearcher) 22 | add_subdirectory(InstructionInspector) 23 | add_subdirectory(FasLoader) 24 | add_subdirectory(ODbgRegisterView) 25 | 26 | if(TARGET_ARCH_FAMILY_X86) 27 | add_subdirectory(HardwareBreakpoints) 28 | endif() 29 | 30 | if(TARGET_PLATFORM_LINUX) 31 | add_subdirectory(HeapAnalyzer) 32 | endif() 33 | -------------------------------------------------------------------------------- /plugins/CheckVersion/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "CheckVersion") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets Network) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | CheckVersion.cpp 14 | CheckVersion.h 15 | OptionsPage.cpp 16 | OptionsPage.h 17 | OptionsPage.ui 18 | ) 19 | 20 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets Qt5::Network edb) 21 | 22 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 23 | 24 | target_add_warnings(${PLUGIN_NAME}) 25 | 26 | set_target_properties(${PLUGIN_NAME} 27 | PROPERTIES 28 | CXX_EXTENSIONS OFF 29 | CXX_STANDARD 17 30 | CXX_STANDARD_REQUIRED ON 31 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 32 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 33 | ) 34 | -------------------------------------------------------------------------------- /plugins/CheckVersion/OptionsPage.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef OPTIONS_PAGE_H_20090703_ 20 | #define OPTIONS_PAGE_H_20090703_ 21 | 22 | #include "ui_OptionsPage.h" 23 | #include 24 | 25 | namespace CheckVersionPlugin { 26 | 27 | class OptionsPage : public QWidget { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit OptionsPage(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 32 | ~OptionsPage() override = default; 33 | 34 | public: 35 | void showEvent(QShowEvent *event) override; 36 | 37 | public Q_SLOTS: 38 | void on_checkBox_toggled(bool checked); 39 | 40 | private: 41 | Ui::OptionsPage ui; 42 | }; 43 | 44 | } 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /plugins/CheckVersion/OptionsPage.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | CheckVersionPlugin::OptionsPage 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 300 11 | 12 | 13 | 14 | Check Version Plugin 15 | 16 | 17 | 18 | 19 | 20 | Check for new version on startup 21 | 22 | 23 | 24 | 25 | 26 | 27 | Qt::Vertical 28 | 29 | 30 | 31 | 20 32 | 262 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /plugins/DebuggerCore/unix/Posix.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef POSIX_H_20181211_ 3 | #define POSIX_H_20181211_ 4 | 5 | #include "OSTypes.h" 6 | #include 7 | #include 8 | 9 | namespace DebuggerCorePlugin::Posix { 10 | 11 | void initialize(); 12 | int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); 13 | int select_ex(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, std::chrono::milliseconds msecs); 14 | pid_t waitpid(pid_t pid, int *status, int options); 15 | ssize_t read(int fd, void *buf, size_t count); 16 | ssize_t write(int fd, const void *buf, size_t count); 17 | bool wait_for_sigchld(std::chrono::milliseconds msecs); 18 | 19 | } 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /plugins/DebuggerCore/unix/Unix.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef UNIX_H_20181211_ 3 | #define UNIX_H_20181211_ 4 | 5 | #include "Status.h" 6 | #include 7 | #include 8 | #include 9 | 10 | namespace DebuggerCorePlugin::Unix { 11 | 12 | QMap exceptions(); 13 | QString exception_name(qlonglong value); 14 | qlonglong exception_value(const QString &name); 15 | Status execute_process(const QString &path, const QString &cwd, const QList &args); 16 | 17 | } 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /plugins/DebuggerCore/unix/freebsd/PlatformCommon.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "PlatformCommon.h" 3 | -------------------------------------------------------------------------------- /plugins/DebuggerCore/unix/freebsd/PlatformCommon.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef PLATFORM_COMMON_H_20181225_ 3 | #define PLATFORM_COMMON_H_20181225_ 4 | 5 | #endif 6 | -------------------------------------------------------------------------------- /plugins/DebuggerCore/unix/freebsd/PlatformState.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include "PlatformState.h" 20 | 21 | namespace DebuggerCorePlugin { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /plugins/DebuggerCore/unix/linux/DialogMemoryAccess.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include "DialogMemoryAccess.h" 20 | 21 | namespace DebuggerCorePlugin { 22 | 23 | /** 24 | * @brief DialogMemoryAccess::DialogMemoryAccess 25 | * @param parent 26 | * @param f 27 | */ 28 | DialogMemoryAccess::DialogMemoryAccess(QWidget *parent, Qt::WindowFlags f) 29 | : QDialog(parent, f) { 30 | 31 | ui.setupUi(this); 32 | adjustSize(); 33 | setFixedSize(width(), height()); 34 | } 35 | 36 | /** 37 | * @brief DialogMemoryAccess::warnNextTime 38 | * @return 39 | */ 40 | bool DialogMemoryAccess::warnNextTime() const { 41 | return !ui.checkNeverShowAgain->isChecked(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /plugins/DebuggerCore/unix/linux/DialogMemoryAccess.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DIALOG_MEMORY_ACCESS_H_20160930_ 20 | #define DIALOG_MEMORY_ACCESS_H_20160930_ 21 | 22 | #include "ui_DialogMemoryAccess.h" 23 | #include 24 | 25 | namespace DebuggerCorePlugin { 26 | 27 | class DialogMemoryAccess final : public QDialog { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit DialogMemoryAccess(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 32 | ~DialogMemoryAccess() override = default; 33 | 34 | public: 35 | [[nodiscard]] bool warnNextTime() const; 36 | 37 | private: 38 | Ui::DialogMemoryAccess ui; 39 | }; 40 | 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /plugins/DebuggerCore/unix/linux/FeatureDetect.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2016 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef FEATURE_DETECT_H_20191119_ 20 | #define FEATURE_DETECT_H_20191119_ 21 | 22 | namespace DebuggerCorePlugin::feature { 23 | 24 | bool detect_proc_access(bool *read_broken, bool *write_broken); 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /plugins/DebuggerCore/unix/linux/PrStatus.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef PR_STATUS_H_20191119_ 3 | #define PR_STATUS_H_20191119_ 4 | 5 | #include 6 | 7 | struct PrStatus_X86 { 8 | uint32_t ebx; 9 | uint32_t ecx; 10 | uint32_t edx; 11 | uint32_t esi; 12 | uint32_t edi; 13 | uint32_t ebp; 14 | uint32_t eax; 15 | uint32_t ds; 16 | uint32_t es; 17 | uint32_t fs; 18 | uint32_t gs; 19 | uint32_t orig_eax; 20 | uint32_t eip; 21 | uint32_t cs; 22 | uint32_t eflags; 23 | uint32_t esp; 24 | uint32_t ss; 25 | }; 26 | 27 | static_assert(sizeof(PrStatus_X86) == 68, "PrStatus_X86 is messed up!"); 28 | 29 | struct PrStatus_X86_64 { 30 | uint64_t r15; 31 | uint64_t r14; 32 | uint64_t r13; 33 | uint64_t r12; 34 | uint64_t rbp; 35 | uint64_t rbx; 36 | uint64_t r11; 37 | uint64_t r10; 38 | uint64_t r9; 39 | uint64_t r8; 40 | uint64_t rax; 41 | uint64_t rcx; 42 | uint64_t rdx; 43 | uint64_t rsi; 44 | uint64_t rdi; 45 | uint64_t orig_rax; 46 | uint64_t rip; 47 | uint64_t cs; 48 | uint64_t rflags; 49 | uint64_t rsp; 50 | uint64_t ss; 51 | uint64_t fs_base; 52 | uint64_t gs_base; 53 | uint64_t ds; 54 | uint64_t es; 55 | uint64_t fs; 56 | uint64_t gs; 57 | }; 58 | 59 | static_assert(sizeof(PrStatus_X86_64) == 216, "PrStatus_X86_64 is messed up!"); 60 | 61 | struct PrStatus_ARM { 62 | uint32_t regs[18]; 63 | }; 64 | 65 | static_assert(sizeof(PrStatus_ARM) == 72, "PrStatus_ARM is messed up!"); 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /plugins/DebuggerCore/unix/openbsd/PlatformProcess.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include "PlatformProcess.h" 20 | -------------------------------------------------------------------------------- /plugins/DebuggerCore/unix/openbsd/PlatformProcess.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef PLATFORM_PROCESS_H_20150517_ 20 | #define PLATFORM_PROCESS_H_20150517_ 21 | 22 | #include "IProcess.h" 23 | 24 | class PlatformProcess : public IProcess { 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /plugins/DebuggerCore/unix/osx/PlatformProcess.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include "PlatformProcess.h" 20 | -------------------------------------------------------------------------------- /plugins/DebuggerCore/unix/osx/PlatformProcess.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef PLATFORM_PROCESS_H_20150517_ 20 | #define PLATFORM_PROCESS_H_20150517_ 21 | 22 | #include "IProcess.h" 23 | 24 | class PlatformProcess : public IProcess { 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /plugins/DebuggerErrorConsole/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "DebuggerErrorConsole") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | Plugin.cpp 14 | Plugin.h 15 | ) 16 | 17 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 18 | 19 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 20 | 21 | target_add_warnings(${PLUGIN_NAME}) 22 | 23 | set_target_properties(${PLUGIN_NAME} 24 | PROPERTIES 25 | CXX_EXTENSIONS OFF 26 | CXX_STANDARD 17 27 | CXX_STANDARD_REQUIRED ON 28 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 29 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 30 | ) 31 | -------------------------------------------------------------------------------- /plugins/DebuggerErrorConsole/Plugin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2017 Ruslan Kabatsayev 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #include "Plugin.h" 19 | 20 | namespace DebuggerErrorConsolePlugin { 21 | 22 | /** 23 | * @brief Plugin::Plugin 24 | * @param parent 25 | */ 26 | Plugin::Plugin(QObject *parent) 27 | : QObject(parent) { 28 | } 29 | 30 | /** 31 | * @brief Plugin::menu 32 | * @param parent 33 | * @return 34 | */ 35 | QMenu *Plugin::menu(QWidget *) { 36 | return nullptr; 37 | } 38 | 39 | /** 40 | * @brief DebuggerErrorConsole::DebuggerErrorConsole 41 | * @param parent 42 | * @param f 43 | */ 44 | DebuggerErrorConsole::DebuggerErrorConsole(QWidget *parent, Qt::WindowFlags f) 45 | : QDialog(parent, f) { 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /plugins/DumpState/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "DumpState") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | DumpState.cpp 14 | DumpState.h 15 | OptionsPage.cpp 16 | OptionsPage.h 17 | OptionsPage.ui 18 | ) 19 | 20 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 21 | 22 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 23 | 24 | target_add_warnings(${PLUGIN_NAME}) 25 | 26 | set_target_properties(${PLUGIN_NAME} 27 | PROPERTIES 28 | CXX_EXTENSIONS OFF 29 | CXX_STANDARD 17 30 | CXX_STANDARD_REQUIRED ON 31 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 32 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 33 | ) 34 | -------------------------------------------------------------------------------- /plugins/DumpState/OptionsPage.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef OPTIONS_PAGE_H_20090706_ 20 | #define OPTIONS_PAGE_H_20090706_ 21 | 22 | #include "ui_OptionsPage.h" 23 | #include 24 | 25 | namespace DumpStatePlugin { 26 | 27 | class OptionsPage : public QWidget { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit OptionsPage(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 32 | ~OptionsPage() override = default; 33 | 34 | public: 35 | void showEvent(QShowEvent *event) override; 36 | 37 | public Q_SLOTS: 38 | void on_instructionsBeforeIP_valueChanged(int i); 39 | void on_instructionsAfterIP_valueChanged(int i); 40 | void on_colorizeOutput_toggled(bool value); 41 | 42 | private: 43 | Ui::OptionsPage ui; 44 | }; 45 | 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /plugins/FasLoader/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "FasLoader") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | FasLoader.cpp 14 | FasLoader.hpp 15 | 16 | Fas/Core.cpp 17 | Fas/Core.hpp 18 | Fas/Exception.cpp 19 | Fas/Exception.hpp 20 | Fas/Header.hpp 21 | Fas/PluginSymbol.hpp 22 | Fas/Symbol.hpp 23 | ) 24 | 25 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 26 | 27 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 28 | 29 | target_add_warnings(${PLUGIN_NAME}) 30 | 31 | set_target_properties(${PLUGIN_NAME} 32 | PROPERTIES 33 | CXX_EXTENSIONS OFF 34 | CXX_STANDARD 17 35 | CXX_STANDARD_REQUIRED ON 36 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 37 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 38 | ) 39 | -------------------------------------------------------------------------------- /plugins/FasLoader/Fas/Exception.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * @file: Exception.cpp 3 | * 4 | * This file part of RT ( Reconstructive Tools ) 5 | * Copyright (c) 2018 darkprof 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | **/ 20 | 21 | #include "Exception.hpp" 22 | 23 | namespace Fas { 24 | 25 | Exception::Exception(std::string message) 26 | : message_(std::move(message)) { 27 | } 28 | 29 | const char *Exception::what() const noexcept { 30 | return message_.c_str(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /plugins/FasLoader/Fas/Exception.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * @file: Exception.hpp 3 | * 4 | * This file part of RT ( Reconstructive Tools ) 5 | * Copyright (c) 2018 darkprof 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | **/ 20 | 21 | #ifndef FAS_EXCEPTION_H_ 22 | #define FAS_EXCEPTION_H_ 23 | 24 | #include 25 | #include 26 | 27 | namespace Fas { 28 | 29 | class Exception : public std::exception { 30 | public: 31 | explicit Exception(std::string message); 32 | ~Exception() noexcept override = default; 33 | 34 | [[nodiscard]] const char *what() const noexcept override; 35 | 36 | protected: 37 | std::string message_; 38 | }; 39 | 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /plugins/FasLoader/Fas/PluginSymbol.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * @file: PluginSymbol.cpp 3 | * 4 | * This file part of RT ( Reconstructive Tools ) 5 | * Copyright (c) 2018 darkprof 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | **/ 20 | 21 | #ifndef FAS_PLUGIN_SYMBOL_H_ 22 | #define FAS_PLUGIN_SYMBOL_H_ 23 | 24 | #include 25 | #include 26 | 27 | namespace Fas { 28 | 29 | struct PluginSymbol { 30 | uint64_t value; 31 | std::string name; 32 | uint8_t size; 33 | }; 34 | 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /plugins/FasLoader/FasLoader.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 * Evan Teran evan.teran@gmail.com 3 | * darkprof dark_prof@mail.ru 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef FAS_LOADER_HPP_ 20 | #define FAS_LOADER_HPP_ 21 | 22 | #include "Fas/Core.hpp" 23 | #include "IPlugin.h" 24 | 25 | class QMenu; 26 | 27 | namespace FasLoaderPlugin { 28 | 29 | class FasLoader : public QObject, public IPlugin { 30 | Q_OBJECT 31 | Q_INTERFACES(IPlugin) 32 | Q_PLUGIN_METADATA(IID "edb.IPlugin/1.0") 33 | Q_CLASSINFO("author", "darkprof") 34 | Q_CLASSINFO("url", "http://www.codef00.com") 35 | 36 | public: 37 | explicit FasLoader(QObject *parent = nullptr); 38 | ~FasLoader() override = default; 39 | 40 | public: 41 | [[nodiscard]] QMenu *menu(QWidget *parent = nullptr) override; 42 | 43 | private Q_SLOTS: 44 | void load(); 45 | 46 | private: 47 | QMenu *menu_ = nullptr; 48 | }; 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /plugins/FunctionFinder/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "FunctionFinder") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | DialogFunctions.cpp 14 | DialogFunctions.h 15 | DialogFunctions.ui 16 | DialogResults.cpp 17 | DialogResults.h 18 | DialogResults.ui 19 | FunctionFinder.cpp 20 | FunctionFinder.h 21 | ResultsModel.h 22 | ResultsModel.cpp 23 | ) 24 | 25 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 26 | 27 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 28 | 29 | target_add_warnings(${PLUGIN_NAME}) 30 | 31 | set_target_properties(${PLUGIN_NAME} 32 | PROPERTIES 33 | CXX_EXTENSIONS OFF 34 | CXX_STANDARD 17 35 | CXX_STANDARD_REQUIRED ON 36 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 37 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 38 | ) 39 | -------------------------------------------------------------------------------- /plugins/FunctionFinder/DialogFunctions.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DIALOG_FUNCTIONS_H_20061101_ 20 | #define DIALOG_FUNCTIONS_H_20061101_ 21 | 22 | #include "Types.h" 23 | #include "ui_DialogFunctions.h" 24 | #include 25 | 26 | class QSortFilterProxyModel; 27 | 28 | namespace FunctionFinderPlugin { 29 | 30 | class DialogFunctions : public QDialog { 31 | Q_OBJECT 32 | 33 | public: 34 | explicit DialogFunctions(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 35 | ~DialogFunctions() override = default; 36 | 37 | private: 38 | void showEvent(QShowEvent *event) override; 39 | 40 | private: 41 | void doFind(); 42 | 43 | private: 44 | Ui::DialogFunctions ui; 45 | QSortFilterProxyModel *filterModel_ = nullptr; 46 | QPushButton *buttonFind_ = nullptr; 47 | }; 48 | 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /plugins/HardwareBreakpoints/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "HardwareBreakpoints") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | DialogHwBreakpoints.cpp 14 | DialogHwBreakpoints.h 15 | DialogHwBreakpoints.ui 16 | HardwareBreakpoints.cpp 17 | HardwareBreakpoints.h 18 | libHardwareBreakpoints.cpp 19 | libHardwareBreakpoints.h 20 | ) 21 | 22 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 23 | 24 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 25 | 26 | target_add_warnings(${PLUGIN_NAME}) 27 | 28 | set_target_properties(${PLUGIN_NAME} 29 | PROPERTIES 30 | CXX_EXTENSIONS OFF 31 | CXX_STANDARD 17 32 | CXX_STANDARD_REQUIRED ON 33 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 34 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 35 | ) 36 | -------------------------------------------------------------------------------- /plugins/HeapAnalyzer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "HeapAnalyzer") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets Concurrent) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | DialogHeap.cpp 14 | DialogHeap.h 15 | DialogHeap.ui 16 | HeapAnalyzer.cpp 17 | HeapAnalyzer.h 18 | ResultViewModel.cpp 19 | ResultViewModel.h 20 | ) 21 | 22 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets Qt5::Concurrent edb) 23 | 24 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 25 | 26 | target_add_warnings(${PLUGIN_NAME}) 27 | 28 | set_target_properties(${PLUGIN_NAME} 29 | PROPERTIES 30 | CXX_EXTENSIONS OFF 31 | CXX_STANDARD 17 32 | CXX_STANDARD_REQUIRED ON 33 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 34 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 35 | ) 36 | -------------------------------------------------------------------------------- /plugins/HeapAnalyzer/HeapAnalyzer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef HEAP_ANALYZER_H_20060430_ 20 | #define HEAP_ANALYZER_H_20060430_ 21 | 22 | #include "IPlugin.h" 23 | 24 | class QMenu; 25 | class QDialog; 26 | 27 | namespace HeapAnalyzerPlugin { 28 | 29 | class HeapAnalyzer : public QObject, public IPlugin { 30 | Q_OBJECT 31 | Q_INTERFACES(IPlugin) 32 | Q_PLUGIN_METADATA(IID "edb.IPlugin/1.0") 33 | Q_CLASSINFO("author", "Evan Teran") 34 | Q_CLASSINFO("url", "http://www.codef00.com") 35 | 36 | public: 37 | explicit HeapAnalyzer(QObject *parent = nullptr); 38 | ~HeapAnalyzer() override; 39 | 40 | public: 41 | [[nodiscard]] QMenu *menu(QWidget *parent = nullptr) override; 42 | 43 | public Q_SLOTS: 44 | void showMenu(); 45 | 46 | private: 47 | QMenu *menu_ = nullptr; 48 | QPointer dialog_; 49 | }; 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /plugins/InstructionInspector/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "InstructionInspector") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | Plugin.cpp 14 | Plugin.h 15 | ) 16 | 17 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 18 | 19 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 20 | 21 | target_add_warnings(${PLUGIN_NAME}) 22 | 23 | set_target_properties(${PLUGIN_NAME} 24 | PROPERTIES 25 | CXX_EXTENSIONS OFF 26 | CXX_STANDARD 17 27 | CXX_STANDARD_REQUIRED ON 28 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 29 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 30 | ) 31 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/BitFieldDescription.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "BitFieldDescription.h" 3 | #include 4 | 5 | namespace ODbgRegisterView { 6 | 7 | BitFieldDescription::BitFieldDescription(int textWidth, std::vector valueNames, std::vector setValueTexts, std::function valueEqualComparator) 8 | : textWidth(textWidth), valueNames(std::move(valueNames)), setValueTexts(std::move(setValueTexts)), valueEqualComparator(std::move(valueEqualComparator)) { 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/BitFieldDescription.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef BIT_FIELD_DESCRIPTION_H_20191119_ 3 | #define BIT_FIELD_DESCRIPTION_H_20191119_ 4 | 5 | #include 6 | #include 7 | 8 | class QString; 9 | 10 | namespace ODbgRegisterView { 11 | 12 | struct BitFieldDescription { 13 | int textWidth; 14 | std::vector valueNames; 15 | std::vector setValueTexts; 16 | std::function const valueEqualComparator; 17 | 18 | BitFieldDescription( 19 | int textWidth, 20 | std::vector valueNames, 21 | std::vector setValueTexts, 22 | std::function valueEqualComparator = [](unsigned a, unsigned b) { return a == b; }); 23 | }; 24 | 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/BitFieldFormatter.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Ruslan Kabatsayev 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef BIT_FIELD_FORMATTER_H_20191119_ 19 | #define BIT_FIELD_FORMATTER_H_20191119_ 20 | 21 | #include 22 | #include 23 | 24 | namespace ODbgRegisterView { 25 | 26 | struct BitFieldDescription; 27 | 28 | class BitFieldFormatter { 29 | public: 30 | explicit BitFieldFormatter(const BitFieldDescription &bfd); 31 | QString operator()(const QString &str) const; 32 | 33 | private: 34 | std::vector valueNames; 35 | }; 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/Canvas.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Canvas.h" 3 | #include "ODbgRV_Util.h" 4 | 5 | #include 6 | #include 7 | 8 | namespace ODbgRegisterView { 9 | 10 | Canvas::Canvas(QWidget *parent, Qt::WindowFlags f) 11 | : QWidget(parent, f) { 12 | 13 | setObjectName("RegViewCanvas"); 14 | const auto canvasLayout = new QVBoxLayout(this); 15 | canvasLayout->setSpacing(letter_size(parent->font()).height() / 2); 16 | canvasLayout->setContentsMargins(parent->contentsMargins()); 17 | canvasLayout->setAlignment(Qt::AlignTop); 18 | setLayout(canvasLayout); 19 | setBackgroundRole(QPalette::Base); 20 | setAutoFillBackground(true); 21 | } 22 | 23 | void Canvas::mousePressEvent(QMouseEvent *event) { 24 | event->ignore(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/Canvas.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Ruslan Kabatsayev 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef CANVAS_H_20151031_ 19 | #define CANVAS_H_20151031_ 20 | 21 | #include 22 | 23 | namespace ODbgRegisterView { 24 | 25 | class Canvas : public QWidget { 26 | Q_OBJECT 27 | public: 28 | explicit Canvas(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 29 | 30 | protected: 31 | void mousePressEvent(QMouseEvent *event) override; 32 | }; 33 | 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/EntryGridKeyUpDownEventFilter.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ENTRY_GRID_KEY_UP_DOWN_EVENT_FILTER_H_20170705_ 3 | #define ENTRY_GRID_KEY_UP_DOWN_EVENT_FILTER_H_20170705_ 4 | 5 | class QWidget; 6 | class QObject; 7 | class QEvent; 8 | 9 | namespace ODbgRegisterView { 10 | 11 | bool entry_grid_key_event_filter(QWidget *parent, QObject *obj, QEvent *event); 12 | 13 | } 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/FpuValueField.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FPU_VALUE_FIELD_H_20191119_ 3 | #define FPU_VALUE_FIELD_H_20191119_ 4 | 5 | #include "ValueField.h" 6 | 7 | namespace ODbgRegisterView { 8 | 9 | #if defined(EDB_X86) || defined(EDB_X86_64) 10 | class FpuValueField final : public ValueField { 11 | Q_OBJECT 12 | 13 | private: 14 | int showAsRawActionIndex_; 15 | int showAsFloatActionIndex_; 16 | 17 | FieldWidget *commentWidget_; 18 | int row_; 19 | int column_; 20 | 21 | QPersistentModelIndex tagValueIndex_; 22 | 23 | bool groupDigits_ = false; 24 | 25 | public: 26 | // Will add itself and commentWidget to the group and renew their positions as needed 27 | FpuValueField(int fieldWidth, const QModelIndex ®ValueIndex, const QModelIndex &tagValueIndex, RegisterGroup *group, FieldWidget *commentWidget, int row, int column); 28 | 29 | public Q_SLOTS: 30 | void showFPUAsRaw(); 31 | void showFPUAsFloat(); 32 | void displayFormatChanged(); 33 | void updatePalette() override; 34 | }; 35 | #endif 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/MultiBitFieldWidget.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef MULTI_BIT_FIELD_WIDGET_H_20191119_ 3 | #define MULTI_BIT_FIELD_WIDGET_H_20191119_ 4 | 5 | #include "ValueField.h" 6 | 7 | namespace ODbgRegisterView { 8 | 9 | struct BitFieldDescription; 10 | 11 | class MultiBitFieldWidget final : public ValueField { 12 | Q_OBJECT 13 | 14 | public: 15 | MultiBitFieldWidget(const QModelIndex &index, const BitFieldDescription &bfd, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 16 | 17 | public Q_SLOTS: 18 | void setValue(int value); 19 | void adjustToData() override; 20 | 21 | private: 22 | QList valueActions_; 23 | std::function equal_; 24 | }; 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/NumberEdit.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "NumberEdit.h" 3 | #include "util/Font.h" 4 | #include 5 | 6 | namespace ODbgRegisterView { 7 | 8 | NumberEdit::NumberEdit(int column, int colSpan, QWidget *parent) 9 | : QLineEdit(parent), column_(column), colSpan_(colSpan) { 10 | } 11 | 12 | int NumberEdit::column() const { 13 | return column_; 14 | } 15 | 16 | int NumberEdit::colSpan() const { 17 | return colSpan_; 18 | } 19 | 20 | void NumberEdit::setNaturalWidthInChars(int nChars) { 21 | naturalWidthInChars_ = nChars; 22 | } 23 | 24 | QSize NumberEdit::minimumSizeHint() const { 25 | return sizeHint(); 26 | } 27 | 28 | QSize NumberEdit::sizeHint() const { 29 | 30 | const auto baseHint = QLineEdit::sizeHint(); 31 | // taking long enough reference char to make enough room even in presence of inner shadows like in Oxygen style 32 | const auto charWidth = Font::maxWidth(QFontMetrics(font())); 33 | const auto textMargins = this->textMargins(); 34 | const auto contentsMargins = this->contentsMargins(); 35 | int customWidth = charWidth * naturalWidthInChars_ + textMargins.left() + contentsMargins.left() + textMargins.right() + contentsMargins.right(); 36 | 37 | return QSize(customWidth, baseHint.height()).expandedTo(QApplication::globalStrut()); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/NumberEdit.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Ruslan Kabatsayev 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef NUMBER_EDIT_H_20190412_ 19 | #define NUMBER_EDIT_H_20190412_ 20 | 21 | #include 22 | 23 | namespace ODbgRegisterView { 24 | 25 | class NumberEdit final : public QLineEdit { 26 | Q_OBJECT 27 | public: 28 | NumberEdit(int column, int colSpan, QWidget *parent = nullptr); 29 | ~NumberEdit() override = default; 30 | 31 | public: 32 | [[nodiscard]] int column() const; 33 | [[nodiscard]] int colSpan() const; 34 | void setNaturalWidthInChars(int nChars); 35 | 36 | public: 37 | [[nodiscard]] QSize minimumSizeHint() const override; 38 | [[nodiscard]] QSize sizeHint() const override; 39 | 40 | private: 41 | int naturalWidthInChars_ = 17; // default roughly as in QLineEdit 42 | int column_; 43 | int colSpan_; 44 | }; 45 | 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/ODbgRV_Common.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Ruslan Kabatsayev 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef ODBG_REGISTER_VIEW_COMMON_H_20170817_ 19 | #define ODBG_REGISTER_VIEW_COMMON_H_20170817_ 20 | 21 | #include 22 | 23 | namespace ODbgRegisterView { 24 | 25 | constexpr Qt::Key SetToZeroKey = Qt::Key_Z; 26 | constexpr Qt::Key DecrementKey = Qt::Key_Minus; 27 | constexpr Qt::Key IncrementKey = Qt::Key_Plus; 28 | 29 | static constexpr const char *GprCategoryName = "General Purpose"; 30 | 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/RegisterGroup.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef REGISTER_GROUP_H_20191119_ 3 | #define REGISTER_GROUP_H_20191119_ 4 | 5 | #include 6 | 7 | namespace ODbgRegisterView { 8 | 9 | class SimdValueManager; 10 | class FieldWidget; 11 | class ValueField; 12 | class ODBRegView; 13 | 14 | class RegisterGroup : public QWidget { 15 | Q_OBJECT 16 | friend SimdValueManager; 17 | 18 | public: 19 | explicit RegisterGroup(const QString &name_, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 20 | 21 | public: 22 | [[nodiscard]] QList fields() const; 23 | [[nodiscard]] QList valueFields() const; 24 | [[nodiscard]] QMargins getFieldMargins() const; 25 | void appendNameValueComment(const QModelIndex &nameIndex, const QString &tooltip = "", bool insertComment = true); 26 | // Insert, but without moving to its place 27 | void insert(FieldWidget *widget); 28 | void insert(int line, int column, FieldWidget *widget); 29 | void setupPositionAndSize(int line, int column, FieldWidget *widget); 30 | void showMenu(const QPoint &position, const QList &additionalItems = {}) const; 31 | 32 | public Q_SLOTS: 33 | void adjustWidth(); 34 | 35 | protected: 36 | void mousePressEvent(QMouseEvent *event) override; 37 | 38 | private: 39 | [[nodiscard]] int lineAfterLastField() const; 40 | [[nodiscard]] ODBRegView *regView() const; 41 | 42 | private: 43 | QList menuItems_; 44 | QString name_; 45 | }; 46 | 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/VolatileNameField.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Ruslan Kabatsayev 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #include "VolatileNameField.h" 19 | 20 | namespace ODbgRegisterView { 21 | 22 | VolatileNameField::VolatileNameField(int fieldWidth, std::function valueFormatter, QWidget *parent, Qt::WindowFlags f) 23 | : FieldWidget(fieldWidth, "", parent, f), valueFormatter(std::move(valueFormatter)) { 24 | } 25 | 26 | QString VolatileNameField::text() const { 27 | return valueFormatter(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/VolatileNameField.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Ruslan Kabatsayev 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef VOLATILE_NAME_FIELD_H_20151031_ 19 | #define VOLATILE_NAME_FIELD_H_20151031_ 20 | 21 | #include "FieldWidget.h" 22 | #include 23 | #include 24 | 25 | namespace ODbgRegisterView { 26 | 27 | class VolatileNameField : public FieldWidget { 28 | Q_OBJECT 29 | 30 | private: 31 | std::function valueFormatter; 32 | 33 | public: 34 | VolatileNameField(int fieldWidth, std::function valueFormatter, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 35 | [[nodiscard]] QString text() const override; 36 | }; 37 | 38 | } 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/arch/arm-generic/armGroups.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2017 Ruslan Kabatsayev 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef ODBG_REGISTER_VIEW_ARM_GROUPS_H_20170819_ 19 | #define ODBG_REGISTER_VIEW_ARM_GROUPS_H_20170819_ 20 | 21 | #include "RegisterView.h" 22 | 23 | namespace ODbgRegisterView { 24 | 25 | RegisterGroup *createCPSR(RegisterViewModelBase::Model *model, QWidget *parent); 26 | RegisterGroup *createExpandedCPSR(RegisterViewModelBase::Model *model, QWidget *parent); 27 | RegisterGroup *createFPSCR(RegisterViewModelBase::Model *model, QWidget *parent); 28 | 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/arch/x86-generic/Float80Edit.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Ruslan Kabatsayev 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef FLOAT80_EDIT_H_20151031_ 19 | #define FLOAT80_EDIT_H_20151031_ 20 | 21 | #include "Types.h" 22 | #include 23 | 24 | namespace ODbgRegisterView { 25 | 26 | class Float80Edit : public QLineEdit { 27 | Q_OBJECT 28 | 29 | public: 30 | explicit Float80Edit(QWidget *parent = nullptr); 31 | void setValue(edb::value80 input); 32 | 33 | public: 34 | [[nodiscard]] QSize sizeHint() const override; 35 | 36 | protected: 37 | void focusOutEvent(QFocusEvent *e) override; 38 | 39 | Q_SIGNALS: 40 | void defocussed(); 41 | }; 42 | 43 | } 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /plugins/ODbgRegisterView/arch/x86-generic/ODbgRV_x86Common.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Ruslan Kabatsayev 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef X86_COMMON_H_20170817_ 19 | #define X86_COMMON_H_20170817_ 20 | 21 | static constexpr unsigned FpuTagEmpty = 3; 22 | 23 | static constexpr const char *FsrName = "FSR"; 24 | static constexpr const char *FcrName = "FCR"; 25 | static constexpr const char *FtrName = "FTR"; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /plugins/OpcodeSearcher/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "OpcodeSearcher") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | DialogOpcodes.cpp 14 | DialogOpcodes.h 15 | DialogOpcodes.ui 16 | DialogResults.cpp 17 | DialogResults.h 18 | DialogResults.ui 19 | OpcodeSearcher.cpp 20 | OpcodeSearcher.h 21 | ResultsModel.cpp 22 | ResultsModel.h 23 | ) 24 | 25 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 26 | 27 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 28 | 29 | target_add_warnings(${PLUGIN_NAME}) 30 | 31 | set_target_properties(${PLUGIN_NAME} 32 | PROPERTIES 33 | CXX_EXTENSIONS OFF 34 | CXX_STANDARD 17 35 | CXX_STANDARD_REQUIRED ON 36 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 37 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 38 | ) 39 | -------------------------------------------------------------------------------- /plugins/OpcodeSearcher/DialogOpcodes.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DIALOG_OPCODES_H_20061101_ 20 | #define DIALOG_OPCODES_H_20061101_ 21 | 22 | #include "ui_DialogOpcodes.h" 23 | #include 24 | 25 | class QSortFilterProxyModel; 26 | 27 | namespace OpcodeSearcherPlugin { 28 | 29 | class DialogResults; 30 | 31 | class DialogOpcodes : public QDialog { 32 | Q_OBJECT 33 | 34 | public: 35 | explicit DialogOpcodes(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 36 | ~DialogOpcodes() override = default; 37 | 38 | private: 39 | void doFind(); 40 | 41 | private: 42 | void showEvent(QShowEvent *event) override; 43 | 44 | private: 45 | Ui::DialogOpcodes ui; 46 | QSortFilterProxyModel *filterModel_ = nullptr; 47 | QPushButton *buttonFind_ = nullptr; 48 | }; 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /plugins/OpcodeSearcher/DialogResults.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef OPCODE_SEARCHER_DIALOG_RESULTS_H_20191119_ 3 | #define OPCODE_SEARCHER_DIALOG_RESULTS_H_20191119_ 4 | 5 | #include "ResultsModel.h" 6 | #include "ui_DialogResults.h" 7 | #include 8 | #include 9 | 10 | class QSortFilterProxyModel; 11 | 12 | namespace OpcodeSearcherPlugin { 13 | 14 | class DialogResults : public QDialog { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit DialogResults(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 19 | 20 | public: 21 | void addResult(const ResultsModel::Result &result); 22 | 23 | private Q_SLOTS: 24 | void on_tableView_doubleClicked(const QModelIndex &index); 25 | 26 | public: 27 | [[nodiscard]] int resultCount() const; 28 | 29 | private: 30 | Ui::DialogResults ui; 31 | ResultsModel *model_ = nullptr; 32 | QSortFilterProxyModel *filterModel_ = nullptr; 33 | }; 34 | 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /plugins/ProcessProperties/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "ProcessProperties") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets Network) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | DialogProcessProperties.cpp 14 | DialogProcessProperties.h 15 | DialogProcessProperties.ui 16 | DialogStrings.cpp 17 | DialogStrings.h 18 | DialogStrings.ui 19 | ProcessProperties.cpp 20 | ProcessProperties.h 21 | DialogResults.cpp 22 | DialogResults.h 23 | DialogResults.ui 24 | ResultsModel.cpp 25 | ResultsModel.h 26 | ) 27 | 28 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets Qt5::Network edb) 29 | 30 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 31 | 32 | target_add_warnings(${PLUGIN_NAME}) 33 | 34 | set_target_properties(${PLUGIN_NAME} 35 | PROPERTIES 36 | CXX_EXTENSIONS OFF 37 | CXX_STANDARD 17 38 | CXX_STANDARD_REQUIRED ON 39 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 40 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 41 | ) 42 | -------------------------------------------------------------------------------- /plugins/ProcessProperties/DialogResults.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef PROCESS_PROPERTIES_DIALOG_RESULTS_H_20191119_ 3 | #define PROCESS_PROPERTIES_DIALOG_RESULTS_H_20191119_ 4 | 5 | #include "ResultsModel.h" 6 | #include "ui_DialogResults.h" 7 | #include 8 | #include 9 | 10 | class QSortFilterProxyModel; 11 | 12 | namespace ProcessPropertiesPlugin { 13 | 14 | class DialogResults : public QDialog { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit DialogResults(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 19 | 20 | public: 21 | void addResult(const ResultsModel::Result &result); 22 | 23 | private Q_SLOTS: 24 | void on_tableView_doubleClicked(const QModelIndex &index); 25 | 26 | public: 27 | [[nodiscard]] int resultCount() const; 28 | 29 | private: 30 | Ui::DialogResults ui; 31 | ResultsModel *model_ = nullptr; 32 | QSortFilterProxyModel *filterModel_ = nullptr; 33 | }; 34 | 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /plugins/ROPTool/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "ROPTool") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | DialogROPTool.cpp 14 | DialogROPTool.h 15 | DialogROPTool.ui 16 | ROPTool.cpp 17 | ROPTool.h 18 | DialogResults.ui 19 | DialogResults.cpp 20 | DialogResults.h 21 | ResultsModel.cpp 22 | ResultsModel.h 23 | ) 24 | 25 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 26 | 27 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 28 | 29 | target_add_warnings(${PLUGIN_NAME}) 30 | 31 | set_target_properties(${PLUGIN_NAME} 32 | PROPERTIES 33 | CXX_EXTENSIONS OFF 34 | CXX_STANDARD 17 35 | CXX_STANDARD_REQUIRED ON 36 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 37 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 38 | ) 39 | -------------------------------------------------------------------------------- /plugins/ROPTool/ROPTool.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | #ifndef ROPTOOL_H_20100817_ 19 | #define ROPTOOL_H_20100817_ 20 | 21 | #include "IPlugin.h" 22 | 23 | class QMenu; 24 | class QDialog; 25 | 26 | namespace ROPToolPlugin { 27 | 28 | class ROPTool : public QObject, public IPlugin { 29 | Q_OBJECT 30 | Q_INTERFACES(IPlugin) 31 | Q_PLUGIN_METADATA(IID "edb.IPlugin/1.0") 32 | Q_CLASSINFO("author", "Evan Teran") 33 | Q_CLASSINFO("url", "http://www.codef00.com") 34 | 35 | public: 36 | explicit ROPTool(QObject *parent = nullptr); 37 | ~ROPTool() override; 38 | 39 | public: 40 | [[nodiscard]] QMenu *menu(QWidget *parent = nullptr) override; 41 | 42 | public Q_SLOTS: 43 | void showMenu(); 44 | 45 | private: 46 | QMenu *menu_ = nullptr; 47 | QPointer dialog_; 48 | }; 49 | 50 | } 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /plugins/References/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "References") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | DialogReferences.cpp 14 | DialogReferences.h 15 | DialogReferences.ui 16 | References.cpp 17 | References.h 18 | ) 19 | 20 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 21 | 22 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 23 | 24 | target_add_warnings(${PLUGIN_NAME}) 25 | 26 | set_target_properties(${PLUGIN_NAME} 27 | PROPERTIES 28 | CXX_EXTENSIONS OFF 29 | CXX_STANDARD 17 30 | CXX_STANDARD_REQUIRED ON 31 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 32 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 33 | ) 34 | -------------------------------------------------------------------------------- /plugins/References/References.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef REFERENCES_H_20060430_ 20 | #define REFERENCES_H_20060430_ 21 | 22 | #include "IPlugin.h" 23 | 24 | class QMenu; 25 | class QDialog; 26 | 27 | namespace ReferencesPlugin { 28 | 29 | class References : public QObject, public IPlugin { 30 | Q_OBJECT 31 | Q_INTERFACES(IPlugin) 32 | Q_PLUGIN_METADATA(IID "edb.IPlugin/1.0") 33 | Q_CLASSINFO("author", "Evan Teran") 34 | Q_CLASSINFO("url", "http://www.codef00.com") 35 | 36 | public: 37 | explicit References(QObject *parent = nullptr); 38 | ~References() override; 39 | 40 | public: 41 | [[nodiscard]] QMenu *menu(QWidget *parent = nullptr) override; 42 | 43 | public Q_SLOTS: 44 | void showMenu(); 45 | 46 | private: 47 | QMenu *menu_ = nullptr; 48 | QPointer dialog_; 49 | }; 50 | 51 | } 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /plugins/SymbolViewer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | include("GNUInstallDirs") 3 | 4 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 5 | set(CMAKE_AUTOMOC ON) 6 | set(CMAKE_AUTOUIC ON) 7 | 8 | set(PLUGIN_NAME "SymbolViewer") 9 | 10 | find_package(Qt5 5.0.0 REQUIRED Widgets) 11 | 12 | add_library(${PLUGIN_NAME} SHARED 13 | DialogSymbolViewer.cpp 14 | DialogSymbolViewer.h 15 | DialogSymbolViewer.ui 16 | SymbolViewer.cpp 17 | SymbolViewer.h 18 | ) 19 | 20 | target_link_libraries(${PLUGIN_NAME} Qt5::Widgets edb) 21 | 22 | install (TARGETS ${PLUGIN_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb) 23 | 24 | target_add_warnings(${PLUGIN_NAME}) 25 | 26 | set_target_properties(${PLUGIN_NAME} 27 | PROPERTIES 28 | CXX_EXTENSIONS OFF 29 | CXX_STANDARD 17 30 | CXX_STANDARD_REQUIRED ON 31 | LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 32 | RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR} 33 | ) 34 | -------------------------------------------------------------------------------- /src/CommentServer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef COMMENT_SERVER_H_20070427_ 20 | #define COMMENT_SERVER_H_20070427_ 21 | 22 | #include "Status.h" 23 | #include "Types.h" 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | class CommentServer { 30 | Q_DECLARE_TR_FUNCTIONS(CommentServer) 31 | public: 32 | [[nodiscard]] QString comment(edb::address_t address, int size) const; 33 | void clear(); 34 | void setComment(edb::address_t address, const QString &comment); 35 | 36 | private: 37 | [[nodiscard]] Result resolveFunctionCall(edb::address_t address) const; 38 | [[nodiscard]] Result resolveString(edb::address_t address) const; 39 | 40 | private: 41 | QHash customComments_; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/DataViewInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DATA_VIEW_INFO_H_20100101_ 20 | #define DATA_VIEW_INFO_H_20100101_ 21 | 22 | #include 23 | #include 24 | 25 | class QHexView; 26 | class RegionBuffer; 27 | class IRegion; 28 | 29 | class DataViewInfo { 30 | public: 31 | explicit DataViewInfo(const std::shared_ptr &r); 32 | DataViewInfo(); 33 | DataViewInfo(const DataViewInfo &) = delete; 34 | DataViewInfo &operator=(const DataViewInfo &) = delete; 35 | ~DataViewInfo() = default; 36 | 37 | public: 38 | std::shared_ptr region; 39 | std::shared_ptr view; 40 | std::unique_ptr stream; 41 | 42 | public: 43 | void update(); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/DebuggerInternal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DEBUGGER_INTERNAL_H_20100301_ 20 | #define DEBUGGER_INTERNAL_H_20100301_ 21 | 22 | class QString; 23 | class QObject; 24 | 25 | // these are global utility functions which are not part of the exported API 26 | 27 | namespace edb::internal { 28 | 29 | bool register_plugin(const QString &filename, QObject *plugin); 30 | void load_function_db(); 31 | 32 | } 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/DialogAbout.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include "DialogAbout.h" 20 | #include "version.h" 21 | 22 | //------------------------------------------------------------------------------ 23 | // Name: DialogAbout 24 | // Desc: constructor 25 | //------------------------------------------------------------------------------ 26 | DialogAbout::DialogAbout(QWidget *parent, Qt::WindowFlags f) 27 | : QDialog(parent, f) { 28 | ui.setupUi(this); 29 | ui.labelVersion->setText(tr("Version: %1
\n" 30 | "Compiled: %2
\n" 31 | "Git Commit: %3") 32 | .arg(EDB_VERSION_STRING, __DATE__, GIT_BRANCH)); 33 | } 34 | -------------------------------------------------------------------------------- /src/DialogAbout.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DIALOG_ABOUT_H_20150802_ 20 | #define DIALOG_ABOUT_H_20150802_ 21 | 22 | #include "ui_DialogAbout.h" 23 | #include 24 | 25 | class DialogAbout final : public QDialog { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit DialogAbout(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 30 | ~DialogAbout() override = default; 31 | 32 | private: 33 | Ui::DialogAbout ui; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/DialogArguments.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DIALOG_ARGUMENTS_H_20090609_ 20 | #define DIALOG_ARGUMENTS_H_20090609_ 21 | 22 | #include "ui_DialogArguments.h" 23 | #include 24 | 25 | class DialogArguments : public QDialog { 26 | Q_OBJECT 27 | 28 | public: 29 | explicit DialogArguments(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 30 | ~DialogArguments() override = default; 31 | 32 | public: 33 | [[nodiscard]] QList arguments() const; 34 | void setArguments(const QList &args); 35 | 36 | private: 37 | Ui::DialogArguments ui; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/DialogInputBinaryString.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include "DialogInputBinaryString.h" 20 | 21 | //------------------------------------------------------------------------------ 22 | // Name: DialogInputBinaryString 23 | // Desc: constructor 24 | //------------------------------------------------------------------------------ 25 | DialogInputBinaryString::DialogInputBinaryString(QWidget *parent, Qt::WindowFlags f) 26 | : QDialog(parent, f) { 27 | 28 | ui.setupUi(this); 29 | } 30 | 31 | //------------------------------------------------------------------------------ 32 | // Name: binary_string 33 | // Desc: returns the binary string we wrap around 34 | //------------------------------------------------------------------------------ 35 | BinaryString *DialogInputBinaryString::binaryString() const { 36 | return ui.binaryString; 37 | } 38 | -------------------------------------------------------------------------------- /src/DialogInputBinaryString.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DIALOG_INPUT_BINARY_STRING_H_20061127_ 20 | #define DIALOG_INPUT_BINARY_STRING_H_20061127_ 21 | 22 | #include 23 | 24 | #include "ui_DialogInputBinaryString.h" 25 | 26 | class BinaryString; 27 | 28 | class DialogInputBinaryString : public QDialog { 29 | Q_OBJECT 30 | 31 | public: 32 | explicit DialogInputBinaryString(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 33 | ~DialogInputBinaryString() override = default; 34 | 35 | public: 36 | [[nodiscard]] BinaryString *binaryString() const; 37 | 38 | private: 39 | Ui::DialogInputBinaryString ui; 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/DialogOpenProgram.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 Ruslan Kabatsayev 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 2 of the License, or 7 | (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . 16 | */ 17 | 18 | #ifndef DIALOG_OPEN_PROGRAM_H_20151117_ 19 | #define DIALOG_OPEN_PROGRAM_H_20151117_ 20 | 21 | #include 22 | #include 23 | 24 | class QLineEdit; 25 | class QByteArray; 26 | 27 | class DialogOpenProgram : public QFileDialog { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit DialogOpenProgram(QWidget *parent = nullptr, const QString &caption = QString(), const QString &directory = QString(), const QString &filter = QString()); 32 | 33 | public: 34 | [[nodiscard]] QList arguments() const; 35 | [[nodiscard]] QString workingDirectory() const; 36 | 37 | private Q_SLOTS: 38 | void browsePressed(); 39 | 40 | private: 41 | QLineEdit *argsEdit_; 42 | QLineEdit *workDir_; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /src/DialogThreads.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef DIALOG_THREADS_H_20101026_ 20 | #define DIALOG_THREADS_H_20101026_ 21 | 22 | #include 23 | 24 | #include "ui_DialogThreads.h" 25 | 26 | class ThreadsModel; 27 | class QSortFilterProxyModel; 28 | class QModelIndex; 29 | 30 | class DialogThreads : public QDialog { 31 | Q_OBJECT 32 | public: 33 | DialogThreads(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 34 | ~DialogThreads() override = default; 35 | 36 | private Q_SLOTS: 37 | void on_thread_table_doubleClicked(const QModelIndex &index); 38 | void updateThreads(); 39 | 40 | public: 41 | void showEvent(QShowEvent *) override; 42 | 43 | private: 44 | Ui::DialogThreads ui; 45 | ThreadsModel *threadsModel_ = nullptr; 46 | QSortFilterProxyModel *threadsFilter_ = nullptr; 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/FixedFontSelector.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | FixedFontSelector 4 | 5 | 6 | 7 | 0 8 | 0 9 | 306 10 | 24 11 | 12 | 13 | 14 | 15 | 0 16 | 17 | 18 | 19 | 20 | 21 | 0 22 | 0 23 | 24 | 25 | 26 | false 27 | 28 | 29 | QFontComboBox::MonospacedFonts 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/Font.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "util/Font.h" 3 | #include 4 | #include 5 | 6 | namespace Font { 7 | 8 | QFont fromString(const QString &fontName) { 9 | QFont font; 10 | font.fromString(fontName); 11 | font.setStyleName(QString()); 12 | #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) 13 | font.setStyleStrategy(QFont::ForceIntegerMetrics); 14 | #endif 15 | return font; 16 | } 17 | 18 | int maxWidth(const QFontMetrics &fm) { 19 | return Font::characterWidth(fm, QLatin1Char('X')); 20 | } 21 | 22 | int characterWidth(const QFontMetrics &fm, QChar ch) { 23 | #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) 24 | return fm.horizontalAdvance(ch); 25 | #else 26 | return fm.width(ch); 27 | #endif 28 | } 29 | 30 | int stringWidth(const QFontMetrics &fm, const QString &s) { 31 | #if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) 32 | return fm.horizontalAdvance(s); 33 | #else 34 | return fm.width(s); 35 | #endif 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/LongDoubleX86.asm: -------------------------------------------------------------------------------- 1 | PUBLIC long_double_to_double 2 | PUBLIC float64_to_float80 3 | 4 | ALIAS <@long_double_to_double@8> = 5 | ALIAS <@float64_to_float80@8> = 6 | 7 | IFDEF EDB_X86 8 | 9 | .386 10 | 11 | _TEXT SEGMENT 12 | 13 | long_double_to_double PROC NEAR; FASTCALL 14 | fld TBYTE PTR [ecx] 15 | fstp QWORD PTR [edx] 16 | ret 17 | long_double_to_double ENDP 18 | 19 | float64_to_float80 PROC NEAR; FASTCALL 20 | fld QWORD PTR [ecx] 21 | fstp TBYTE PTR [edx] 22 | ret 23 | float64_to_float80 ENDP 24 | 25 | _TEXT ENDS 26 | 27 | ELSE 28 | 29 | _TEXT SEGMENT 30 | 31 | long_double_to_double PROC 32 | fld TBYTE PTR [rcx] 33 | fstp QWORD PTR [rdx] 34 | ret 35 | long_double_to_double ENDP 36 | 37 | float64_to_float80 PROC 38 | fld QWORD PTR [rcx] 39 | fstp TBYTE PTR [rdx] 40 | ret 41 | float64_to_float80 ENDP 42 | 43 | _TEXT ENDS 44 | 45 | ENDIF 46 | 47 | END 48 | -------------------------------------------------------------------------------- /src/capstone-edb/include/Formatter.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FORMATTER_H_20191119_ 3 | #define FORMATTER_H_20191119_ 4 | 5 | #include "API.h" 6 | #include 7 | class QString; 8 | 9 | namespace CapstoneEDB { 10 | 11 | class Operand; 12 | class Instruction; 13 | 14 | class EDB_EXPORT Formatter { 15 | public: 16 | enum Syntax { 17 | SyntaxIntel, 18 | SyntaxAtt 19 | }; 20 | 21 | enum Capitalization { 22 | UpperCase, 23 | LowerCase 24 | }; 25 | 26 | struct FormatOptions { 27 | Syntax syntax; 28 | Capitalization capitalization; 29 | bool tabBetweenMnemonicAndOperands; 30 | bool simplifyRIPRelativeTargets; 31 | }; 32 | 33 | public: 34 | [[nodiscard]] std::string toString(const Instruction &insn) const; 35 | [[nodiscard]] std::string toString(const Operand &operand) const; 36 | [[nodiscard]] std::string registerName(unsigned int reg) const; 37 | 38 | [[nodiscard]] FormatOptions options() const { 39 | return options_; 40 | } 41 | 42 | void setOptions(const FormatOptions &options); 43 | 44 | private: 45 | void checkCapitalize(std::string &str, bool canContainHex = true) const; 46 | [[nodiscard]] QString adjustInstructionText(const Instruction &insn) const; 47 | 48 | private: 49 | FormatOptions options_ = {SyntaxIntel, LowerCase, false, true}; 50 | }; 51 | 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/graph/GraphicsScene.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef GRAPHICS_SCENE_H_20191119_ 20 | #define GRAPHICS_SCENE_H_20191119_ 21 | 22 | #include 23 | 24 | class GraphicsScene : public QGraphicsScene { 25 | Q_OBJECT 26 | public: 27 | explicit GraphicsScene(QObject *parent = nullptr); 28 | explicit GraphicsScene(const QRectF &sceneRect, QObject *parent = nullptr); 29 | GraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject *parent = nullptr); 30 | ~GraphicsScene() override = default; 31 | 32 | Q_SIGNALS: 33 | void itemHelpEvent(QGraphicsSceneHelpEvent *helpEvent, QGraphicsItem *item); 34 | 35 | protected: 36 | void helpEvent(QGraphicsSceneHelpEvent *helpEvent) override; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/graph/GraphvizHelper.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "GraphvizHelper.h" 3 | 4 | Agnode_t *_agnode(Agraph_t *g, QString name) { 5 | return agnode(g, name.toLocal8Bit().data(), true); 6 | } 7 | 8 | /// Directly use agsafeset which always works, contrarily to agset 9 | int _agset(void *object, QString attr, QString value) { 10 | return agsafeset( 11 | object, 12 | attr.toLocal8Bit().data(), 13 | value.toLocal8Bit().data(), 14 | value.toLocal8Bit().data()); 15 | } 16 | 17 | Agraph_t *_agopen(QString name, Agdesc_t kind) { 18 | return agopen(name.toLocal8Bit().data(), kind, nullptr); 19 | } 20 | 21 | /// Add an alternative value parameter to the method for getting an object's attribute 22 | QString _agget(void *object, QString attr, QString alt) { 23 | QString str = agget(object, attr.toLocal8Bit().data()); 24 | 25 | // TODO(eteran): use isNull()? 26 | if (str == QString()) { 27 | return alt; 28 | } 29 | 30 | return str; 31 | } 32 | 33 | Agsym_t *_agnodeattr(Agraph_t *g, QString name, QString value) { 34 | return agattr( 35 | g, 36 | AGNODE, 37 | name.toLocal8Bit().data(), 38 | value.toLocal8Bit().data()); 39 | } 40 | 41 | Agsym_t *_agedgeattr(Agraph_t *g, QString name, QString value) { 42 | return agattr( 43 | g, 44 | AGEDGE, 45 | name.toLocal8Bit().data(), 46 | value.toLocal8Bit().data()); 47 | } 48 | -------------------------------------------------------------------------------- /src/graph/GraphvizHelper.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef GRAPHVIZ_HELPER_H_20190412_ 3 | #define GRAPHVIZ_HELPER_H_20190412_ 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | Agnode_t *_agnode(Agraph_t *g, QString name); 10 | int _agset(void *object, QString attr, QString value); 11 | Agsym_t *_agnodeattr(Agraph_t *g, QString name, QString value); 12 | Agsym_t *_agedgeattr(Agraph_t *g, QString name, QString value); 13 | QString _agget(void *object, QString attr, QString alt = QString()); 14 | Agraph_t *_agopen(QString name, Agdesc_t kind); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/res/debugger.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | images/edb100-logo.png 4 | images/edb48-logo.png 5 | images/edb.svg 6 | xml/functions.xml 7 | xml/syscalls.xml 8 | images/arrow-right.svg 9 | images/arrow-right-red.svg 10 | images/breakpoint.svg 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/res/edb.rc: -------------------------------------------------------------------------------- 1 | IDI_MAIN ICON "images\\edb.ico" 2 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/application-exit.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/code-context.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/configure.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/dialog-close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/dialog-information.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/document-export.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/document-import.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/document-open-recent.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/document-open.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/edit-clear-list.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/edit-find.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/edit-undo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/help-about.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/help-contents.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/list-add.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/list-remove.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/tab-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-dark-edb/16x16/tab-close.png -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/tab-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-dark-edb/16x16/tab-new.png -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/16x16/view-restore.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/24x24/dialog-information.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/64x64/debug-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-dark-edb/64x64/debug-close.png -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/64x64/debug-kill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-dark-edb/64x64/debug-kill.png -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/64x64/debug-pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-dark-edb/64x64/debug-pause.png -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/64x64/debug-restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-dark-edb/64x64/debug-restart.png -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/64x64/debug-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-dark-edb/64x64/debug-run.png -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/64x64/debug-step-into.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-dark-edb/64x64/debug-step-into.png -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/64x64/debug-step-out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-dark-edb/64x64/debug-step-out.png -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/64x64/debug-step-over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-dark-edb/64x64/debug-step-over.png -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/64x64/memory-slot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-dark-edb/64x64/memory-slot.png -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/64x64/plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-dark-edb/64x64/plugin.png -------------------------------------------------------------------------------- /src/res/icons/breeze-dark-edb/index.theme: -------------------------------------------------------------------------------- 1 | [Icon Theme] 2 | Name=Breeze Dark edb 3 | Comment=Breeze Dark Icon Theme for edb 4 | Inherits=breeze-dark 5 | Directories=16x16,24x24,64x64 6 | 7 | [16x16] 8 | Size=16 9 | 10 | [24x24] 11 | Size=24 12 | 13 | [64x64] 14 | Size=64 15 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/application-exit.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/code-context.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/configure.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/dialog-close.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/dialog-information.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/document-export.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/document-import.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/document-open-recent.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/document-open.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/edit-clear-list.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/edit-find.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/edit-undo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/help-about.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/help-contents.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 14 | 15 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/list-add.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/list-remove.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/tab-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-edb/16x16/tab-close.png -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/tab-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-edb/16x16/tab-new.png -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/16x16/view-restore.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/24x24/dialog-information.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/64x64/debug-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-edb/64x64/debug-close.png -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/64x64/debug-kill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-edb/64x64/debug-kill.png -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/64x64/debug-pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-edb/64x64/debug-pause.png -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/64x64/debug-restart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-edb/64x64/debug-restart.png -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/64x64/debug-run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-edb/64x64/debug-run.png -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/64x64/debug-step-into.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-edb/64x64/debug-step-into.png -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/64x64/debug-step-out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-edb/64x64/debug-step-out.png -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/64x64/debug-step-over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-edb/64x64/debug-step-over.png -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/64x64/memory-slot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-edb/64x64/memory-slot.png -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/64x64/plugin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/icons/breeze-edb/64x64/plugin.png -------------------------------------------------------------------------------- /src/res/icons/breeze-edb/index.theme: -------------------------------------------------------------------------------- 1 | [Icon Theme] 2 | Name=Breeze edb 3 | Comment=Breeze Icon Theme for edb 4 | Inherits=breeze 5 | Directories=16x16,24x24,64x64 6 | 7 | [16x16] 8 | Size=16 9 | 10 | [24x24] 11 | Size=24 12 | 13 | [64x64] 14 | Size=64 15 | -------------------------------------------------------------------------------- /src/res/icons/edb/index.theme: -------------------------------------------------------------------------------- 1 | [Icon Theme] 2 | Name=edb Theme 3 | Comment=Icon Theme for edb 4 | Inherits=breeze-edb 5 | Directories=16x16,24x24,64x64 6 | 7 | [16x16] 8 | Size=16 9 | 10 | [24x24] 11 | Size=24 12 | 13 | [64x64] 14 | Size=64 15 | -------------------------------------------------------------------------------- /src/res/images/arrow-right-red.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/res/images/arrow-right.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/res/images/breakpoint.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/res/images/edb.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/images/edb.ico -------------------------------------------------------------------------------- /src/res/images/edb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/images/edb.png -------------------------------------------------------------------------------- /src/res/images/edb100-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/images/edb100-logo.png -------------------------------------------------------------------------------- /src/res/images/edb48-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/images/edb48-logo.png -------------------------------------------------------------------------------- /src/res/themes.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | themes/system-light.ini 4 | themes/system-dark.ini 5 | themes/dark.ini 6 | themes/light.ini 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/res/translations/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eteran/edb-debugger/eedd97a0c1dbdfde50f1c1ab617d5fd9e25049d9/src/res/translations/.gitkeep -------------------------------------------------------------------------------- /src/session/SessionError.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #include "SessionError.h" 20 | -------------------------------------------------------------------------------- /src/session/SessionError.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2014 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef SESSION_ERROR_H_20170929_ 20 | #define SESSION_ERROR_H_20170929_ 21 | 22 | #include 23 | 24 | class SessionError { 25 | public: 26 | enum ErrorCode { 27 | NoError = 0, 28 | UnknownError = 1, 29 | NotAnObject = 2, 30 | InvalidSessionFile = 3, 31 | }; 32 | 33 | public: 34 | ErrorCode err = NoError; 35 | QString message; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.15) 2 | 3 | add_executable(ValueTest 4 | Test.cpp 5 | ) 6 | 7 | target_link_libraries(ValueTest 8 | edb 9 | ) 10 | 11 | set_property(TARGET ValueTest PROPERTY RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") 12 | set_property(TARGET ValueTest PROPERTY CXX_STANDARD 17) 13 | set_property(TARGET ValueTest PROPERTY CXX_STANDARD_REQUIRED ON) 14 | 15 | add_test( 16 | NAME ValueTest 17 | COMMAND $ 18 | ) 19 | -------------------------------------------------------------------------------- /src/widgets/NavigationHistory.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2017 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef NAVIGATION_HISTORY_H_20191119_ 20 | #define NAVIGATION_HISTORY_H_20191119_ 21 | 22 | #include "edb.h" 23 | 24 | #include 25 | 26 | class NavigationHistory { 27 | enum class LastOp { 28 | None = 0, 29 | Prev, 30 | Next 31 | }; 32 | 33 | public: 34 | explicit NavigationHistory(int count = 100); 35 | void add(edb::address_t address); 36 | [[nodiscard]] edb::address_t getNext(); 37 | [[nodiscard]] edb::address_t getPrev(); 38 | 39 | private: 40 | QList list_; 41 | int pos_ = 0; 42 | int maxCount_; 43 | LastOp lastOp_ = LastOp::None; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/widgets/TabWidget.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 - 2023 Evan Teran 3 | evan.teran@gmail.com 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 2 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . 17 | */ 18 | 19 | #ifndef TAB_WIDGET_H_20080118_ 20 | #define TAB_WIDGET_H_20080118_ 21 | 22 | #include 23 | 24 | class TabWidget : public QTabWidget { 25 | Q_OBJECT 26 | 27 | public: 28 | explicit TabWidget(QWidget *parent = nullptr); 29 | ~TabWidget() override = default; 30 | 31 | Q_SIGNALS: 32 | void customContextMenuRequested(int, const QPoint &); 33 | 34 | public: 35 | void setData(int index, const QVariant &data); 36 | [[nodiscard]] QVariant data(int index) const; 37 | 38 | protected: 39 | void mousePressEvent(QMouseEvent *event) override; 40 | }; 41 | 42 | #endif 43 | --------------------------------------------------------------------------------