language
stringlengths
0
24
filename
stringlengths
9
214
code
stringlengths
99
9.93M
x64dbg-development/setupdeps.bat
@echo off git submodule update --init --recursive mkdir bin\x32 xcopy deps\x32 bin\x32 /S /Y mkdir bin\x64 xcopy deps\x64 bin\x64 /S /Y mkdir bin\x32d xcopy deps\x32 bin\x32d /S /Y xcopy deps\x32d bin\x32d /S /Y mkdir bin\x64d xcopy deps\x64 bin\x64d /S /Y xcopy deps\x64d bin\x64d /S /Y
Visual Studio Solution
x64dbg-development/x64dbg.sln
Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 VisualStudioVersion = 12.0.40629.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x64dbg_exe", "src\exe\x64dbg_exe.vcxproj", "{3A22175E-6B72-FDCC-1603-C4A2163C7900}" ProjectSection(ProjectDe...
Markdown
x64dbg-development/.github/CODE_OF_CONDUCT.md
# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender...
Markdown
x64dbg-development/.github/CONTRIBUTING.md
# Contributing Welcome to x64dbg! This document is relevant for you if you want to contribute to the project. If you just want to use x64dbg, go to the [website](https://x64dbg.com) instead. ## Overview This is a list of things you can do to help us out (in no particular order). Each item will be expanded upon later...
YAML
x64dbg-development/.github/FUNDING.yml
# These are supported funding model platforms github: [mrexodia] #patreon: # Replace with a single Patreon username #open_collective: # Replace with a single Open Collective username #ko_fi: # Replace with a single Ko-fi username #tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel #c...
YAML
x64dbg-development/.github/ISSUE_TEMPLATE/bug_report.yaml
name: Bug report description: Issues and bugs for x64dbg. labels: - bug - pending reproduction body: - type: markdown attributes: value: Before filing this bug, [please check if it hasn't already been reported](https://github.com/x64dbg/x64dbg/issues?q=is%3Aissue+label%3Abug). If it has, please add useful infor...
YAML
x64dbg-development/.github/ISSUE_TEMPLATE/feature_request.yaml
name: Feature request description: Request a new feature to be added to x64dbg. labels: - feature body: - type: markdown attributes: value: Before filing this request, [please check if it hasn't already been suggested before](https://github.com/x64dbg/x64dbg/issues?q=is%3Aissue+label%3Afeature). If it has, pleas...
Text
x64dbg-development/bin/errordb.txt
0 ERROR_SUCCESS 1 ERROR_INVALID_FUNCTION 2 ERROR_FILE_NOT_FOUND 3 ERROR_PATH_NOT_FOUND 4 ERROR_TOO_MANY_OPEN_FILES 5 ERROR_ACCESS_DENIED 6 ERROR_INVALID_HANDLE 7 ERROR_ARENA_TRASHED 8 ERROR_NOT_ENOUGH_MEMORY 9 ERROR_INVALID_BLOCK 10 ERROR_BAD_ENVIRONMENT 11 ERROR_BAD_FORMAT 12 ERROR_INVALID_ACCESS 13 ERROR_INVALID_DATA...
Text
x64dbg-development/bin/exceptiondb.txt
0x04242420 CLRDBG_NOTIFICATION_EXCEPTION_CODE 0x40000005 STATUS_SEGMENT_NOTIFICATION 0x40000015 STATUS_FATAL_APP_EXIT 0x4000001C STATUS_WX86_UNSIMULATE 0x4000001D STATUS_WX86_CONTINUE 0x4000001E STATUS_WX86_SINGLE_STEP 0x4000001F STATUS_WX86_BREAKPOINT 0x40000020 STATUS_WX86_EXCEPTION_CONTINUE 0x40000021 STATUS_WX86_EX...
JSON
x64dbg-development/bin/mnemdb.json
{ "__github_x86-64": "https://github.com/nologic/idaref/blob/master/x86-64.sql", "__license_x86-64": "GPLv2", "_github_x86-64-brief": "https://github.com/radareorg/radare2/blob/c4d416c7b96d2735c24a2f9e2787df3fdb764c71/libr/asm/d/x86.sdb.txt", "_license_x86-64-brief": "GPLv3", "x86-64": [ { "desc...
Text
x64dbg-development/bin/ntstatusdb.txt
0x00000000 STATUS_SUCCESS 0x00000001 STATUS_WAIT_1 0x00000002 STATUS_WAIT_2 0x00000003 STATUS_WAIT_3 0x0000003F STATUS_WAIT_63 0x00000080 STATUS_ABANDONED 0x000000BF STATUS_ABANDONED_WAIT_63 0x000000C0 STATUS_USER_APC 0x000000FF STATUS_ALREADY_COMPLETE 0x00000100 STATUS_KERNEL_APC 0x00000101 STATUS_ALERTED 0x00000102 S...
Text
x64dbg-development/bin/winconstants.txt
0x0000 WM_NULL 0x0001 WM_CREATE 0x0002 WM_DESTROY 0x0003 WM_MOVE 0x0005 WM_SIZE 0x0006 WM_ACTIVATE 0x0007 WM_SETFOCUS 0x0008 WM_KILLFOCUS 0x000A WM_ENABLE 0x000B WM_SETREDRAW 0x000C WM_SETTEXT 0x000D WM_GETTEXT 0x000E WM_GETTEXTLENGTH 0x000F WM_PAINT 0x0010 WM_CLOSE 0x0011 WM_QUERYENDSESSION 0x0012 WM_QUIT 0x0013 WM_QU...
x64dbg-development/bin/x64dbg_shell_remove.reg
Windows Registry Editor Version 5.00 [-HKEY_CLASSES_ROOT\exefile\shell\Debug with x64_dbg] [-HKEY_CLASSES_ROOT\dllfile\shell\Debug with x64_dbg] [-HKEY_CLASSES_ROOT\exefile\shell\Debug with x64dbg] [-HKEY_CLASSES_ROOT\dllfile\shell\Debug with x64dbg]
x64dbg-development/bin/themes/Dark/index.theme
[Icon Theme] Name=Dark Comment=Dark icon theme Directories=icons Inherits=Default [icons] Size=16 Type=Scalable
x64dbg-development/bin/themes/Dark/style.css
/* Based on: https://github.com/radareorg/cutter/blob/48b84bfa5c7fd7c7aa8595b8f742c9d8081d09fc/src/themes/qdarkstyle/style.qss */ /* Modified for x64dbg by JustMagic: https://github.com/JustasMasiulis */ /* Use 'url(./xxxx)' for resources, it will be replaced with the right path at runtime */ ShortcutEdit[error="true"...
INI Configuration
x64dbg-development/bin/themes/Dark/style.ini
[Colors] AbstractTableViewBackgroundColor=#212121 AbstractTableViewHeaderTextColor=#E0E0E0 AbstractTableViewSelectionColor=#414141 AbstractTableViewSeparatorColor=#717171 AbstractTableViewTextColor=#E0E0E0 BackgroundFlickerColor=#EF5350 BreakpointSummaryKeywordColor=#89A2F6 BreakpointSummaryParenColor=#E0E0E0 Breakpoin...
x64dbg-development/hooks/AStyleHelper.exe.config
<?xml version="1.0"?> <configuration> <configSections> <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <section name="AStyleHelper.Properties.Settings" type="System.Configuration.Client...
x64dbg-development/hooks/pre-commit
#!/bin/sh # # Simple script to auto-format every source file before committing. # #check if the formatter is present if [ ! -f ./hooks/AStyleHelper.exe ]; then echo "AStyleHelper not found!" exit 0 fi #format the code "./hooks/AStyleHelper.exe" Silent #exit when nothing needs to be done if [ $? == 0 ]; then ...
Markdown
x64dbg-development/hooks/README.md
# Hooks This contains two binaries `AStyleHelper.exe` and `AStyle.dll` to format any code before you commit. If you are unsure about the integrity of the files, don't hesitate to contact me (mrexodia). The source code is available [here](https://github.com/mrexodia/AStyleHelper). The version of `AStyle.dll` is compil...
C/C++
x64dbg-development/src/dbg_assert.h
/** * Code originally from: * * (c) 2015 Alexandro Sanchez Bach. All rights reserved. * https://github.com/AlexAltea/nucleus/blob/9103d7eb52cc861cb6e317f0007246bd03d663a2/nucleus/assert.h * https://github.com/AlexAltea/nucleus/blob/9103d7eb52cc861cb6e317f0007246bd03d663a2/LICENSE * Released under GPL v2 license. ...
C/C++
x64dbg-development/src/dbg_types.h
#ifndef _DBG_TYPES_H_ #define _DBG_TYPES_H_ /***************************************************************/ // // This file declares common types to be used // throughout the project. Originally duint, int_t, // or size_t were used to represent pointers and addresses. // // The purpose is to use a single type as the...
x64dbg-development/src/x64dbg_translations.pro
#------------------------------------------------- # This file is for lupdate to update the translations only. # DO NOT compile this file. # If you add new files in the project, remember to add them here too. #------------------------------------------------- SOURCES += \ gui/Src/Gui/AppearanceDialog.cpp \ gu...
C/C++
x64dbg-development/src/bridge/bridgegraph.h
#ifndef _GRAPH_H #define _GRAPH_H typedef struct { duint addr; //virtual address of the instruction unsigned char data[15]; //instruction bytes } BridgeCFInstruction; typedef struct { duint parentGraph; //function of which this node is a part duint start; //start of the block duint end; //end of t...
C/C++
x64dbg-development/src/bridge/bridgelist.h
#ifndef _LIST_H #define _LIST_H typedef struct { int count; //Number of element in the list. size_t size; //Size of list in bytes (used for type checking). void* data; //Pointer to the list contents. Must be deleted by the caller using BridgeFree (or BridgeList::Free). } ListInfo; #define ListOf(Type) Lis...
C++
x64dbg-development/src/bridge/bridgemain.cpp
/** * \file bridgemain.cpp * * \brief Defines functions to initialize and start the Bridge and * to interface with the GUI and the DBG. */ #include "_global.h" #include "bridgemain.h" #include <stdio.h> #include <ShlObj.h> #include "Utf8Ini.h" static HINSTANCE hInst; static Utf8Ini settings; static wchar_t...
C/C++
x64dbg-development/src/bridge/bridgemain.h
#ifndef _BRIDGEMAIN_H_ #define _BRIDGEMAIN_H_ #include <windows.h> #ifndef __cplusplus #include <stdbool.h> #define DEFAULT_PARAM(name, value) name #else #define DEFAULT_PARAM(name, value) name = value #endif //default structure alignments forced #ifdef _WIN64 #pragma pack(push, 16) #else //x86 #pragma pack(push, 8)...
C/C++
x64dbg-development/src/bridge/Utf8Ini.h
#ifndef UTF8INI_H #define UTF8INI_H #include <string> #include <map> #include <vector> class Utf8Ini { public: /** \brief Serialize to the INI file format. */ inline std::string Serialize() const { std::string output; for(const auto & section : mSections) { if(o...
Visual C++ Project
x64dbg-development/src/bridge/x64dbg_bridge.vcxproj
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> ...
x64dbg-development/src/bridge/x64dbg_bridge.vcxproj.filters
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup> <Filter Include="Source Files"> <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx<...
C++
x64dbg-development/src/bridge/_global.cpp
#include "_global.h" GUIGUIINIT _gui_guiinit; GUISENDMESSAGE _gui_sendmessage; GUITRANSLATETEXT _gui_translate_text; DBGDBGINIT _dbg_dbginit; DBGMEMFINDBASEADDR _dbg_memfindbaseaddr; DBGMEMREAD _dbg_memread; DBGMEMWRITE _dbg_memwrite; DBGDBGCMDEXEC _dbg_dbgcmdexec; DBGMEMMAP _dbg_memmap; DBGDBGEXITSIGNAL _dbg_dbgexit...
C/C++
x64dbg-development/src/bridge/_global.h
#ifndef _GLOBAL_H #define _GLOBAL_H #include <windows.h> #include "bridgemain.h" //GUI typedefs typedef int (*GUIGUIINIT)(int, char**); typedef void* (*GUISENDMESSAGE)(GUIMSG type, void* param1, void* param2); typedef const char* (*GUITRANSLATETEXT)(const char* source); //GUI functions extern GUIGUIINIT _gui_guiinit...
C++
x64dbg-development/src/dbg/addrinfo.cpp
/** @file addrinfo.cpp @brief Implements the addrinfo class. */ #include "addrinfo.h" #include "debugger.h" #include "memory.h" #include "module.h" #include "value.h" ///api functions bool apienumexports(duint base, const EXPORTENUMCALLBACK & cbEnum) { SHARED_ACQUIRE(LockModules); auto modinfo = ModInfoFr...
C/C++
x64dbg-development/src/dbg/addrinfo.h
#ifndef _ADDRINFO_H #define _ADDRINFO_H #include "_global.h" #include <functional> #include <map> #include <unordered_map> //ranges typedef std::pair<duint, duint> Range; typedef std::pair<duint, Range> ModuleRange; //modhash + RVA range typedef std::pair<int, ModuleRange> DepthModuleRange; //depth + modulerange str...
C++
x64dbg-development/src/dbg/animate.cpp
#include "animate.h" #include "x64dbg.h" #include "command.h" char animate_command[deflen]; static unsigned int animate_interval = 50; HANDLE hAnimateThread = nullptr; static DWORD WINAPI animateThread(void* arg1) { auto ignoreError = settingboolget("Misc", "AnimateIgnoreError"); while(animate_command[0] != 0...
C/C++
x64dbg-development/src/dbg/animate.h
#ifndef ANIMATE_H #define ANIMATE_H bool _dbg_animatecommand(const char* command); void _dbg_setanimateinterval(unsigned int milliseconds); bool _dbg_isanimating(); inline void _dbg_animatestop() { _dbg_animatecommand(nullptr); } #endif //ANIMATE_H
C++
x64dbg-development/src/dbg/argument.cpp
#include "argument.h" #include "module.h" #include "memory.h" #include "threading.h" struct ArgumentSerializer : JSONWrapper<ARGUMENTSINFO> { bool Save(const ARGUMENTSINFO & value) override { setString("module", value.mod()); setHex("start", value.start); setHex("end", value.end); ...
C/C++
x64dbg-development/src/dbg/argument.h
#ifndef _ARGUMENT_H #define _ARGUMENT_H #include "addrinfo.h" struct ARGUMENTSINFO { duint modhash; duint start; duint end; bool manual; duint instructioncount; std::string mod() const { return ModNameFromHash(modhash); } }; bool ArgumentAdd(duint Start, duint End, bool Manua...
C++
x64dbg-development/src/dbg/assemble.cpp
/** @file assemble.cpp @brief Implements the assemble class. */ #include "assemble.h" #include "memory.h" #include "XEDParse/XEDParse.h" #include "value.h" #include "disasm_fast.h" #include "disasm_helper.h" #include "datainst_helper.h" #include "debugger.h" AssemblerEngine assemblerEngine = AssemblerEngine::XEDP...
C/C++
x64dbg-development/src/dbg/assemble.h
#ifndef _ASSEMBLE_H #define _ASSEMBLE_H #include "_global.h" enum class AssemblerEngine { XEDParse = 0, Keystone = 1, asmjit = 2 }; extern AssemblerEngine assemblerEngine; bool assemble(duint addr, unsigned char* dest, int* size, const char* instruction, char* error); bool assembleat(duint addr, const c...
C++
x64dbg-development/src/dbg/bookmark.cpp
#include "bookmark.h" struct BookmarkSerializer : AddrInfoSerializer<BOOKMARKSINFO> { }; struct Bookmarks : AddrInfoHashMap<LockBookmarks, BOOKMARKSINFO, BookmarkSerializer> { const char* jsonKey() const override { return "bookmarks"; } }; static Bookmarks bookmarks; bool BookmarkSet(duint Addre...
C/C++
x64dbg-development/src/dbg/bookmark.h
#ifndef _BOOKMARK_H #define _BOOKMARK_H #include "_global.h" #include "addrinfo.h" struct BOOKMARKSINFO : AddrInfo { }; bool BookmarkSet(duint Address, bool Manual); bool BookmarkGet(duint Address); bool BookmarkDelete(duint Address); void BookmarkDelRange(duint Start, duint End, bool Manual); void BookmarkCacheSave...
C++
x64dbg-development/src/dbg/breakpoint.cpp
/** @file breakpoint.cpp @brief Implements the breakpoint class. */ #include "breakpoint.h" #include "memory.h" #include "threading.h" #include "module.h" #include "value.h" #include "debugger.h" #include "exception.h" #include <algorithm> typedef std::pair<BP_TYPE, duint> BreakpointKey; std::map<BreakpointKey, B...
C/C++
x64dbg-development/src/dbg/breakpoint.h
#ifndef _BREAKPOINT_H #define _BREAKPOINT_H #include "_global.h" #include "jansson/jansson_x64dbg.h" #define TITANSETDRX(titantype, drx) titantype &= 0x0FF, titantype |= (((drx - UE_DR0) & 0xF) << 8) #define TITANGETDRX(titantype) UE_DR0 + ((titantype >> 8) & 0xF) #define TITANDRXVALID(titantype) TITANGETDRX(titantyp...
C++
x64dbg-development/src/dbg/command.cpp
/** @file command.cpp @brief Implements the command class. */ #include "command.h" #include "value.h" #include "console.h" #include "commandparser.h" #include "expressionparser.h" #include "variable.h" #include "cmd-undocumented.h" COMMAND* cmd_list = 0; static bool vecContains(std::vector<String>* names, const ...
C/C++
x64dbg-development/src/dbg/command.h
#ifndef _COMMAND_H #define _COMMAND_H #include "_global.h" #include "console.h" bool IsArgumentsLessThan(int argc, int minimumCount); //typedefs struct COMMAND; typedef bool(*CBCOMMAND)(int, char**); typedef bool (*CBCOMMANDPROVIDER)(char*, int); typedef COMMAND* (*CBCOMMANDFINDER)(char*); struct COMMAND { st...
C++
x64dbg-development/src/dbg/commandline.cpp
#include "commandline.h" #include "threading.h" #include "memory.h" #include "debugger.h" #include "console.h" #include "filehelper.h" char commandLine[MAX_SETTING_SIZE]; void showcommandlineerror(cmdline_error_t* cmdline_error) { bool unkown = false; switch(cmdline_error->type) { case CMDL_ERR_ALLOC...
C/C++
x64dbg-development/src/dbg/commandline.h
#ifndef _COMMANDLINE_H #define _COMMANDLINE_H #include "_global.h" #include "command.h" #include "jansson/jansson_x64dbg.h" typedef enum { CMDL_ERR_READ_PEBBASE = 0, CMDL_ERR_READ_PROCPARM_PTR, CMDL_ERR_READ_PROCPARM_CMDLINE, CMDL_ERR_CONVERTUNICODE, CMDL_ERR_ALLOC, CMDL_ERR_GET_PEB, CMDL_...
C++
x64dbg-development/src/dbg/commandparser.cpp
#include "commandparser.h" Command::Command(const String & command) { ParseState state = Default; int len = (int)command.length(); for(int i = 0; i < len; i++) { char ch = command[i]; switch(state) { case Default: switch(ch) { case '\t...
C/C++
x64dbg-development/src/dbg/commandparser.h
#ifndef _COMMANDPARSER_H #define _COMMANDPARSER_H #include "_global.h" class Command { public: Command(const String & command); const String GetText(); const String GetArg(const int argnum); const int GetArgCount(); private: String _data; std::vector<String> _tokens; enum ParseState ...
C++
x64dbg-development/src/dbg/comment.cpp
#include "comment.h" struct CommentSerializer : AddrInfoSerializer<COMMENTSINFO> { bool Save(const COMMENTSINFO & value) override { AddrInfoSerializer::Save(value); setString("text", value.text); return true; } bool Load(COMMENTSINFO & value) override { return AddrI...
C/C++
x64dbg-development/src/dbg/comment.h
#ifndef _COMMENT_H #define _COMMENT_H #include "_global.h" #include "addrinfo.h" struct COMMENTSINFO : AddrInfo { std::string text; }; bool CommentSet(duint Address, const char* Text, bool Manual); bool CommentGet(duint Address, char* Text); bool CommentDelete(duint Address); void CommentDelRange(duint Start, du...
C++
x64dbg-development/src/dbg/console.cpp
/** \file console.cpp \brief Implements the console class. */ #include "console.h" #include "taskthread.h" static void GuiAddLogMessageAsync(_In_z_ const char* msg) { static StringConcatTaskThread_<void(*)(const std::string &)> task([](const std::string & msg) { GuiAddLogMessage(msg.c_str()); }); ...
C/C++
x64dbg-development/src/dbg/console.h
#ifndef _CONSOLE_H #define _CONSOLE_H #include "_global.h" void dputs(_In_z_ const char* Text); void dprintf(_In_z_ _Printf_format_string_ const char* Format, ...); void dprintf_args(_In_z_ _Printf_format_string_ const char* Format, va_list Args); void dputs_untranslated(_In_z_ const char* Text); void dprintf_untrans...
C++
x64dbg-development/src/dbg/database.cpp
/** @file database.cpp @brief Implements runtime database saving and loading. */ #include "lz4/lz4file.h" #include "console.h" #include "breakpoint.h" #include "patches.h" #include "comment.h" #include "label.h" #include "bookmark.h" #include "function.h" #include "loop.h" #include "watch.h" #include "commandline.h" ...
C/C++
x64dbg-development/src/dbg/database.h
#ifndef _DATABASE_H #define _DATABASE_H #include "_global.h" enum class DbLoadSaveType { CommandLine, DebugData, All }; void DbSave(DbLoadSaveType saveType, const char* dbfile = nullptr, bool disablecompression = false); void DbLoad(DbLoadSaveType loadType, const char* dbfile = nullptr); void DbClose(); ...
C++
x64dbg-development/src/dbg/datainst_helper.cpp
#include "datainst_helper.h" #include "encodemap.h" #include "stringutils.h" #include "value.h" #include <zydis_wrapper.h> #include <algorithm> std::unordered_map<ENCODETYPE, std::string> disasmMap; std::unordered_map<std::string, ENCODETYPE> assembleMap; void initDataInstMap() { disasmMap.clear(); assembleMa...
C/C++
x64dbg-development/src/dbg/datainst_helper.h
#pragma once #include "_global.h" void initDataInstMap(); bool isdatainstruction(const char* instruction); bool tryassembledata(duint addr, unsigned char* dest, int destsize, int* size, const char* instruction, char* error); bool trydisasm(const unsigned char* buffer, duint addr, DISASM_INSTR* instr, duint codesize); ...
C++
x64dbg-development/src/dbg/dbghelp_safe.cpp
#include "_global.h" #include "dbghelp_safe.h" static CRITICAL_SECTION criticalSection; struct Lock { explicit Lock(bool weak) { if(weak) success = !!TryEnterCriticalSection(&criticalSection); else { EnterCriticalSection(&criticalSection); success = ...
C/C++
x64dbg-development/src/dbg/dbghelp_safe.h
#ifndef _DBGHELP_SAFE_H #define _DBGHELP_SAFE_H #ifdef __GNUC__ #include "dbghelp\dbghelp.h" #else #pragma warning(push) #pragma warning(disable:4091) #include <dbghelp.h> #pragma warning(pop) #endif //__GNUC__ void SafeDbghelpInitialize(); void SafeDbghelpDeinitialize(); /*DWORD SafeUnDecorateSymbolName( __in P...
C++
x64dbg-development/src/dbg/debugger.cpp
/** @file debugger.cpp @brief Implements the debugger class. */ #include "debugger.h" #include "console.h" #include "memory.h" #include "threading.h" #include "command.h" #include "database.h" #include "watch.h" #include "thread.h" #include "plugin_loader.h" #include "breakpoint.h" #include "symbolinfo.h" #include...
C/C++
x64dbg-development/src/dbg/debugger.h
#ifndef _DEBUGGER_H #define _DEBUGGER_H #include "_global.h" #include "TitanEngine/TitanEngine.h" #include "command.h" #include "breakpoint.h" #include "_plugins.h" #include "commandline.h" #include <tlhelp32.h> #include <psapi.h> //enums enum class ExceptionBreakOn { FirstChance, SecondChance, DoNotBreak...
C/C++
x64dbg-development/src/dbg/debugger_cookie.h
#pragma once struct CookieQuery { duint addr = 0; duint ret = 0; duint cookieptr = 0; ULONG cookie = 0; bool removeAddrBp = false; bool removeRetBp = false; void HandleNtdllLoad(bool isAttached) { *this = CookieQuery(); ULONG returnSize = 0; NTSTATUS status = Nt...
C/C++
x64dbg-development/src/dbg/debugger_tracing.h
#pragma once /** \brief Conditional tracing structures */ struct TraceCondition { ExpressionParser condition; duint steps; duint maxSteps; explicit TraceCondition(const String & expression, duint maxCount) : condition(expression), steps(0), maxSteps(maxCount) {} // Return value: 0:Continu...
C++
x64dbg-development/src/dbg/disasm_fast.cpp
/** @file disasm_fast.cpp @brief Implements the disasm fast class. */ #include "disasm_fast.h" #include "memory.h" #include "datainst_helper.h" void fillbasicinfo(Zydis* cp, BASIC_INSTRUCTION_INFO* basicinfo, bool instrText) { //zero basicinfo memset(basicinfo, 0, sizeof(BASIC_INSTRUCTION_INFO)); //co...
C/C++
x64dbg-development/src/dbg/disasm_fast.h
#ifndef _DISASM_FAST_H #define _DISASM_FAST_H #include "_global.h" #include <zydis_wrapper.h> void fillbasicinfo(Zydis* disasm, BASIC_INSTRUCTION_INFO* basicinfo, bool instrText = true); bool disasmfast(duint addr, BASIC_INSTRUCTION_INFO* basicinfo, bool cache = false); bool disasmfast(const unsigned char* data, duin...
C++
x64dbg-development/src/dbg/disasm_helper.cpp
/** @file disasm_helper.cpp @brief Implements the disasm helper class. */ #include "disasm_helper.h" #include "thread.h" #include "console.h" #include "memory.h" #include "debugger.h" #include "value.h" #include "encodemap.h" #include <zydis_wrapper.h> #include "datainst_helper.h" duint disasmback(unsigned char* ...
C/C++
x64dbg-development/src/dbg/disasm_helper.h
#ifndef _DISASM_HELPER_H #define _DISASM_HELPER_H #include "_global.h" #include "zydis_wrapper.h" //functions duint disasmback(unsigned char* data, duint base, duint size, duint ip, int n); duint disasmnext(unsigned char* data, duint base, duint size, duint ip, int n); void disasmget(Zydis & cp, unsigned char* buffer...
C/C++
x64dbg-development/src/dbg/dynamicmem.h
#pragma once template<typename T> class Memory { public: // // This class guarantees that the returned allocated memory // will always be zeroed // explicit Memory(const char* Reason = "Memory:???") { m_Ptr = nullptr; m_Size = 0; #ifdef ENABLE_MEM_TRACE m_Reason = Reason...
C++
x64dbg-development/src/dbg/encodemap.cpp
#include "encodemap.h" #include <unordered_map> #include "addrinfo.h" #include <zydis_wrapper.h> struct ENCODEMAP : AddrInfo { duint size; byte* data; }; std::unordered_map<duint, duint> referenceCount; void IncreaseReferenceCount(void* buffer, bool lock = true) { if(lock) { EXCLUSIVE_ACQUIRE...
C/C++
x64dbg-development/src/dbg/encodemap.h
#pragma once #include "_global.h" #include "jansson/jansson_x64dbg.h" void* EncodeMapGetBuffer(duint addr, duint* size, bool create = false); void EncodeMapReleaseBuffer(void* buffer); ENCODETYPE EncodeMapGetType(duint addr, duint codesize); duint EncodeMapGetSize(duint addr, duint codesize); void EncodeMapDelSegment...
C++
x64dbg-development/src/dbg/exception.cpp
#include <unordered_map> #include <algorithm> #include "exception.h" #include "filehelper.h" #include "value.h" #include "console.h" #include "threading.h" #include "module.h" #include "syscalls.h" static std::unordered_map<unsigned int, String> ExceptionNames; static std::unordered_map<unsigned int, String> NtStatusN...
C/C++
x64dbg-development/src/dbg/exception.h
#ifndef _EXCEPTION_H #define _EXCEPTION_H #define MS_VC_EXCEPTION 0x406D1388 #include "_global.h" #include "_dbgfunctions.h" #include "stringutils.h" bool ExceptionCodeInit(const String & exceptionFile); const String & ExceptionCodeToName(unsigned int ExceptionCode); std::vector<CONSTANTINFO> ExceptionList(); bool N...
C++
x64dbg-development/src/dbg/exhandlerinfo.cpp
/** @file exhandlerinfo.cpp @brief ??? */ #include "exhandlerinfo.h" #include "memory.h" #include "thread.h" #include "value.h" #include "debugger.h" bool IsVistaOrLater() { static bool vistaOrLater = []() { OSVERSIONINFOEXW osvi = { 0 }; osvi.dwOSVersionInfoSize = sizeof(osvi); retur...
C/C++
x64dbg-development/src/dbg/exhandlerinfo.h
#ifndef _EXHANDLERINFO_H #define _EXHANDLERINFO_H #include "_global.h" enum EX_HANDLER_TYPE { EX_HANDLER_SEH, // Structured EX_HANDLER_VEH, // Vectored EX_HANDLER_VCH, // Vectored continue (Vista+) EX_HANDLER_UNHANDLED, // Unhandled }; struct EX_HANDLER_INFO { int count;...
C++
x64dbg-development/src/dbg/expressionfunctions.cpp
#include "expressionfunctions.h" #include "threading.h" #include "exprfunc.h" #include "module.h" #include "debugger.h" #include "value.h" std::unordered_map<String, ExpressionFunctions::Function> ExpressionFunctions::mFunctions; //Copied from https://stackoverflow.com/a/7858971/1806760 template<int...> struct seq {}...
C/C++
x64dbg-development/src/dbg/expressionfunctions.h
#pragma once #include "_global.h" #include "_plugins.h" #include <functional> class ExpressionFunctions { public: using CBEXPRESSIONFUNCTION = std::function<bool(ExpressionValue* result, int argc, const ExpressionValue* argv, void* userdata)>; static void Init(); static bool Register(const String & name...
C++
x64dbg-development/src/dbg/expressionparser.cpp
#include "expressionparser.h" #include "value.h" #include "console.h" #include "variable.h" #include "expressionfunctions.h" #include <algorithm> ExpressionParser::Token::Associativity ExpressionParser::Token::associativity() const { switch(mType) { case Type::OperatorUnarySub: case Type::OperatorUnary...
C/C++
x64dbg-development/src/dbg/expressionparser.h
#ifndef _EXPRESSION_PARSER_H #define _EXPRESSION_PARSER_H #include "_global.h" #include "value.h" class ExpressionParser { public: struct EvalValue { bool evaluated = false; bool isString = false; duint value = 0; String data; explicit EvalValue(duint value) ...
C++
x64dbg-development/src/dbg/exprfunc.cpp
#include "exprfunc.h" #include "symbolinfo.h" #include "module.h" #include "debugger.h" #include "thread.h" #include "memory.h" #include "disasm_fast.h" #include "TraceRecord.h" #include "disasm_helper.h" #include "function.h" #include "value.h" #include "TraceRecord.h" #include "exhandlerinfo.h" #include <vector> #inc...
C/C++
x64dbg-development/src/dbg/exprfunc.h
#pragma once #include "_global.h" #include "expressionfunctions.h" namespace Exprfunc { duint srcline(duint addr); duint srcdisp(duint addr); duint modparty(duint addr); duint modsystem(duint addr); duint moduser(duint addr); duint modrva(duint addr); duint modheaderva(duint addr); du...
C++
x64dbg-development/src/dbg/filehelper.cpp
#include "filehelper.h" #include "handle.h" #include "stringutils.h" bool FileHelper::ReadAllData(const String & fileName, std::vector<unsigned char> & content) { if(fileName.compare("x64dbg://localhost/clipboard") != 0) { Handle hFile = CreateFileW(StringUtils::Utf8ToUtf16(fileName).c_str(), GENERIC_R...
C/C++
x64dbg-development/src/dbg/filehelper.h
#ifndef _FILEREADER_H #define _FILEREADER_H #include "_global.h" class FileHelper { public: static bool ReadAllData(const String & fileName, std::vector<unsigned char> & content); static bool WriteAllData(const String & fileName, const void* data, size_t size); static bool ReadAllText(const String & fileN...
C/C++
x64dbg-development/src/dbg/filemap.h
#pragma once #include <Windows.h> template<typename T> struct FileMap { bool Map(const wchar_t* szFileName, bool mapImage = false) { hFile = CreateFileW(szFileName, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, 0, nullptr); if(hFile != INVALID_HANDLE_VALUE) { size ...
C++
x64dbg-development/src/dbg/formatfunctions.cpp
#include "formatfunctions.h" #include "threading.h" #include "value.h" #include "memory.h" #include "exception.h" #include "ntdll/ntdll.h" #include "disasm_fast.h" std::unordered_map<String, FormatFunctions::Function> FormatFunctions::mFunctions; static FORMATRESULT formatErrorMsg(HMODULE DLL, const String & errName,...
C/C++
x64dbg-development/src/dbg/formatfunctions.h
#pragma once #include "_global.h" #include "_plugins.h" #include <functional> class FormatFunctions { public: using CBFORMATFUNCTION = std::function<FORMATRESULT(char* dest, size_t destCount, int argc, char* argv[], duint value, void* userdata)>; static void Init(); static bool Register(const String & ty...
C++
x64dbg-development/src/dbg/function.cpp
#include "function.h" #include "module.h" #include "memory.h" #include "threading.h" struct FunctionSerializer : JSONWrapper<FUNCTIONSINFO> { bool Save(const FUNCTIONSINFO & value) override { setString("module", value.mod()); setHex("start", value.start); setHex("end", value.end); ...
C/C++
x64dbg-development/src/dbg/function.h
#ifndef _FUNCTION_H #define _FUNCTION_H #include "addrinfo.h" struct FUNCTIONSINFO { duint modhash; duint start; duint end; bool manual; duint instructioncount; duint parent; std::string mod() const { return ModNameFromHash(modhash); } }; bool FunctionAdd(duint Start, dui...
C/C++
x64dbg-development/src/dbg/GetPeArch.h
#pragma once #include <windows.h> enum class PeArch { Invalid, Native86, Native64, Dotnet86, Dotnet64, DotnetAnyCpu, DotnetAnyCpuPrefer32 }; // Thanks to blaquee for the investigative work! static PeArch GetPeArch(const wchar_t* szFileName) { auto result = PeArch::Invalid; auto hF...
C/C++
x64dbg-development/src/dbg/handle.h
#ifndef _HANDLE_H #define _HANDLE_H #include <windows.h> class Handle { public: Handle(HANDLE h = nullptr) : mHandle(h) { } Handle(const Handle &) = delete; Handle(Handle &&) = delete; ~Handle() { Close(); } void Close() { if(*this) { DWORD dwFlags...
C++
x64dbg-development/src/dbg/handles.cpp
#include <functional> #include "handles.h" #include "ntdll/ntdll.h" #include "exception.h" #include "debugger.h" #include "thread.h" #include "threading.h" static std::unordered_map<UCHAR, String> HandleTypeNames; static std::unordered_map<HANDLE, String> HandleTypeCache; static void HandleTypesEnum() { Memory<PO...
C/C++
x64dbg-development/src/dbg/handles.h
#pragma once #include "_global.h" #include "_dbgfunctions.h" bool HandlesEnum(std::vector<HANDLEINFO> & handlesList); bool HandlesGetName(HANDLE remoteHandle, String & name, String & typeName); bool HandlesEnumWindows(std::vector<WINDOW_INFO> & windowsList); bool HandlesEnumHeaps(std::vector<HEAPINFO> & heapList); St...
C++
x64dbg-development/src/dbg/historycontext.cpp
#include "historycontext.h" #include "disasm_helper.h" #include "memory.h" #include "console.h" #include "watch.h" #include "threading.h" #include "cmd-watch-control.h" #include "debugger.h" #include <deque> /** * @brief The class used to hold history context. **/ class HistoryContext { public: HistoryContext(); ...
C/C++
x64dbg-development/src/dbg/historycontext.h
#ifndef HISTORYCONTEXT_H #define HISTORYCONTEXT_H #include "_global.h" #include "TitanEngine/TitanEngine.h" void HistoryRecord(); void HistoryRestore(); void HistoryClear(); bool HistoryIsEmpty(); #endif //HISTORY_CONTEXT_H
C++
x64dbg-development/src/dbg/jit.cpp
#include "jit.h" static bool readwritejitkey(const wchar_t* jit_key_value, DWORD* jit_key_vale_size, const char* key, arch arch_in, arch* arch_out, readwritejitkey_error_t* error, bool write) { DWORD key_flags; DWORD lRv; HKEY hKey; DWORD dwDisposition; if(error != NULL) *error = ERROR_RW;...
C/C++
x64dbg-development/src/dbg/jit.h
#ifndef _JIT_H #define _JIT_H #include "_global.h" #define ATTACH_CMD_LINE "\" -a %ld -e %ld" #define JIT_REG_KEY L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug" #define JIT_ENTRY_MAX_SIZE 512 #define JIT_ENTRY_DEF_SIZE (MAX_PATH + sizeof(ATTACH_CMD_LINE) + 2) typedef enum { ERROR_RW =...
C++
x64dbg-development/src/dbg/label.cpp
#include "label.h" struct LabelSerializer : AddrInfoSerializer<LABELSINFO> { bool Save(const LABELSINFO & value) override { AddrInfoSerializer::Save(value); setString("text", value.text); return true; } bool Load(LABELSINFO & value) override { return AddrInfoSeriali...
C/C++
x64dbg-development/src/dbg/label.h
#ifndef _LABEL_H #define _LABEL_H #include "_global.h" #include "addrinfo.h" struct LABELSINFO : AddrInfo { std::string text; }; bool LabelSet(duint Address, const char* Text, bool Manual, bool Temp = false); bool LabelFromString(const char* Text, duint* Address); bool LabelGet(duint Address, char* Text); bool L...
C++
x64dbg-development/src/dbg/log.cpp
#include "_global.h" #include "log.h" log::log(void) { } log::~log(void) { GuiAddLogMessage(message.str().c_str()); }
C++
x64dbg-development/src/dbg/loop.cpp
#include "loop.h" #include "memory.h" #include "threading.h" #include "module.h" #include "debugger.h" static std::map<DepthModuleRange, LOOPSINFO, DepthModuleRangeCompare> loops; bool LoopAdd(duint Start, duint End, bool Manual, duint instructionCount) { ASSERT_DEBUGGING("Export call"); // Loop must begin b...
C/C++
x64dbg-development/src/dbg/loop.h
#ifndef _LOOP_H #define _LOOP_H #include "addrinfo.h" struct LOOPSINFO { duint modhash; duint start; duint end; duint parent; int depth; bool manual; duint instructioncount; std::string mod() const { return ModNameFromHash(modhash); } }; bool LoopAdd(duint Start, duin...