├── .gitignore ├── x64dbg_headless.sln └── x64dbg_headless ├── pluginsdk ├── DeviceNameResolver │ ├── DeviceNameResolver.h │ ├── DeviceNameResolver_x64.a │ ├── DeviceNameResolver_x64.lib │ ├── DeviceNameResolver_x86.a │ └── DeviceNameResolver_x86.lib ├── TitanEngine │ ├── TitanEngine.h │ ├── TitanEngine_x64.a │ ├── TitanEngine_x64.lib │ ├── TitanEngine_x86.a │ └── TitanEngine_x86.lib ├── XEDParse │ ├── XEDParse.h │ ├── XEDParse_x64.a │ ├── XEDParse_x64.lib │ ├── XEDParse_x86.a │ └── XEDParse_x86.lib ├── _dbgfunctions.h ├── _plugin_types.h ├── _plugins.h ├── _scriptapi.h ├── _scriptapi_argument.h ├── _scriptapi_assembler.h ├── _scriptapi_bookmark.h ├── _scriptapi_comment.h ├── _scriptapi_debug.h ├── _scriptapi_flag.h ├── _scriptapi_function.h ├── _scriptapi_gui.h ├── _scriptapi_label.h ├── _scriptapi_memory.h ├── _scriptapi_misc.h ├── _scriptapi_module.h ├── _scriptapi_pattern.h ├── _scriptapi_register.h ├── _scriptapi_stack.h ├── _scriptapi_symbol.h ├── bridgegraph.h ├── bridgelist.h ├── bridgemain.h ├── dbghelp │ ├── dbghelp.h │ ├── dbghelp_x64.a │ ├── dbghelp_x64.lib │ ├── dbghelp_x86.a │ └── dbghelp_x86.lib ├── jansson │ ├── jansson.h │ ├── jansson_config.h │ ├── jansson_x64.a │ ├── jansson_x64.lib │ ├── jansson_x64dbg.h │ ├── jansson_x86.a │ └── jansson_x86.lib ├── lz4 │ ├── lz4.h │ ├── lz4_x64.a │ ├── lz4_x64.lib │ ├── lz4_x86.a │ ├── lz4_x86.lib │ ├── lz4file.h │ └── lz4hc.h ├── x32bridge.lib ├── x32dbg.lib ├── x64bridge.lib └── x64dbg.lib ├── stringutils.cpp ├── stringutils.h ├── tostring.h ├── x64dbg_gui.cpp ├── x64dbg_headless.vcxproj └── x64dbg_headless.vcxproj.filters /.gitignore: -------------------------------------------------------------------------------- 1 | Release/ 2 | Debug/ 3 | x64/ 4 | Win32/ 5 | .vs/ 6 | *.vcxproj.user 7 | *.sdf 8 | *.suo 9 | .vs/ 10 | Release/ 11 | Debug/ 12 | x64/ 13 | -------------------------------------------------------------------------------- /x64dbg_headless.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.572 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x64dbg_headless", "x64dbg_headless\x64dbg_headless.vcxproj", "{D65E1831-DF2D-4C74-B370-2A3038998886}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {D65E1831-DF2D-4C74-B370-2A3038998886}.Debug|x64.ActiveCfg = Debug|x64 17 | {D65E1831-DF2D-4C74-B370-2A3038998886}.Debug|x64.Build.0 = Debug|x64 18 | {D65E1831-DF2D-4C74-B370-2A3038998886}.Debug|x86.ActiveCfg = Debug|Win32 19 | {D65E1831-DF2D-4C74-B370-2A3038998886}.Debug|x86.Build.0 = Debug|Win32 20 | {D65E1831-DF2D-4C74-B370-2A3038998886}.Release|x64.ActiveCfg = Release|x64 21 | {D65E1831-DF2D-4C74-B370-2A3038998886}.Release|x64.Build.0 = Release|x64 22 | {D65E1831-DF2D-4C74-B370-2A3038998886}.Release|x86.ActiveCfg = Release|Win32 23 | {D65E1831-DF2D-4C74-B370-2A3038998886}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {AB28B7F5-1B7B-46AC-B8D7-FBEF7D778077} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/DeviceNameResolver/DeviceNameResolver.h: -------------------------------------------------------------------------------- 1 | #ifndef _DEVICENAMERESOLVER_H 2 | #define _DEVICENAMERESOLVER_H 3 | 4 | #include 5 | 6 | #ifdef __cplusplus 7 | extern "C" 8 | { 9 | #endif 10 | 11 | __declspec(dllexport) bool DevicePathToPathW(const wchar_t* szDevicePath, wchar_t* szPath, size_t nSizeInChars); 12 | __declspec(dllexport) bool DevicePathToPathA(const char* szDevicePath, char* szPath, size_t nSizeInChars); 13 | __declspec(dllexport) bool DevicePathFromFileHandleW(HANDLE hFile, wchar_t* szDevicePath, size_t nSizeInChars); 14 | __declspec(dllexport) bool DevicePathFromFileHandleA(HANDLE hFile, char* szDevicePath, size_t nSizeInChars); 15 | __declspec(dllexport) bool PathFromFileHandleW(HANDLE hFile, wchar_t* szPath, size_t nSizeInChars); 16 | __declspec(dllexport) bool PathFromFileHandleA(HANDLE hFile, char* szPath, size_t nSizeInChars); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif // _DEVICENAMERESOLVER_H 23 | -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/DeviceNameResolver/DeviceNameResolver_x64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/DeviceNameResolver/DeviceNameResolver_x64.a -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/DeviceNameResolver/DeviceNameResolver_x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/DeviceNameResolver/DeviceNameResolver_x64.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/DeviceNameResolver/DeviceNameResolver_x86.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/DeviceNameResolver/DeviceNameResolver_x86.a -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/DeviceNameResolver/DeviceNameResolver_x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/DeviceNameResolver/DeviceNameResolver_x86.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/TitanEngine/TitanEngine_x64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/TitanEngine/TitanEngine_x64.a -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/TitanEngine/TitanEngine_x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/TitanEngine/TitanEngine_x64.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/TitanEngine/TitanEngine_x86.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/TitanEngine/TitanEngine_x86.a -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/TitanEngine/TitanEngine_x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/TitanEngine/TitanEngine_x86.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/XEDParse/XEDParse.h: -------------------------------------------------------------------------------- 1 | #ifndef _XEDPARSE_H 2 | #define _XEDPARSE_H 3 | 4 | #include 5 | 6 | //XEDParse defines 7 | #ifdef XEDPARSE_BUILD 8 | #define XEDPARSE_EXPORT __declspec(dllexport) 9 | #else 10 | #define XEDPARSE_EXPORT __declspec(dllimport) 11 | #endif //XEDPARSE_BUILD 12 | 13 | #define XEDPARSE_CALL //calling convention 14 | 15 | #define XEDPARSE_MAXBUFSIZE 256 16 | #define XEDPARSE_MAXASMSIZE 16 17 | 18 | //typedefs 19 | typedef bool (XEDPARSE_CALL* CBXEDPARSE_UNKNOWN)(const char* text, ULONGLONG* value); 20 | 21 | //XEDParse enums 22 | enum XEDPARSE_STATUS 23 | { 24 | XEDPARSE_ERROR = 0, 25 | XEDPARSE_OK = 1 26 | }; 27 | 28 | //XEDParse structs 29 | #pragma pack(push,8) 30 | struct XEDPARSE 31 | { 32 | bool x64; // use 64-bit instructions 33 | ULONGLONG cip; //instruction pointer (for relative addressing) 34 | unsigned int dest_size; //destination size (returned by XEDParse) 35 | CBXEDPARSE_UNKNOWN cbUnknown; //unknown operand callback 36 | unsigned char dest[XEDPARSE_MAXASMSIZE]; //destination buffer 37 | char instr[XEDPARSE_MAXBUFSIZE]; //instruction text 38 | char error[XEDPARSE_MAXBUFSIZE]; //error text (in case of an error) 39 | }; 40 | #pragma pack(pop) 41 | 42 | #ifdef __cplusplus 43 | extern "C" 44 | { 45 | #endif 46 | 47 | XEDPARSE_EXPORT XEDPARSE_STATUS XEDPARSE_CALL XEDParseAssemble(XEDPARSE* XEDParse); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif // _XEDPARSE_H 54 | -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/XEDParse/XEDParse_x64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/XEDParse/XEDParse_x64.a -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/XEDParse/XEDParse_x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/XEDParse/XEDParse_x64.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/XEDParse/XEDParse_x86.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/XEDParse/XEDParse_x86.a -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/XEDParse/XEDParse_x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/XEDParse/XEDParse_x86.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_dbgfunctions.h: -------------------------------------------------------------------------------- 1 | #ifndef _DBGFUNCTIONS_H 2 | #define _DBGFUNCTIONS_H 3 | 4 | #ifndef __cplusplus 5 | #include 6 | #endif 7 | 8 | typedef struct 9 | { 10 | char mod[MAX_MODULE_SIZE]; 11 | duint addr; 12 | unsigned char oldbyte; 13 | unsigned char newbyte; 14 | } DBGPATCHINFO; 15 | 16 | typedef struct 17 | { 18 | duint addr; 19 | duint from; 20 | duint to; 21 | char comment[MAX_COMMENT_SIZE]; 22 | } DBGCALLSTACKENTRY; 23 | 24 | typedef struct 25 | { 26 | int total; 27 | DBGCALLSTACKENTRY* entries; 28 | } DBGCALLSTACK; 29 | 30 | typedef struct 31 | { 32 | duint addr; 33 | duint handler; 34 | } DBGSEHRECORD; 35 | 36 | typedef struct 37 | { 38 | duint total; 39 | DBGSEHRECORD* records; 40 | } DBGSEHCHAIN; 41 | 42 | typedef struct 43 | { 44 | DWORD dwProcessId; 45 | char szExeFile[MAX_PATH]; 46 | char szExeMainWindowTitle[MAX_PATH]; 47 | char szExeArgs[MAX_COMMAND_LINE_SIZE]; 48 | } DBGPROCESSINFO; 49 | 50 | typedef struct 51 | { 52 | DWORD rva; 53 | BYTE type; 54 | WORD size; 55 | } DBGRELOCATIONINFO; 56 | 57 | typedef enum 58 | { 59 | InstructionBody = 0, 60 | InstructionHeading = 1, 61 | InstructionTailing = 2, 62 | InstructionOverlapped = 3, // The byte was executed with differing instruction base addresses 63 | DataByte, // This and the following is not implemented yet. 64 | DataWord, 65 | DataDWord, 66 | DataQWord, 67 | DataFloat, 68 | DataDouble, 69 | DataLongDouble, 70 | DataXMM, 71 | DataYMM, 72 | DataMMX, 73 | DataMixed, //the byte is accessed in multiple ways 74 | InstructionDataMixed //the byte is both executed and written 75 | } TRACERECORDBYTETYPE; 76 | 77 | typedef enum 78 | { 79 | TraceRecordNone, 80 | TraceRecordBitExec, 81 | TraceRecordByteWithExecTypeAndCounter, 82 | TraceRecordWordWithExecTypeAndCounter 83 | } TRACERECORDTYPE; 84 | 85 | typedef struct 86 | { 87 | duint Handle; 88 | unsigned char TypeNumber; 89 | unsigned int GrantedAccess; 90 | } HANDLEINFO; 91 | 92 | // The longest ip address is 1234:6789:1234:6789:1234:6789:123.567.901.345 (46 bytes) 93 | #define TCP_ADDR_SIZE 50 94 | 95 | typedef struct 96 | { 97 | char RemoteAddress[TCP_ADDR_SIZE]; 98 | unsigned short RemotePort; 99 | char LocalAddress[TCP_ADDR_SIZE]; 100 | unsigned short LocalPort; 101 | char StateText[TCP_ADDR_SIZE]; 102 | unsigned int State; 103 | } TCPCONNECTIONINFO; 104 | 105 | typedef struct 106 | { 107 | duint handle; 108 | duint parent; 109 | DWORD threadId; 110 | DWORD style; 111 | DWORD styleEx; 112 | duint wndProc; 113 | bool enabled; 114 | RECT position; 115 | char windowTitle[MAX_COMMENT_SIZE]; 116 | char windowClass[MAX_COMMENT_SIZE]; 117 | } WINDOW_INFO; 118 | 119 | typedef struct 120 | { 121 | duint addr; 122 | duint size; 123 | duint flags; 124 | } HEAPINFO; 125 | 126 | typedef struct 127 | { 128 | const char* name; 129 | duint value; 130 | } CONSTANTINFO; 131 | 132 | typedef bool (*ASSEMBLEATEX)(duint addr, const char* instruction, char* error, bool fillnop); 133 | typedef bool (*SECTIONFROMADDR)(duint addr, char* section); 134 | typedef bool (*MODNAMEFROMADDR)(duint addr, char* modname, bool extension); 135 | typedef duint(*MODBASEFROMADDR)(duint addr); 136 | typedef duint(*MODBASEFROMNAME)(const char* modname); 137 | typedef duint(*MODSIZEFROMADDR)(duint addr); 138 | typedef bool (*ASSEMBLE)(duint addr, unsigned char* dest, int* size, const char* instruction, char* error); 139 | typedef bool (*PATCHGET)(duint addr); 140 | typedef bool (*PATCHINRANGE)(duint start, duint end); 141 | typedef bool (*MEMPATCH)(duint va, const unsigned char* src, duint size); 142 | typedef void (*PATCHRESTORERANGE)(duint start, duint end); 143 | typedef bool (*PATCHENUM)(DBGPATCHINFO* patchlist, size_t* cbsize); 144 | typedef bool (*PATCHRESTORE)(duint addr); 145 | typedef int (*PATCHFILE)(DBGPATCHINFO* patchlist, int count, const char* szFileName, char* error); 146 | typedef int (*MODPATHFROMADDR)(duint addr, char* path, int size); 147 | typedef int (*MODPATHFROMNAME)(const char* modname, char* path, int size); 148 | typedef bool (*DISASMFAST)(const unsigned char* data, duint addr, BASIC_INSTRUCTION_INFO* basicinfo); 149 | typedef void (*MEMUPDATEMAP)(); 150 | typedef void (*GETCALLSTACK)(DBGCALLSTACK* callstack); 151 | typedef void (*GETSEHCHAIN)(DBGSEHCHAIN* sehchain); 152 | typedef void (*SYMBOLDOWNLOADALLSYMBOLS)(const char* szSymbolStore); 153 | typedef bool (*GETJIT)(char* jit, bool x64); 154 | typedef bool (*GETJITAUTO)(bool* jitauto); 155 | typedef bool (*GETDEFJIT)(char* defjit); 156 | typedef bool (*GETPROCESSLIST)(DBGPROCESSINFO** entries, int* count); 157 | typedef bool (*GETPAGERIGHTS)(duint addr, char* rights); 158 | typedef bool (*SETPAGERIGHTS)(duint addr, const char* rights); 159 | typedef bool (*PAGERIGHTSTOSTRING)(DWORD protect, char* rights); 160 | typedef bool (*ISPROCESSELEVATED)(); 161 | typedef bool (*GETCMDLINE)(char* cmdline, size_t* cbsize); 162 | typedef bool (*SETCMDLINE)(const char* cmdline); 163 | typedef duint(*FILEOFFSETTOVA)(const char* modname, duint offset); 164 | typedef duint(*VATOFILEOFFSET)(duint va); 165 | typedef duint(*GETADDRFROMLINE)(const char* szSourceFile, int line, duint* displacement); 166 | typedef bool (*GETSOURCEFROMADDR)(duint addr, char* szSourceFile, int* line); 167 | typedef bool (*VALFROMSTRING)(const char* string, duint* value); 168 | typedef bool (*PATCHGETEX)(duint addr, DBGPATCHINFO* info); 169 | typedef bool (*GETBRIDGEBP)(BPXTYPE type, duint addr, BRIDGEBP* bp); 170 | typedef bool (*STRINGFORMATINLINE)(const char* format, size_t resultSize, char* result); 171 | typedef void (*GETMNEMONICBRIEF)(const char* mnem, size_t resultSize, char* result); 172 | typedef unsigned int (*GETTRACERECORDHITCOUNT)(duint address); 173 | typedef TRACERECORDBYTETYPE(*GETTRACERECORDBYTETYPE)(duint address); 174 | typedef bool (*SETTRACERECORDTYPE)(duint pageAddress, TRACERECORDTYPE type); 175 | typedef TRACERECORDTYPE(*GETTRACERECORDTYPE)(duint pageAddress); 176 | typedef bool (*ENUMHANDLES)(ListOf(HANDLEINFO) handles); 177 | typedef bool (*GETHANDLENAME)(duint handle, char* name, size_t nameSize, char* typeName, size_t typeNameSize); 178 | typedef bool (*ENUMTCPCONNECTIONS)(ListOf(TCPCONNECTIONINFO) connections); 179 | typedef duint(*GETDBGEVENTS)(); 180 | typedef int (*MODGETPARTY)(duint base); 181 | typedef void (*MODSETPARTY)(duint base, int party); 182 | typedef bool(*WATCHISWATCHDOGTRIGGERED)(unsigned int id); 183 | typedef bool(*MEMISCODEPAGE)(duint addr, bool refresh); 184 | typedef bool(*ANIMATECOMMAND)(const char* command); 185 | typedef void(*DBGSETDEBUGGEEINITSCRIPT)(const char* fileName); 186 | typedef const char* (*DBGGETDEBUGGEEINITSCRIPT)(); 187 | typedef bool(*HANDLESENUMWINDOWS)(ListOf(WINDOW_INFO) windows); 188 | typedef bool(*HANDLESENUMHEAPS)(ListOf(HEAPINFO) heaps); 189 | typedef bool(*THREADGETNAME)(DWORD tid, char* name); 190 | typedef bool(*ISDEPENABLED)(); 191 | typedef void(*GETCALLSTACKEX)(DBGCALLSTACK* callstack, bool cache); 192 | typedef bool(*GETUSERCOMMENT)(duint addr, char* comment); 193 | typedef void(*ENUMCONSTANTS)(ListOf(CONSTANTINFO) constants); 194 | typedef duint(*MEMBPSIZE)(duint addr); 195 | typedef bool(*MODRELOCATIONSFROMADDR)(duint addr, ListOf(DBGRELOCATIONINFO) relocations); 196 | typedef bool(*MODRELOCATIONATADDR)(duint addr, DBGRELOCATIONINFO* relocation); 197 | typedef bool(*MODRELOCATIONSINRANGE)(duint addr, duint size, ListOf(DBGRELOCATIONINFO) relocations); 198 | typedef duint(*DBGETHASH)(); 199 | typedef int(*SYMAUTOCOMPLETE)(const char* Search, char** Buffer, int MaxSymbols); 200 | typedef void(*REFRESHMODULELIST)(); 201 | typedef duint(*GETADDRFROMLINEEX)(duint mod, const char* szSourceFile, int line); 202 | 203 | //The list of all the DbgFunctions() return value. 204 | //WARNING: This list is append only. Do not insert things in the middle or plugins would break. 205 | typedef struct DBGFUNCTIONS_ 206 | { 207 | ASSEMBLEATEX AssembleAtEx; 208 | SECTIONFROMADDR SectionFromAddr; 209 | MODNAMEFROMADDR ModNameFromAddr; 210 | MODBASEFROMADDR ModBaseFromAddr; 211 | MODBASEFROMNAME ModBaseFromName; 212 | MODSIZEFROMADDR ModSizeFromAddr; 213 | ASSEMBLE Assemble; 214 | PATCHGET PatchGet; 215 | PATCHINRANGE PatchInRange; 216 | MEMPATCH MemPatch; 217 | PATCHRESTORERANGE PatchRestoreRange; 218 | PATCHENUM PatchEnum; 219 | PATCHRESTORE PatchRestore; 220 | PATCHFILE PatchFile; 221 | MODPATHFROMADDR ModPathFromAddr; 222 | MODPATHFROMNAME ModPathFromName; 223 | DISASMFAST DisasmFast; 224 | MEMUPDATEMAP MemUpdateMap; 225 | GETCALLSTACK GetCallStack; 226 | GETSEHCHAIN GetSEHChain; 227 | SYMBOLDOWNLOADALLSYMBOLS SymbolDownloadAllSymbols; 228 | GETJITAUTO GetJitAuto; 229 | GETJIT GetJit; 230 | GETDEFJIT GetDefJit; 231 | GETPROCESSLIST GetProcessList; 232 | GETPAGERIGHTS GetPageRights; 233 | SETPAGERIGHTS SetPageRights; 234 | PAGERIGHTSTOSTRING PageRightsToString; 235 | ISPROCESSELEVATED IsProcessElevated; 236 | GETCMDLINE GetCmdline; 237 | SETCMDLINE SetCmdline; 238 | FILEOFFSETTOVA FileOffsetToVa; 239 | VATOFILEOFFSET VaToFileOffset; 240 | GETADDRFROMLINE GetAddrFromLine; 241 | GETSOURCEFROMADDR GetSourceFromAddr; 242 | VALFROMSTRING ValFromString; 243 | PATCHGETEX PatchGetEx; 244 | GETBRIDGEBP GetBridgeBp; 245 | STRINGFORMATINLINE StringFormatInline; 246 | GETMNEMONICBRIEF GetMnemonicBrief; 247 | GETTRACERECORDHITCOUNT GetTraceRecordHitCount; 248 | GETTRACERECORDBYTETYPE GetTraceRecordByteType; 249 | SETTRACERECORDTYPE SetTraceRecordType; 250 | GETTRACERECORDTYPE GetTraceRecordType; 251 | ENUMHANDLES EnumHandles; 252 | GETHANDLENAME GetHandleName; 253 | ENUMTCPCONNECTIONS EnumTcpConnections; 254 | GETDBGEVENTS GetDbgEvents; 255 | MODGETPARTY ModGetParty; 256 | MODSETPARTY ModSetParty; 257 | WATCHISWATCHDOGTRIGGERED WatchIsWatchdogTriggered; 258 | MEMISCODEPAGE MemIsCodePage; 259 | ANIMATECOMMAND AnimateCommand; 260 | DBGSETDEBUGGEEINITSCRIPT DbgSetDebuggeeInitScript; 261 | DBGGETDEBUGGEEINITSCRIPT DbgGetDebuggeeInitScript; 262 | HANDLESENUMWINDOWS EnumWindows; 263 | HANDLESENUMHEAPS EnumHeaps; 264 | THREADGETNAME ThreadGetName; 265 | ISDEPENABLED IsDepEnabled; 266 | GETCALLSTACKEX GetCallStackEx; 267 | GETUSERCOMMENT GetUserComment; 268 | ENUMCONSTANTS EnumConstants; 269 | ENUMCONSTANTS EnumErrorCodes; 270 | ENUMCONSTANTS EnumExceptions; 271 | MEMBPSIZE MemBpSize; 272 | MODRELOCATIONSFROMADDR ModRelocationsFromAddr; 273 | MODRELOCATIONATADDR ModRelocationAtAddr; 274 | MODRELOCATIONSINRANGE ModRelocationsInRange; 275 | DBGETHASH DbGetHash; 276 | SYMAUTOCOMPLETE SymAutoComplete; 277 | REFRESHMODULELIST RefreshModuleList; 278 | GETADDRFROMLINEEX GetAddrFromLineEx; 279 | } DBGFUNCTIONS; 280 | 281 | #ifdef BUILD_DBG 282 | 283 | const DBGFUNCTIONS* dbgfunctionsget(); 284 | void dbgfunctionsinit(); 285 | 286 | #endif //BUILD_DBG 287 | 288 | #endif //_DBGFUNCTIONS_H 289 | -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_plugin_types.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLUGIN_DATA_H 2 | #define _PLUGIN_DATA_H 3 | 4 | #ifdef BUILD_DBG 5 | 6 | #include "_global.h" 7 | #include "jansson/jansson.h" 8 | #pragma warning(push) 9 | #pragma warning(disable:4091) 10 | #include 11 | #pragma warning(pop) 12 | 13 | #else 14 | 15 | #ifdef __GNUC__ 16 | #include "dbghelp/dbghelp.h" 17 | #else 18 | #pragma warning(push) 19 | #pragma warning(disable:4091) 20 | #include 21 | #pragma warning(pop) 22 | #endif // __GNUC__ 23 | 24 | #ifndef deflen 25 | #define deflen 1024 26 | #endif // deflen 27 | 28 | #include "bridgemain.h" 29 | #include "_dbgfunctions.h" 30 | #include "jansson/jansson.h" 31 | 32 | #endif // BUILD_DBG 33 | 34 | #endif // _PLUGIN_DATA_H 35 | -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_plugins.h: -------------------------------------------------------------------------------- 1 | #ifndef _PLUGINS_H 2 | #define _PLUGINS_H 3 | 4 | #ifndef __cplusplus 5 | #include 6 | #endif 7 | 8 | #ifndef PLUG_IMPEXP 9 | #ifdef BUILD_DBG 10 | #define PLUG_IMPEXP __declspec(dllexport) 11 | #else 12 | #define PLUG_IMPEXP __declspec(dllimport) 13 | #endif //BUILD_DBG 14 | #endif //PLUG_IMPEXP 15 | 16 | #include "_plugin_types.h" 17 | 18 | //default structure alignments forced 19 | #ifdef _WIN64 20 | #pragma pack(push, 16) 21 | #else //x86 22 | #pragma pack(push, 8) 23 | #endif //_WIN64 24 | 25 | //defines 26 | #define PLUG_SDKVERSION 1 27 | 28 | #define PLUG_DB_LOADSAVE_DATA 1 29 | #define PLUG_DB_LOADSAVE_ALL 2 30 | 31 | //structures 32 | typedef struct 33 | { 34 | //provided by the debugger 35 | int pluginHandle; 36 | //provided by the pluginit function 37 | int sdkVersion; 38 | int pluginVersion; 39 | char pluginName[256]; 40 | } PLUG_INITSTRUCT; 41 | 42 | typedef struct 43 | { 44 | //provided by the debugger 45 | HWND hwndDlg; //gui window handle 46 | int hMenu; //plugin menu handle 47 | int hMenuDisasm; //plugin disasm menu handle 48 | int hMenuDump; //plugin dump menu handle 49 | int hMenuStack; //plugin stack menu handle 50 | } PLUG_SETUPSTRUCT; 51 | 52 | typedef struct 53 | { 54 | void* data; //user data 55 | } PLUG_SCRIPTSTRUCT; 56 | 57 | //callback structures 58 | typedef struct 59 | { 60 | const char* szFileName; 61 | } PLUG_CB_INITDEBUG; 62 | 63 | typedef struct 64 | { 65 | void* reserved; 66 | } PLUG_CB_STOPDEBUG; 67 | 68 | typedef struct 69 | { 70 | CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo; 71 | IMAGEHLP_MODULE64* modInfo; 72 | const char* DebugFileName; 73 | PROCESS_INFORMATION* fdProcessInfo; 74 | } PLUG_CB_CREATEPROCESS; 75 | 76 | typedef struct 77 | { 78 | EXIT_PROCESS_DEBUG_INFO* ExitProcess; 79 | } PLUG_CB_EXITPROCESS; 80 | 81 | typedef struct 82 | { 83 | CREATE_THREAD_DEBUG_INFO* CreateThread; 84 | DWORD dwThreadId; 85 | } PLUG_CB_CREATETHREAD; 86 | 87 | typedef struct 88 | { 89 | EXIT_THREAD_DEBUG_INFO* ExitThread; 90 | DWORD dwThreadId; 91 | } PLUG_CB_EXITTHREAD; 92 | 93 | typedef struct 94 | { 95 | void* reserved; 96 | } PLUG_CB_SYSTEMBREAKPOINT; 97 | 98 | typedef struct 99 | { 100 | LOAD_DLL_DEBUG_INFO* LoadDll; 101 | IMAGEHLP_MODULE64* modInfo; 102 | const char* modname; 103 | } PLUG_CB_LOADDLL; 104 | 105 | typedef struct 106 | { 107 | UNLOAD_DLL_DEBUG_INFO* UnloadDll; 108 | } PLUG_CB_UNLOADDLL; 109 | 110 | typedef struct 111 | { 112 | OUTPUT_DEBUG_STRING_INFO* DebugString; 113 | } PLUG_CB_OUTPUTDEBUGSTRING; 114 | 115 | typedef struct 116 | { 117 | EXCEPTION_DEBUG_INFO* Exception; 118 | } PLUG_CB_EXCEPTION; 119 | 120 | typedef struct 121 | { 122 | BRIDGEBP* breakpoint; 123 | } PLUG_CB_BREAKPOINT; 124 | 125 | typedef struct 126 | { 127 | void* reserved; 128 | } PLUG_CB_PAUSEDEBUG; 129 | 130 | typedef struct 131 | { 132 | void* reserved; 133 | } PLUG_CB_RESUMEDEBUG; 134 | 135 | typedef struct 136 | { 137 | void* reserved; 138 | } PLUG_CB_STEPPED; 139 | 140 | typedef struct 141 | { 142 | DWORD dwProcessId; 143 | } PLUG_CB_ATTACH; 144 | 145 | typedef struct 146 | { 147 | PROCESS_INFORMATION* fdProcessInfo; 148 | } PLUG_CB_DETACH; 149 | 150 | typedef struct 151 | { 152 | DEBUG_EVENT* DebugEvent; 153 | } PLUG_CB_DEBUGEVENT; 154 | 155 | typedef struct 156 | { 157 | int hEntry; 158 | } PLUG_CB_MENUENTRY; 159 | 160 | typedef struct 161 | { 162 | MSG* message; 163 | long* result; 164 | bool retval; 165 | } PLUG_CB_WINEVENT; 166 | 167 | typedef struct 168 | { 169 | MSG* message; 170 | bool retval; 171 | } PLUG_CB_WINEVENTGLOBAL; 172 | 173 | typedef struct 174 | { 175 | json_t* root; 176 | int loadSaveType; 177 | } PLUG_CB_LOADSAVEDB; 178 | 179 | typedef struct 180 | { 181 | const char* symbol; 182 | bool retval; 183 | } PLUG_CB_FILTERSYMBOL; 184 | 185 | typedef struct 186 | { 187 | duint cip; 188 | bool stop; 189 | } PLUG_CB_TRACEEXECUTE; 190 | 191 | typedef struct 192 | { 193 | int hWindow; 194 | duint VA; 195 | } PLUG_CB_SELCHANGED; 196 | 197 | typedef struct 198 | { 199 | BridgeCFGraphList graph; 200 | } PLUG_CB_ANALYZE; 201 | 202 | typedef struct 203 | { 204 | duint addr; 205 | BRIDGE_ADDRINFO* addrinfo; 206 | bool retval; 207 | } PLUG_CB_ADDRINFO; 208 | 209 | typedef struct 210 | { 211 | const char* string; 212 | duint value; 213 | int* value_size; 214 | bool* isvar; 215 | bool* hexonly; 216 | bool retval; 217 | } PLUG_CB_VALFROMSTRING; 218 | 219 | typedef struct 220 | { 221 | const char* string; 222 | duint value; 223 | bool retval; 224 | } PLUG_CB_VALTOSTRING; 225 | 226 | typedef struct 227 | { 228 | int hMenu; 229 | } PLUG_CB_MENUPREPARE; 230 | 231 | //enums 232 | typedef enum 233 | { 234 | CB_INITDEBUG, //PLUG_CB_INITDEBUG 235 | CB_STOPDEBUG, //PLUG_CB_STOPDEBUG 236 | CB_CREATEPROCESS, //PLUG_CB_CREATEPROCESS 237 | CB_EXITPROCESS, //PLUG_CB_EXITPROCESS 238 | CB_CREATETHREAD, //PLUG_CB_CREATETHREAD 239 | CB_EXITTHREAD, //PLUG_CB_EXITTHREAD 240 | CB_SYSTEMBREAKPOINT, //PLUG_CB_SYSTEMBREAKPOINT 241 | CB_LOADDLL, //PLUG_CB_LOADDLL 242 | CB_UNLOADDLL, //PLUG_CB_UNLOADDLL 243 | CB_OUTPUTDEBUGSTRING, //PLUG_CB_OUTPUTDEBUGSTRING 244 | CB_EXCEPTION, //PLUG_CB_EXCEPTION 245 | CB_BREAKPOINT, //PLUG_CB_BREAKPOINT 246 | CB_PAUSEDEBUG, //PLUG_CB_PAUSEDEBUG 247 | CB_RESUMEDEBUG, //PLUG_CB_RESUMEDEBUG 248 | CB_STEPPED, //PLUG_CB_STEPPED 249 | CB_ATTACH, //PLUG_CB_ATTACHED (before attaching, after CB_INITDEBUG) 250 | CB_DETACH, //PLUG_CB_DETACH (before detaching, before CB_STOPDEBUG) 251 | CB_DEBUGEVENT, //PLUG_CB_DEBUGEVENT (called on any debug event) 252 | CB_MENUENTRY, //PLUG_CB_MENUENTRY 253 | CB_WINEVENT, //PLUG_CB_WINEVENT 254 | CB_WINEVENTGLOBAL, //PLUG_CB_WINEVENTGLOBAL 255 | CB_LOADDB, //PLUG_CB_LOADSAVEDB 256 | CB_SAVEDB, //PLUG_CB_LOADSAVEDB 257 | CB_FILTERSYMBOL, //PLUG_CB_FILTERSYMBOL 258 | CB_TRACEEXECUTE, //PLUG_CB_TRACEEXECUTE 259 | CB_SELCHANGED, //PLUG_CB_SELCHANGED 260 | CB_ANALYZE, //PLUG_CB_ANALYZE 261 | CB_ADDRINFO, //PLUG_CB_ADDRINFO 262 | CB_VALFROMSTRING, //PLUG_CB_VALFROMSTRING 263 | CB_VALTOSTRING, //PLUG_CB_VALTOSTRING 264 | CB_MENUPREPARE, //PLUG_CB_MENUPREPARE 265 | CB_LAST 266 | } CBTYPE; 267 | 268 | typedef enum 269 | { 270 | FORMAT_ERROR, //generic failure (no message) 271 | FORMAT_SUCCESS, //success 272 | FORMAT_ERROR_MESSAGE, //formatting failed but an error was put in the buffer (there are always at least 511 characters available). 273 | FORMAT_BUFFER_TOO_SMALL //buffer too small (x64dbg will retry until the buffer is big enough) 274 | } FORMATRESULT; 275 | 276 | //typedefs 277 | typedef void (*CBPLUGIN)(CBTYPE cbType, void* callbackInfo); 278 | typedef bool (*CBPLUGINCOMMAND)(int argc, char** argv); 279 | typedef void (*CBPLUGINSCRIPT)(); 280 | typedef duint(*CBPLUGINEXPRFUNCTION)(int argc, duint* argv, void* userdata); 281 | typedef FORMATRESULT(*CBPLUGINFORMATFUNCTION)(char* dest, size_t destCount, int argc, char* argv[], duint value, void* userdata); 282 | typedef bool (*CBPLUGINPREDICATE)(void* userdata); 283 | 284 | //exports 285 | #ifdef __cplusplus 286 | extern "C" 287 | { 288 | #endif 289 | 290 | PLUG_IMPEXP void _plugin_registercallback(int pluginHandle, CBTYPE cbType, CBPLUGIN cbPlugin); 291 | PLUG_IMPEXP bool _plugin_unregistercallback(int pluginHandle, CBTYPE cbType); 292 | PLUG_IMPEXP bool _plugin_registercommand(int pluginHandle, const char* command, CBPLUGINCOMMAND cbCommand, bool debugonly); 293 | PLUG_IMPEXP bool _plugin_unregistercommand(int pluginHandle, const char* command); 294 | PLUG_IMPEXP void _plugin_logprintf(const char* format, ...); 295 | PLUG_IMPEXP void _plugin_logputs(const char* text); 296 | PLUG_IMPEXP void _plugin_logprint(const char* text); 297 | PLUG_IMPEXP void _plugin_debugpause(); 298 | PLUG_IMPEXP void _plugin_debugskipexceptions(bool skip); 299 | PLUG_IMPEXP int _plugin_menuadd(int hMenu, const char* title); 300 | PLUG_IMPEXP bool _plugin_menuaddentry(int hMenu, int hEntry, const char* title); 301 | PLUG_IMPEXP bool _plugin_menuaddseparator(int hMenu); 302 | PLUG_IMPEXP bool _plugin_menuclear(int hMenu); 303 | PLUG_IMPEXP void _plugin_menuseticon(int hMenu, const ICONDATA* icon); 304 | PLUG_IMPEXP void _plugin_menuentryseticon(int pluginHandle, int hEntry, const ICONDATA* icon); 305 | PLUG_IMPEXP void _plugin_menuentrysetchecked(int pluginHandle, int hEntry, bool checked); 306 | PLUG_IMPEXP void _plugin_menusetvisible(int pluginHandle, int hMenu, bool visible); 307 | PLUG_IMPEXP void _plugin_menuentrysetvisible(int pluginHandle, int hEntry, bool visible); 308 | PLUG_IMPEXP void _plugin_menusetname(int pluginHandle, int hMenu, const char* name); 309 | PLUG_IMPEXP void _plugin_menuentrysetname(int pluginHandle, int hEntry, const char* name); 310 | PLUG_IMPEXP void _plugin_menuentrysethotkey(int pluginHandle, int hEntry, const char* hotkey); 311 | PLUG_IMPEXP bool _plugin_menuremove(int hMenu); 312 | PLUG_IMPEXP bool _plugin_menuentryremove(int pluginHandle, int hEntry); 313 | PLUG_IMPEXP void _plugin_startscript(CBPLUGINSCRIPT cbScript); 314 | PLUG_IMPEXP bool _plugin_waituntilpaused(); 315 | PLUG_IMPEXP bool _plugin_registerexprfunction(int pluginHandle, const char* name, int argc, CBPLUGINEXPRFUNCTION cbFunction, void* userdata); 316 | PLUG_IMPEXP bool _plugin_unregisterexprfunction(int pluginHandle, const char* name); 317 | PLUG_IMPEXP bool _plugin_unload(const char* pluginName); 318 | PLUG_IMPEXP bool _plugin_load(const char* pluginName); 319 | PLUG_IMPEXP duint _plugin_hash(const void* data, duint size); 320 | PLUG_IMPEXP bool _plugin_registerformatfunction(int pluginHandle, const char* type, CBPLUGINFORMATFUNCTION cbFunction, void* userdata); 321 | PLUG_IMPEXP bool _plugin_unregisterformatfunction(int pluginHandle, const char* type); 322 | 323 | #ifdef __cplusplus 324 | } 325 | #endif 326 | 327 | #pragma pack(pop) 328 | 329 | #endif // _PLUGINS_H 330 | -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPT_API_H 2 | #define _SCRIPT_API_H 3 | 4 | #include "_plugins.h" 5 | 6 | #define SCRIPT_EXPORT PLUG_IMPEXP 7 | 8 | #endif //_SCRIPT_API_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_argument.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_ARGUMENT_H 2 | #define _SCRIPTAPI_ARGUMENT_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Argument 9 | { 10 | struct ArgumentInfo 11 | { 12 | char mod[MAX_MODULE_SIZE]; 13 | duint rvaStart; 14 | duint rvaEnd; 15 | bool manual; 16 | duint instructioncount; 17 | }; 18 | 19 | SCRIPT_EXPORT bool Add(duint start, duint end, bool manual, duint instructionCount = 0); 20 | SCRIPT_EXPORT bool Add(const ArgumentInfo* info); 21 | SCRIPT_EXPORT bool Get(duint addr, duint* start = nullptr, duint* end = nullptr, duint* instructionCount = nullptr); 22 | SCRIPT_EXPORT bool GetInfo(duint addr, ArgumentInfo* info); 23 | SCRIPT_EXPORT bool Overlaps(duint start, duint end); 24 | SCRIPT_EXPORT bool Delete(duint address); 25 | SCRIPT_EXPORT void DeleteRange(duint start, duint end, bool deleteManual = false); 26 | SCRIPT_EXPORT void Clear(); 27 | SCRIPT_EXPORT bool GetList(ListOf(ArgumentInfo) list); //caller has the responsibility to free the list 28 | }; //Argument 29 | }; //Script 30 | 31 | #endif //_SCRIPTAPI_ARGUMENT_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_assembler.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_ASSEMBLER_H 2 | #define _SCRIPTAPI_ASSEMBLER_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Assembler 9 | { 10 | SCRIPT_EXPORT bool Assemble(duint addr, unsigned char* dest, int* size, const char* instruction); //dest[16] 11 | SCRIPT_EXPORT bool AssembleEx(duint addr, unsigned char* dest, int* size, const char* instruction, char* error); //dest[16], error[MAX_ERROR_SIZE] 12 | SCRIPT_EXPORT bool AssembleMem(duint addr, const char* instruction); 13 | SCRIPT_EXPORT bool AssembleMemEx(duint addr, const char* instruction, int* size, char* error, bool fillnop); //error[MAX_ERROR_SIZE] 14 | }; //Assembler 15 | }; //Script 16 | 17 | #endif //_SCRIPTAPI_ASSEMBLER_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_bookmark.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_BOOKMARK_H 2 | #define _SCRIPTAPI_BOOKMARK_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Bookmark 9 | { 10 | struct BookmarkInfo 11 | { 12 | char mod[MAX_MODULE_SIZE]; 13 | duint rva; 14 | bool manual; 15 | }; 16 | 17 | SCRIPT_EXPORT bool Set(duint addr, bool manual = false); 18 | SCRIPT_EXPORT bool Set(const BookmarkInfo* info); 19 | SCRIPT_EXPORT bool Get(duint addr); 20 | SCRIPT_EXPORT bool GetInfo(duint addr, BookmarkInfo* info); 21 | SCRIPT_EXPORT bool Delete(duint addr); 22 | SCRIPT_EXPORT void DeleteRange(duint start, duint end); 23 | SCRIPT_EXPORT void Clear(); 24 | SCRIPT_EXPORT bool GetList(ListOf(BookmarkInfo) list); //caller has the responsibility to free the list 25 | }; //Bookmark 26 | }; //Script 27 | 28 | #endif //_SCRIPTAPI_BOOKMARK_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_comment.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_COMMENT_H 2 | #define _SCRIPTAPI_COMMENT_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Comment 9 | { 10 | struct CommentInfo 11 | { 12 | char mod[MAX_MODULE_SIZE]; 13 | duint rva; 14 | char text[MAX_LABEL_SIZE]; 15 | bool manual; 16 | }; 17 | 18 | SCRIPT_EXPORT bool Set(duint addr, const char* text, bool manual = false); 19 | SCRIPT_EXPORT bool Set(const CommentInfo* info); 20 | SCRIPT_EXPORT bool Get(duint addr, char* text); //text[MAX_COMMENT_SIZE] 21 | SCRIPT_EXPORT bool GetInfo(duint addr, CommentInfo* info); 22 | SCRIPT_EXPORT bool Delete(duint addr); 23 | SCRIPT_EXPORT void DeleteRange(duint start, duint end); 24 | SCRIPT_EXPORT void Clear(); 25 | SCRIPT_EXPORT bool GetList(ListOf(CommentInfo) list); //caller has the responsibility to free the list 26 | }; //Comment 27 | }; //Script 28 | 29 | #endif //_SCRIPTAPI_COMMENT_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_debug.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_DEBUG_H 2 | #define _SCRIPTAPI_DEBUG_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Debug 9 | { 10 | enum HardwareType 11 | { 12 | HardwareAccess, 13 | HardwareWrite, 14 | HardwareExecute 15 | }; 16 | 17 | SCRIPT_EXPORT void Wait(); 18 | SCRIPT_EXPORT void Run(); 19 | SCRIPT_EXPORT void Pause(); 20 | SCRIPT_EXPORT void Stop(); 21 | SCRIPT_EXPORT void StepIn(); 22 | SCRIPT_EXPORT void StepOver(); 23 | SCRIPT_EXPORT void StepOut(); 24 | SCRIPT_EXPORT bool SetBreakpoint(duint address); 25 | SCRIPT_EXPORT bool DeleteBreakpoint(duint address); 26 | SCRIPT_EXPORT bool DisableBreakpoint(duint address); 27 | SCRIPT_EXPORT bool SetHardwareBreakpoint(duint address, HardwareType type = HardwareExecute); 28 | SCRIPT_EXPORT bool DeleteHardwareBreakpoint(duint address); 29 | }; //Debug 30 | }; //Script 31 | 32 | #endif //_SCRIPTAPI_DEBUG_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_flag.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_FLAG_H 2 | #define _SCRIPTAPI_FLAG_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Flag 9 | { 10 | enum FlagEnum 11 | { 12 | ZF, 13 | OF, 14 | CF, 15 | PF, 16 | SF, 17 | TF, 18 | AF, 19 | DF, 20 | IF 21 | }; 22 | 23 | SCRIPT_EXPORT bool Get(FlagEnum flag); 24 | SCRIPT_EXPORT bool Set(FlagEnum flag, bool value); 25 | 26 | SCRIPT_EXPORT bool GetZF(); 27 | SCRIPT_EXPORT bool SetZF(bool value); 28 | SCRIPT_EXPORT bool GetOF(); 29 | SCRIPT_EXPORT bool SetOF(bool value); 30 | SCRIPT_EXPORT bool GetCF(); 31 | SCRIPT_EXPORT bool SetCF(bool value); 32 | SCRIPT_EXPORT bool GetPF(); 33 | SCRIPT_EXPORT bool SetPF(bool value); 34 | SCRIPT_EXPORT bool GetSF(); 35 | SCRIPT_EXPORT bool SetSF(bool value); 36 | SCRIPT_EXPORT bool GetTF(); 37 | SCRIPT_EXPORT bool SetTF(bool value); 38 | SCRIPT_EXPORT bool GetAF(); 39 | SCRIPT_EXPORT bool SetAF(bool value); 40 | SCRIPT_EXPORT bool GetDF(); 41 | SCRIPT_EXPORT bool SetDF(bool value); 42 | SCRIPT_EXPORT bool GetIF(); 43 | SCRIPT_EXPORT bool SetIF(bool value); 44 | }; 45 | }; 46 | 47 | #endif //_SCRIPTAPI_FLAG_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_function.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_FUNCTION_H 2 | #define _SCRIPTAPI_FUNCTION_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Function 9 | { 10 | struct FunctionInfo 11 | { 12 | char mod[MAX_MODULE_SIZE]; 13 | duint rvaStart; 14 | duint rvaEnd; 15 | bool manual; 16 | duint instructioncount; 17 | }; 18 | 19 | SCRIPT_EXPORT bool Add(duint start, duint end, bool manual, duint instructionCount = 0); 20 | SCRIPT_EXPORT bool Add(const FunctionInfo* info); 21 | SCRIPT_EXPORT bool Get(duint addr, duint* start = nullptr, duint* end = nullptr, duint* instructionCount = nullptr); 22 | SCRIPT_EXPORT bool GetInfo(duint addr, FunctionInfo* info); 23 | SCRIPT_EXPORT bool Overlaps(duint start, duint end); 24 | SCRIPT_EXPORT bool Delete(duint address); 25 | SCRIPT_EXPORT void DeleteRange(duint start, duint end, bool deleteManual); 26 | SCRIPT_EXPORT void DeleteRange(duint start, duint end); 27 | SCRIPT_EXPORT void Clear(); 28 | SCRIPT_EXPORT bool GetList(ListOf(FunctionInfo) list); //caller has the responsibility to free the list 29 | }; //Function 30 | }; //Script 31 | 32 | #endif //_SCRIPTAPI_FUNCTION_H 33 | -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_gui.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_GUI_H 2 | #define _SCRIPTAPI_GUI_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Gui 9 | { 10 | namespace Disassembly 11 | { 12 | SCRIPT_EXPORT bool SelectionGet(duint* start, duint* end); 13 | SCRIPT_EXPORT bool SelectionSet(duint start, duint end); 14 | SCRIPT_EXPORT duint SelectionGetStart(); 15 | SCRIPT_EXPORT duint SelectionGetEnd(); 16 | }; //Disassembly 17 | 18 | namespace Dump 19 | { 20 | SCRIPT_EXPORT bool SelectionGet(duint* start, duint* end); 21 | SCRIPT_EXPORT bool SelectionSet(duint start, duint end); 22 | SCRIPT_EXPORT duint SelectionGetStart(); 23 | SCRIPT_EXPORT duint SelectionGetEnd(); 24 | }; //Dump 25 | 26 | namespace Stack 27 | { 28 | SCRIPT_EXPORT bool SelectionGet(duint* start, duint* end); 29 | SCRIPT_EXPORT bool SelectionSet(duint start, duint end); 30 | SCRIPT_EXPORT duint SelectionGetStart(); 31 | SCRIPT_EXPORT duint SelectionGetEnd(); 32 | }; //Stack 33 | 34 | namespace Graph 35 | { 36 | SCRIPT_EXPORT duint SelectionGetStart(); 37 | }; //Graph 38 | 39 | namespace MemMap 40 | { 41 | SCRIPT_EXPORT duint SelectionGetStart(); 42 | }; //MemoryMap 43 | 44 | namespace SymMod 45 | { 46 | SCRIPT_EXPORT duint SelectionGetStart(); 47 | }; //SymMod 48 | }; //Gui 49 | 50 | namespace Gui 51 | { 52 | enum Window 53 | { 54 | DisassemblyWindow, 55 | DumpWindow, 56 | StackWindow, 57 | GraphWindow, 58 | MemMapWindow, 59 | SymModWindow 60 | }; 61 | 62 | SCRIPT_EXPORT bool SelectionGet(Window window, duint* start, duint* end); 63 | SCRIPT_EXPORT bool SelectionSet(Window window, duint start, duint end); 64 | SCRIPT_EXPORT duint SelectionGetStart(Window window); 65 | SCRIPT_EXPORT duint SelectionGetEnd(Window window); 66 | SCRIPT_EXPORT void Message(const char* message); 67 | SCRIPT_EXPORT bool MessageYesNo(const char* message); 68 | SCRIPT_EXPORT bool InputLine(const char* title, char* text); //text[GUI_MAX_LINE_SIZE] 69 | SCRIPT_EXPORT bool InputValue(const char* title, duint* value); 70 | SCRIPT_EXPORT void Refresh(); 71 | SCRIPT_EXPORT void AddQWidgetTab(void* qWidget); 72 | SCRIPT_EXPORT void ShowQWidgetTab(void* qWidget); 73 | SCRIPT_EXPORT void CloseQWidgetTab(void* qWidget); 74 | 75 | }; //Gui 76 | }; //Script 77 | 78 | #endif //_SCRIPTAPI_GUI_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_label.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_LABEL_H 2 | #define _SCRIPTAPI_LABEL_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Label 9 | { 10 | struct LabelInfo 11 | { 12 | char mod[MAX_MODULE_SIZE]; 13 | duint rva; 14 | char text[MAX_LABEL_SIZE]; 15 | bool manual; 16 | }; 17 | 18 | SCRIPT_EXPORT bool Set(duint addr, const char* text, bool manual = false); 19 | SCRIPT_EXPORT bool Set(const LabelInfo* info); 20 | SCRIPT_EXPORT bool FromString(const char* label, duint* addr); 21 | SCRIPT_EXPORT bool Get(duint addr, char* text); //text[MAX_LABEL_SIZE] 22 | SCRIPT_EXPORT bool GetInfo(duint addr, LabelInfo* info); 23 | SCRIPT_EXPORT bool Delete(duint addr); 24 | SCRIPT_EXPORT void DeleteRange(duint start, duint end); 25 | SCRIPT_EXPORT void Clear(); 26 | SCRIPT_EXPORT bool GetList(ListOf(LabelInfo) list); //caller has the responsibility to free the list 27 | }; //Label 28 | }; //Script 29 | 30 | #endif //_SCRIPTAPI_LABEL_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_memory.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_MEMORY_H 2 | #define _SCRIPTAPI_MEMORY_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Memory 9 | { 10 | SCRIPT_EXPORT bool Read(duint addr, void* data, duint size, duint* sizeRead); 11 | SCRIPT_EXPORT bool Write(duint addr, const void* data, duint size, duint* sizeWritten); 12 | SCRIPT_EXPORT bool IsValidPtr(duint addr); 13 | SCRIPT_EXPORT duint RemoteAlloc(duint addr, duint size); 14 | SCRIPT_EXPORT bool RemoteFree(duint addr); 15 | SCRIPT_EXPORT unsigned int GetProtect(duint addr, bool reserved = false, bool cache = true); 16 | SCRIPT_EXPORT duint GetBase(duint addr, bool reserved = false, bool cache = true); 17 | SCRIPT_EXPORT duint GetSize(duint addr, bool reserved = false, bool cache = true); 18 | 19 | SCRIPT_EXPORT unsigned char ReadByte(duint addr); 20 | SCRIPT_EXPORT bool WriteByte(duint addr, unsigned char data); 21 | SCRIPT_EXPORT unsigned short ReadWord(duint addr); 22 | SCRIPT_EXPORT bool WriteWord(duint addr, unsigned short data); 23 | SCRIPT_EXPORT unsigned int ReadDword(duint addr); 24 | SCRIPT_EXPORT bool WriteDword(duint addr, unsigned int data); 25 | SCRIPT_EXPORT unsigned long long ReadQword(duint addr); 26 | SCRIPT_EXPORT bool WriteQword(duint addr, unsigned long long data); 27 | SCRIPT_EXPORT duint ReadPtr(duint addr); 28 | SCRIPT_EXPORT bool WritePtr(duint addr, duint data); 29 | }; //Memory 30 | }; //Script 31 | 32 | #endif //_SCRIPTAPI_MEMORY_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_misc.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_MISC_H 2 | #define _SCRIPTAPI_MISC_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Misc 9 | { 10 | /// 11 | /// Evaluates an expression and returns the result. Analagous to using the Command field in x64dbg. 12 | /// 13 | /// Expressions can consist of memory locations, registers, flags, API names, labels, symbols, variables etc. 14 | /// 15 | /// Example: bool success = ParseExpression("[esp+8]", &val) 16 | /// 17 | /// The expression to evaluate. 18 | /// The result of the expression. 19 | /// True on success, False on failure. 20 | SCRIPT_EXPORT bool ParseExpression(const char* expression, duint* value); 21 | 22 | /// 23 | /// Returns the address of a function in the debuggee's memory space. 24 | /// 25 | /// Example: duint addr = RemoteGetProcAddress("kernel32.dll", "GetProcAddress") 26 | /// 27 | /// The name of the module. 28 | /// The name of the function. 29 | /// The address of the function in the debuggee. 30 | SCRIPT_EXPORT duint RemoteGetProcAddress(const char* module, const char* api); 31 | 32 | /// 33 | /// Returns the address for a label created in the disassembly window. 34 | /// 35 | /// Example: duint addr = ResolveLabel("sneaky_crypto") 36 | /// 37 | /// The name of the label to resolve. 38 | /// The memory address for the label. 39 | SCRIPT_EXPORT duint ResolveLabel(const char* label); 40 | 41 | /// 42 | /// Allocates the requested number of bytes from x64dbg's default process heap. 43 | /// 44 | /// Note: this allocation is in the debugger, not the debuggee. 45 | /// 46 | /// Memory allocated using this function should be Free'd after use. 47 | /// 48 | /// Example: void* addr = Alloc(0x100000) 49 | /// 50 | /// Number of bytes to allocate. 51 | /// A pointer to the newly allocated memory. 52 | SCRIPT_EXPORT void* Alloc(duint size); 53 | 54 | /// 55 | /// Frees memory previously allocated by Alloc. 56 | /// 57 | /// Example: Free(addr) 58 | /// 59 | /// Pointer returned by Alloc. 60 | /// Nothing. 61 | SCRIPT_EXPORT void Free(void* ptr); 62 | }; //Misc 63 | }; //Script 64 | 65 | #endif //_SCRIPTAPI_MISC_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_module.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_MODULE_H 2 | #define _SCRIPTAPI_MODULE_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Module 9 | { 10 | struct ModuleInfo 11 | { 12 | duint base; 13 | duint size; 14 | duint entry; 15 | int sectionCount; 16 | char name[MAX_MODULE_SIZE]; 17 | char path[MAX_PATH]; 18 | }; 19 | 20 | struct ModuleSectionInfo 21 | { 22 | duint addr; 23 | duint size; 24 | char name[MAX_SECTION_SIZE * 5]; 25 | }; 26 | 27 | struct ModuleExport 28 | { 29 | duint ordinal; 30 | duint rva; 31 | duint va; 32 | bool forwarded; 33 | char forwardName[MAX_STRING_SIZE]; 34 | char name[MAX_STRING_SIZE]; 35 | char undecoratedName[MAX_STRING_SIZE]; 36 | }; 37 | 38 | struct ModuleImport 39 | { 40 | duint iatRva; 41 | duint iatVa; 42 | duint ordinal; //equal to -1 if imported by name 43 | char name[MAX_STRING_SIZE]; 44 | char undecoratedName[MAX_STRING_SIZE]; 45 | }; 46 | 47 | SCRIPT_EXPORT bool InfoFromAddr(duint addr, ModuleInfo* info); 48 | SCRIPT_EXPORT bool InfoFromName(const char* name, ModuleInfo* info); 49 | SCRIPT_EXPORT duint BaseFromAddr(duint addr); 50 | SCRIPT_EXPORT duint BaseFromName(const char* name); 51 | SCRIPT_EXPORT duint SizeFromAddr(duint addr); 52 | SCRIPT_EXPORT duint SizeFromName(const char* name); 53 | SCRIPT_EXPORT bool NameFromAddr(duint addr, char* name); //name[MAX_MODULE_SIZE] 54 | SCRIPT_EXPORT bool PathFromAddr(duint addr, char* path); //path[MAX_PATH] 55 | SCRIPT_EXPORT bool PathFromName(const char* name, char* path); //path[MAX_PATH] 56 | SCRIPT_EXPORT duint EntryFromAddr(duint addr); 57 | SCRIPT_EXPORT duint EntryFromName(const char* name); 58 | SCRIPT_EXPORT int SectionCountFromAddr(duint addr); 59 | SCRIPT_EXPORT int SectionCountFromName(const char* name); 60 | SCRIPT_EXPORT bool SectionFromAddr(duint addr, int number, ModuleSectionInfo* section); 61 | SCRIPT_EXPORT bool SectionFromName(const char* name, int number, ModuleSectionInfo* section); 62 | SCRIPT_EXPORT bool SectionListFromAddr(duint addr, ListOf(ModuleSectionInfo) list); 63 | SCRIPT_EXPORT bool SectionListFromName(const char* name, ListOf(ModuleSectionInfo) list); 64 | SCRIPT_EXPORT bool GetMainModuleInfo(ModuleInfo* info); 65 | SCRIPT_EXPORT duint GetMainModuleBase(); 66 | SCRIPT_EXPORT duint GetMainModuleSize(); 67 | SCRIPT_EXPORT duint GetMainModuleEntry(); 68 | SCRIPT_EXPORT int GetMainModuleSectionCount(); 69 | SCRIPT_EXPORT bool GetMainModuleName(char* name); //name[MAX_MODULE_SIZE] 70 | SCRIPT_EXPORT bool GetMainModulePath(char* path); //path[MAX_PATH] 71 | SCRIPT_EXPORT bool GetMainModuleSectionList(ListOf(ModuleSectionInfo) list); //caller has the responsibility to free the list 72 | SCRIPT_EXPORT bool GetList(ListOf(ModuleInfo) list); //caller has the responsibility to free the list 73 | SCRIPT_EXPORT bool GetExports(const ModuleInfo* mod, ListOf(ModuleExport) list); //caller has the responsibility to free the list 74 | SCRIPT_EXPORT bool GetImports(const ModuleInfo* mod, ListOf(ModuleImport) list); //caller has the responsibility to free the list 75 | }; //Module 76 | }; //Script 77 | 78 | #endif //_SCRIPTAPI_MODULE_H 79 | -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_pattern.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_PATTERN_H 2 | #define _SCRIPTAPI_PATTERN_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Pattern 9 | { 10 | SCRIPT_EXPORT duint Find(unsigned char* data, duint datasize, const char* pattern); 11 | SCRIPT_EXPORT duint FindMem(duint start, duint size, const char* pattern); 12 | SCRIPT_EXPORT void Write(unsigned char* data, duint datasize, const char* pattern); 13 | SCRIPT_EXPORT void WriteMem(duint start, duint size, const char* pattern); 14 | SCRIPT_EXPORT bool SearchAndReplace(unsigned char* data, duint datasize, const char* searchpattern, const char* replacepattern); 15 | SCRIPT_EXPORT bool SearchAndReplaceMem(duint start, duint size, const char* searchpattern, const char* replacepattern); 16 | }; 17 | }; 18 | 19 | #endif //_SCRIPTAPI_FIND_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_register.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_REGISTER_H 2 | #define _SCRIPTAPI_REGISTER_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Register 9 | { 10 | enum RegisterEnum 11 | { 12 | DR0, 13 | DR1, 14 | DR2, 15 | DR3, 16 | DR6, 17 | DR7, 18 | 19 | EAX, 20 | AX, 21 | AH, 22 | AL, 23 | EBX, 24 | BX, 25 | BH, 26 | BL, 27 | ECX, 28 | CX, 29 | CH, 30 | CL, 31 | EDX, 32 | DX, 33 | DH, 34 | DL, 35 | EDI, 36 | DI, 37 | ESI, 38 | SI, 39 | EBP, 40 | BP, 41 | ESP, 42 | SP, 43 | EIP, 44 | 45 | #ifdef _WIN64 46 | RAX, 47 | RBX, 48 | RCX, 49 | RDX, 50 | RSI, 51 | SIL, 52 | RDI, 53 | DIL, 54 | RBP, 55 | BPL, 56 | RSP, 57 | SPL, 58 | RIP, 59 | R8, 60 | R8D, 61 | R8W, 62 | R8B, 63 | R9, 64 | R9D, 65 | R9W, 66 | R9B, 67 | R10, 68 | R10D, 69 | R10W, 70 | R10B, 71 | R11, 72 | R11D, 73 | R11W, 74 | R11B, 75 | R12, 76 | R12D, 77 | R12W, 78 | R12B, 79 | R13, 80 | R13D, 81 | R13W, 82 | R13B, 83 | R14, 84 | R14D, 85 | R14W, 86 | R14B, 87 | R15, 88 | R15D, 89 | R15W, 90 | R15B, 91 | #endif //_WIN64 92 | 93 | CIP, 94 | CSP, 95 | CAX, 96 | CBX, 97 | CCX, 98 | CDX, 99 | CDI, 100 | CSI, 101 | CBP, 102 | CFLAGS 103 | }; //RegisterEnum 104 | 105 | SCRIPT_EXPORT duint Get(RegisterEnum reg); 106 | SCRIPT_EXPORT bool Set(RegisterEnum reg, duint value); 107 | SCRIPT_EXPORT int Size(); //gets architecture register size in bytes 108 | 109 | SCRIPT_EXPORT duint GetDR0(); 110 | SCRIPT_EXPORT bool SetDR0(duint value); 111 | SCRIPT_EXPORT duint GetDR1(); 112 | SCRIPT_EXPORT bool SetDR1(duint value); 113 | SCRIPT_EXPORT duint GetDR2(); 114 | SCRIPT_EXPORT bool SetDR2(duint value); 115 | SCRIPT_EXPORT duint GetDR3(); 116 | SCRIPT_EXPORT bool SetDR3(duint value); 117 | SCRIPT_EXPORT duint GetDR6(); 118 | SCRIPT_EXPORT bool SetDR6(duint value); 119 | SCRIPT_EXPORT duint GetDR7(); 120 | SCRIPT_EXPORT bool SetDR7(duint value); 121 | 122 | SCRIPT_EXPORT unsigned int GetEAX(); 123 | SCRIPT_EXPORT bool SetEAX(unsigned int value); 124 | SCRIPT_EXPORT unsigned short GetAX(); 125 | SCRIPT_EXPORT bool SetAX(unsigned short value); 126 | SCRIPT_EXPORT unsigned char GetAH(); 127 | SCRIPT_EXPORT bool SetAH(unsigned char value); 128 | SCRIPT_EXPORT unsigned char GetAL(); 129 | SCRIPT_EXPORT bool SetAL(unsigned char value); 130 | SCRIPT_EXPORT unsigned int GetEBX(); 131 | SCRIPT_EXPORT bool SetEBX(unsigned int value); 132 | SCRIPT_EXPORT unsigned short GetBX(); 133 | SCRIPT_EXPORT bool SetBX(unsigned short value); 134 | SCRIPT_EXPORT unsigned char GetBH(); 135 | SCRIPT_EXPORT bool SetBH(unsigned char value); 136 | SCRIPT_EXPORT unsigned char GetBL(); 137 | SCRIPT_EXPORT bool SetBL(unsigned char value); 138 | SCRIPT_EXPORT unsigned int GetECX(); 139 | SCRIPT_EXPORT bool SetECX(unsigned int value); 140 | SCRIPT_EXPORT unsigned short GetCX(); 141 | SCRIPT_EXPORT bool SetCX(unsigned short value); 142 | SCRIPT_EXPORT unsigned char GetCH(); 143 | SCRIPT_EXPORT bool SetCH(unsigned char value); 144 | SCRIPT_EXPORT unsigned char GetCL(); 145 | SCRIPT_EXPORT bool SetCL(unsigned char value); 146 | SCRIPT_EXPORT unsigned int GetEDX(); 147 | SCRIPT_EXPORT bool SetEDX(unsigned int value); 148 | SCRIPT_EXPORT unsigned short GetDX(); 149 | SCRIPT_EXPORT bool SetDX(unsigned short value); 150 | SCRIPT_EXPORT unsigned char GetDH(); 151 | SCRIPT_EXPORT bool SetDH(unsigned char value); 152 | SCRIPT_EXPORT unsigned char GetDL(); 153 | SCRIPT_EXPORT bool SetDL(unsigned char value); 154 | SCRIPT_EXPORT unsigned int GetEDI(); 155 | SCRIPT_EXPORT bool SetEDI(unsigned int value); 156 | SCRIPT_EXPORT unsigned short GetDI(); 157 | SCRIPT_EXPORT bool SetDI(unsigned short value); 158 | SCRIPT_EXPORT unsigned int GetESI(); 159 | SCRIPT_EXPORT bool SetESI(unsigned int value); 160 | SCRIPT_EXPORT unsigned short GetSI(); 161 | SCRIPT_EXPORT bool SetSI(unsigned short value); 162 | SCRIPT_EXPORT unsigned int GetEBP(); 163 | SCRIPT_EXPORT bool SetEBP(unsigned int value); 164 | SCRIPT_EXPORT unsigned short GetBP(); 165 | SCRIPT_EXPORT bool SetBP(unsigned short value); 166 | SCRIPT_EXPORT unsigned int GetESP(); 167 | SCRIPT_EXPORT bool SetESP(unsigned int value); 168 | SCRIPT_EXPORT unsigned short GetSP(); 169 | SCRIPT_EXPORT bool SetSP(unsigned short value); 170 | SCRIPT_EXPORT unsigned int GetEIP(); 171 | SCRIPT_EXPORT bool SetEIP(unsigned int value); 172 | 173 | #ifdef _WIN64 174 | SCRIPT_EXPORT unsigned long long GetRAX(); 175 | SCRIPT_EXPORT bool SetRAX(unsigned long long value); 176 | SCRIPT_EXPORT unsigned long long GetRBX(); 177 | SCRIPT_EXPORT bool SetRBX(unsigned long long value); 178 | SCRIPT_EXPORT unsigned long long GetRCX(); 179 | SCRIPT_EXPORT bool SetRCX(unsigned long long value); 180 | SCRIPT_EXPORT unsigned long long GetRDX(); 181 | SCRIPT_EXPORT bool SetRDX(unsigned long long value); 182 | SCRIPT_EXPORT unsigned long long GetRSI(); 183 | SCRIPT_EXPORT bool SetRSI(unsigned long long value); 184 | SCRIPT_EXPORT unsigned char GetSIL(); 185 | SCRIPT_EXPORT bool SetSIL(unsigned char value); 186 | SCRIPT_EXPORT unsigned long long GetRDI(); 187 | SCRIPT_EXPORT bool SetRDI(unsigned long long value); 188 | SCRIPT_EXPORT unsigned char GetDIL(); 189 | SCRIPT_EXPORT bool SetDIL(unsigned char value); 190 | SCRIPT_EXPORT unsigned long long GetRBP(); 191 | SCRIPT_EXPORT bool SetRBP(unsigned long long value); 192 | SCRIPT_EXPORT unsigned char GetBPL(); 193 | SCRIPT_EXPORT bool SetBPL(unsigned char value); 194 | SCRIPT_EXPORT unsigned long long GetRSP(); 195 | SCRIPT_EXPORT bool SetRSP(unsigned long long value); 196 | SCRIPT_EXPORT unsigned char GetSPL(); 197 | SCRIPT_EXPORT bool SetSPL(unsigned char value); 198 | SCRIPT_EXPORT unsigned long long GetRIP(); 199 | SCRIPT_EXPORT bool SetRIP(unsigned long long value); 200 | SCRIPT_EXPORT unsigned long long GetR8(); 201 | SCRIPT_EXPORT bool SetR8(unsigned long long value); 202 | SCRIPT_EXPORT unsigned int GetR8D(); 203 | SCRIPT_EXPORT bool SetR8D(unsigned int value); 204 | SCRIPT_EXPORT unsigned short GetR8W(); 205 | SCRIPT_EXPORT bool SetR8W(unsigned short value); 206 | SCRIPT_EXPORT unsigned char GetR8B(); 207 | SCRIPT_EXPORT bool SetR8B(unsigned char value); 208 | SCRIPT_EXPORT unsigned long long GetR9(); 209 | SCRIPT_EXPORT bool SetR9(unsigned long long value); 210 | SCRIPT_EXPORT unsigned int GetR9D(); 211 | SCRIPT_EXPORT bool SetR9D(unsigned int value); 212 | SCRIPT_EXPORT unsigned short GetR9W(); 213 | SCRIPT_EXPORT bool SetR9W(unsigned short value); 214 | SCRIPT_EXPORT unsigned char GetR9B(); 215 | SCRIPT_EXPORT bool SetR9B(unsigned char value); 216 | SCRIPT_EXPORT unsigned long long GetR10(); 217 | SCRIPT_EXPORT bool SetR10(unsigned long long value); 218 | SCRIPT_EXPORT unsigned int GetR10D(); 219 | SCRIPT_EXPORT bool SetR10D(unsigned int value); 220 | SCRIPT_EXPORT unsigned short GetR10W(); 221 | SCRIPT_EXPORT bool SetR10W(unsigned short value); 222 | SCRIPT_EXPORT unsigned char GetR10B(); 223 | SCRIPT_EXPORT bool SetR10B(unsigned char value); 224 | SCRIPT_EXPORT unsigned long long GetR11(); 225 | SCRIPT_EXPORT bool SetR11(unsigned long long value); 226 | SCRIPT_EXPORT unsigned int GetR11D(); 227 | SCRIPT_EXPORT bool SetR11D(unsigned int value); 228 | SCRIPT_EXPORT unsigned short GetR11W(); 229 | SCRIPT_EXPORT bool SetR11W(unsigned short value); 230 | SCRIPT_EXPORT unsigned char GetR11B(); 231 | SCRIPT_EXPORT bool SetR11B(unsigned char value); 232 | SCRIPT_EXPORT unsigned long long GetR12(); 233 | SCRIPT_EXPORT bool SetR12(unsigned long long value); 234 | SCRIPT_EXPORT unsigned int GetR12D(); 235 | SCRIPT_EXPORT bool SetR12D(unsigned int value); 236 | SCRIPT_EXPORT unsigned short GetR12W(); 237 | SCRIPT_EXPORT bool SetR12W(unsigned short value); 238 | SCRIPT_EXPORT unsigned char GetR12B(); 239 | SCRIPT_EXPORT bool SetR12B(unsigned char value); 240 | SCRIPT_EXPORT unsigned long long GetR13(); 241 | SCRIPT_EXPORT bool SetR13(unsigned long long value); 242 | SCRIPT_EXPORT unsigned int GetR13D(); 243 | SCRIPT_EXPORT bool SetR13D(unsigned int value); 244 | SCRIPT_EXPORT unsigned short GetR13W(); 245 | SCRIPT_EXPORT bool SetR13W(unsigned short value); 246 | SCRIPT_EXPORT unsigned char GetR13B(); 247 | SCRIPT_EXPORT bool SetR13B(unsigned char value); 248 | SCRIPT_EXPORT unsigned long long GetR14(); 249 | SCRIPT_EXPORT bool SetR14(unsigned long long value); 250 | SCRIPT_EXPORT unsigned int GetR14D(); 251 | SCRIPT_EXPORT bool SetR14D(unsigned int value); 252 | SCRIPT_EXPORT unsigned short GetR14W(); 253 | SCRIPT_EXPORT bool SetR14W(unsigned short value); 254 | SCRIPT_EXPORT unsigned char GetR14B(); 255 | SCRIPT_EXPORT bool SetR14B(unsigned char value); 256 | SCRIPT_EXPORT unsigned long long GetR15(); 257 | SCRIPT_EXPORT bool SetR15(unsigned long long value); 258 | SCRIPT_EXPORT unsigned int GetR15D(); 259 | SCRIPT_EXPORT bool SetR15D(unsigned int value); 260 | SCRIPT_EXPORT unsigned short GetR15W(); 261 | SCRIPT_EXPORT bool SetR15W(unsigned short value); 262 | SCRIPT_EXPORT unsigned char GetR15B(); 263 | SCRIPT_EXPORT bool SetR15B(unsigned char value); 264 | #endif //_WIN64 265 | 266 | SCRIPT_EXPORT duint GetCAX(); 267 | SCRIPT_EXPORT bool SetCAX(duint value); 268 | SCRIPT_EXPORT duint GetCBX(); 269 | SCRIPT_EXPORT bool SetCBX(duint value); 270 | SCRIPT_EXPORT duint GetCCX(); 271 | SCRIPT_EXPORT bool SetCCX(duint value); 272 | SCRIPT_EXPORT duint GetCDX(); 273 | SCRIPT_EXPORT bool SetCDX(duint value); 274 | SCRIPT_EXPORT duint GetCDI(); 275 | SCRIPT_EXPORT bool SetCDI(duint value); 276 | SCRIPT_EXPORT duint GetCSI(); 277 | SCRIPT_EXPORT bool SetCSI(duint value); 278 | SCRIPT_EXPORT duint GetCBP(); 279 | SCRIPT_EXPORT bool SetCBP(duint value); 280 | SCRIPT_EXPORT duint GetCSP(); 281 | SCRIPT_EXPORT bool SetCSP(duint value); 282 | SCRIPT_EXPORT duint GetCIP(); 283 | SCRIPT_EXPORT bool SetCIP(duint value); 284 | SCRIPT_EXPORT duint GetCFLAGS(); 285 | SCRIPT_EXPORT bool SetCFLAGS(duint value); 286 | }; //Register 287 | }; //Script 288 | 289 | #endif //_SCRIPTAPI_REGISTER_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_stack.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_STACK_H 2 | #define _SCRIPTAPI_STACK_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Stack 9 | { 10 | SCRIPT_EXPORT duint Pop(); 11 | SCRIPT_EXPORT duint Push(duint value); //returns the previous top, equal to Peek(1) 12 | SCRIPT_EXPORT duint Peek(int offset = 0); //offset is in multiples of Register::Size(), for easy x32/x64 portability 13 | }; //Stack 14 | }; //Script 15 | 16 | #endif //_SCRIPTAPI_STACK_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/_scriptapi_symbol.h: -------------------------------------------------------------------------------- 1 | #ifndef _SCRIPTAPI_SYMBOL_H 2 | #define _SCRIPTAPI_SYMBOL_H 3 | 4 | #include "_scriptapi.h" 5 | 6 | namespace Script 7 | { 8 | namespace Symbol 9 | { 10 | enum SymbolType 11 | { 12 | Function, //user-defined function 13 | Import, //IAT entry 14 | Export //export 15 | }; 16 | 17 | struct SymbolInfo 18 | { 19 | char mod[MAX_MODULE_SIZE]; 20 | duint rva; 21 | char name[MAX_LABEL_SIZE]; 22 | bool manual; 23 | SymbolType type; 24 | }; 25 | 26 | SCRIPT_EXPORT bool GetList(ListOf(SymbolInfo) list); //caller has the responsibility to free the list 27 | }; //Symbol 28 | }; //Script 29 | 30 | #endif //_SCRIPTAPI_SYMBOL_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/bridgegraph.h: -------------------------------------------------------------------------------- 1 | #ifndef _GRAPH_H 2 | #define _GRAPH_H 3 | 4 | typedef struct 5 | { 6 | duint addr; //virtual address of the instruction 7 | unsigned char data[15]; //instruction bytes 8 | } BridgeCFInstruction; 9 | 10 | typedef struct 11 | { 12 | duint parentGraph; //function of which this node is a part 13 | duint start; //start of the block 14 | duint end; //end of the block (inclusive) 15 | duint brtrue; //destination if condition is true 16 | duint brfalse; //destination if condition is false 17 | duint icount; //number of instructions in node 18 | bool terminal; //node is a RET 19 | bool split; //node is a split (brtrue points to the next node) 20 | bool indirectcall; //node contains indirect calls (call reg, call [reg+X]) 21 | void* userdata; //user data 22 | ListInfo exits; //exits (including brtrue and brfalse, duint) 23 | ListInfo instrs; //block instructions 24 | } BridgeCFNodeList; 25 | 26 | typedef struct 27 | { 28 | duint entryPoint; //graph entry point 29 | void* userdata; //user data 30 | ListInfo nodes; //graph nodes (BridgeCFNodeList) 31 | } BridgeCFGraphList; 32 | 33 | #ifdef __cplusplus 34 | #if _MSC_VER >= 1700 && !defined(NO_CPP11) 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | struct BridgeCFNode 42 | { 43 | duint parentGraph; //function of which this node is a part 44 | duint start; //start of the block 45 | duint end; //end of the block (inclusive) 46 | duint brtrue; //destination if condition is true 47 | duint brfalse; //destination if condition is false 48 | duint icount; //number of instructions in node 49 | bool terminal; //node is a RET 50 | bool split; //node is a split (brtrue points to the next node) 51 | bool indirectcall; //node contains indirect calls (call reg, call [reg+X]) 52 | void* userdata; //user data 53 | std::vector exits; //exits (including brtrue and brfalse) 54 | std::vector instrs; //block instructions 55 | 56 | static void Free(const BridgeCFNodeList* nodeList) 57 | { 58 | if(!BridgeList::Free(&nodeList->exits)) 59 | __debugbreak(); 60 | if(!BridgeList::Free(&nodeList->instrs)) 61 | __debugbreak(); 62 | } 63 | 64 | explicit BridgeCFNode(const BridgeCFNodeList* nodeList, bool freedata) 65 | { 66 | if(!nodeList) 67 | __debugbreak(); 68 | parentGraph = nodeList->parentGraph; 69 | start = nodeList->start; 70 | end = nodeList->end; 71 | brtrue = nodeList->brtrue; 72 | brfalse = nodeList->brfalse; 73 | icount = nodeList->icount; 74 | terminal = nodeList->terminal; 75 | indirectcall = nodeList->indirectcall; 76 | split = nodeList->split; 77 | userdata = nodeList->userdata; 78 | if(!BridgeList::ToVector(&nodeList->exits, exits, freedata)) 79 | __debugbreak(); 80 | if(!BridgeList::ToVector(&nodeList->instrs, instrs, freedata)) 81 | __debugbreak(); 82 | } 83 | 84 | explicit BridgeCFNode(duint parentGraph, duint start, duint end) 85 | : parentGraph(parentGraph), 86 | start(start), 87 | end(end), 88 | brtrue(0), 89 | brfalse(0), 90 | icount(0), 91 | terminal(false), 92 | indirectcall(false), 93 | split(false), 94 | userdata(nullptr) 95 | { 96 | } 97 | 98 | explicit BridgeCFNode() 99 | : parentGraph(0), 100 | start(0), 101 | end(0), 102 | brtrue(0), 103 | brfalse(0), 104 | icount(0), 105 | terminal(false), 106 | split(false), 107 | userdata(nullptr) 108 | { 109 | } 110 | 111 | BridgeCFNodeList ToNodeList() const 112 | { 113 | BridgeCFNodeList out; 114 | out.parentGraph = parentGraph; 115 | out.start = start; 116 | out.end = end; 117 | out.brtrue = brtrue; 118 | out.brfalse = brfalse; 119 | out.icount = icount; 120 | out.terminal = terminal; 121 | out.indirectcall = indirectcall; 122 | out.split = split; 123 | out.userdata = userdata; 124 | BridgeList::CopyData(&out.exits, exits); 125 | BridgeList::CopyData(&out.instrs, instrs); 126 | return std::move(out); 127 | } 128 | }; 129 | 130 | struct BridgeCFGraph 131 | { 132 | duint entryPoint; //graph entry point 133 | void* userdata; //user data 134 | std::unordered_map nodes; //CFNode.start -> CFNode 135 | std::unordered_map> parents; //CFNode.start -> parents 136 | 137 | static void Free(const BridgeCFGraphList* graphList) 138 | { 139 | if(!graphList || graphList->nodes.size != graphList->nodes.count * sizeof(BridgeCFNodeList)) 140 | __debugbreak(); 141 | auto data = (BridgeCFNodeList*)graphList->nodes.data; 142 | for(int i = 0; i < graphList->nodes.count; i++) 143 | BridgeCFNode::Free(&data[i]); 144 | BridgeFree(data); 145 | } 146 | 147 | explicit BridgeCFGraph(const BridgeCFGraphList* graphList, bool freedata) 148 | { 149 | if(!graphList || graphList->nodes.size != graphList->nodes.count * sizeof(BridgeCFNodeList)) 150 | __debugbreak(); 151 | entryPoint = graphList->entryPoint; 152 | userdata = graphList->userdata; 153 | auto data = (BridgeCFNodeList*)graphList->nodes.data; 154 | for(int i = 0; i < graphList->nodes.count; i++) 155 | AddNode(BridgeCFNode(&data[i], freedata)); 156 | if(freedata && data) 157 | BridgeFree(data); 158 | } 159 | 160 | explicit BridgeCFGraph(duint entryPoint) 161 | : entryPoint(entryPoint), 162 | userdata(nullptr) 163 | { 164 | } 165 | 166 | void AddNode(const BridgeCFNode & node) 167 | { 168 | nodes[node.start] = node; 169 | AddParent(node.start, node.brtrue); 170 | AddParent(node.start, node.brfalse); 171 | } 172 | 173 | void AddParent(duint child, duint parent) 174 | { 175 | if(!child || !parent) 176 | return; 177 | auto found = parents.find(child); 178 | if(found == parents.end()) 179 | { 180 | parents[child] = std::unordered_set(); 181 | parents[child].insert(parent); 182 | } 183 | else 184 | found->second.insert(parent); 185 | } 186 | 187 | BridgeCFGraphList ToGraphList() const 188 | { 189 | BridgeCFGraphList out; 190 | out.entryPoint = entryPoint; 191 | out.userdata = userdata; 192 | std::vector nodeList; 193 | nodeList.reserve(nodes.size()); 194 | for(const auto & nodeIt : nodes) 195 | nodeList.push_back(nodeIt.second.ToNodeList()); 196 | BridgeList::CopyData(&out.nodes, nodeList); 197 | return std::move(out); 198 | } 199 | }; 200 | 201 | #endif //_MSC_VER 202 | #endif //__cplusplus 203 | 204 | #endif //_GRAPH_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/bridgelist.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIST_H 2 | #define _LIST_H 3 | 4 | typedef struct 5 | { 6 | int count; //Number of element in the list. 7 | size_t size; //Size of list in bytes (used for type checking). 8 | void* data; //Pointer to the list contents. Must be deleted by the caller using BridgeFree (or BridgeList::Free). 9 | } ListInfo; 10 | 11 | #define ListOf(Type) ListInfo* 12 | 13 | #ifdef __cplusplus 14 | 15 | #include 16 | 17 | /** 18 | \brief A list object. This object is NOT thread safe. 19 | \tparam Type BridgeList contents type. 20 | */ 21 | template 22 | class BridgeList 23 | { 24 | public: 25 | /** 26 | \brief BridgeList constructor. 27 | \param _freeData (Optional) the free function. 28 | */ 29 | explicit BridgeList() 30 | { 31 | memset(&_listInfo, 0, sizeof(_listInfo)); 32 | } 33 | 34 | /** 35 | \brief BridgeList destructor. 36 | */ 37 | ~BridgeList() 38 | { 39 | Cleanup(); 40 | } 41 | 42 | /** 43 | \brief Gets the list data. 44 | \return Returns ListInfo->data. Can be null if the list was never initialized. Will be destroyed once this object goes out of scope! 45 | */ 46 | Type* Data() const 47 | { 48 | return reinterpret_cast(_listInfo.data); 49 | } 50 | 51 | /** 52 | \brief Gets the number of elements in the list. This will crash the program if the data is not consistent with the specified template argument. 53 | \return The number of elements in the list. 54 | */ 55 | int Count() const 56 | { 57 | if(_listInfo.size != _listInfo.count * sizeof(Type)) //make sure the user is using the correct type. 58 | __debugbreak(); 59 | return _listInfo.count; 60 | } 61 | 62 | /** 63 | \brief Cleans up the list, freeing the list data when it is not null. 64 | */ 65 | void Cleanup() 66 | { 67 | if(_listInfo.data) 68 | { 69 | BridgeFree(_listInfo.data); 70 | _listInfo.data = nullptr; 71 | } 72 | } 73 | 74 | /** 75 | \brief Reference operator (cleans up the previous list) 76 | \return Pointer to the ListInfo. 77 | */ 78 | ListInfo* operator&() 79 | { 80 | Cleanup(); 81 | return &_listInfo; 82 | } 83 | 84 | /** 85 | \brief Array indexer operator. This will crash if you try to access out-of-bounds. 86 | \param index Zero-based index of the item you want to get. 87 | \return Reference to a value at that index. 88 | */ 89 | Type & operator[](size_t index) const 90 | { 91 | if(index >= size_t(Count())) //make sure the out-of-bounds access is caught as soon as possible. 92 | __debugbreak(); 93 | return Data()[index]; 94 | } 95 | 96 | /** 97 | \brief Copies data to a ListInfo structure.. 98 | \param [out] listInfo If non-null, information describing the list. 99 | \param listData Data to copy in the ListInfo structure. 100 | \return true if it succeeds, false if it fails. 101 | */ 102 | static bool CopyData(ListInfo* listInfo, const std::vector & listData) 103 | { 104 | if(!listInfo) 105 | return false; 106 | listInfo->count = int(listData.size()); 107 | listInfo->size = listInfo->count * sizeof(Type); 108 | if(listInfo->count) 109 | { 110 | listInfo->data = BridgeAlloc(listInfo->size); 111 | Type* curItem = reinterpret_cast(listInfo->data); 112 | for(const auto & item : listData) 113 | { 114 | *curItem = item; 115 | ++curItem; 116 | } 117 | } 118 | else 119 | listInfo->data = nullptr; 120 | return true; 121 | } 122 | 123 | static bool Free(const ListInfo* listInfo) 124 | { 125 | if(!listInfo || listInfo->size != listInfo->count * sizeof(Type) || (listInfo->count && !listInfo->data)) 126 | return false; 127 | BridgeFree(listInfo->data); 128 | return true; 129 | } 130 | 131 | static bool ToVector(const ListInfo* listInfo, std::vector & listData, bool freedata = true) 132 | { 133 | if(!listInfo || listInfo->size != listInfo->count * sizeof(Type) || (listInfo->count && !listInfo->data)) 134 | return false; 135 | listData.resize(listInfo->count); 136 | for(int i = 0; i < listInfo->count; i++) 137 | listData[i] = ((Type*)listInfo->data)[i]; 138 | if(freedata && listInfo->data) 139 | BridgeFree(listInfo->data); 140 | return true; 141 | } 142 | 143 | private: 144 | ListInfo _listInfo; 145 | }; 146 | 147 | #endif //__cplusplus 148 | 149 | #endif //_LIST_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/bridgemain.h: -------------------------------------------------------------------------------- 1 | #ifndef _BRIDGEMAIN_H_ 2 | #define _BRIDGEMAIN_H_ 3 | 4 | #include 5 | 6 | #ifndef __cplusplus 7 | #include 8 | #endif 9 | 10 | //default structure alignments forced 11 | #ifdef _WIN64 12 | #pragma pack(push, 16) 13 | #else //x86 14 | #pragma pack(push, 8) 15 | #endif //_WIN64 16 | 17 | #ifdef _WIN64 18 | typedef unsigned long long duint; 19 | typedef signed long long dsint; 20 | #else 21 | typedef unsigned long duint; 22 | typedef signed long dsint; 23 | #endif //_WIN64 24 | 25 | #ifndef BRIDGE_IMPEXP 26 | #ifdef BUILD_BRIDGE 27 | #define BRIDGE_IMPEXP __declspec(dllexport) 28 | #else 29 | #define BRIDGE_IMPEXP __declspec(dllimport) 30 | #endif //BUILD_BRIDGE 31 | #endif //BRIDGE_IMPEXP 32 | 33 | #ifdef __cplusplus 34 | extern "C" 35 | { 36 | #endif 37 | 38 | //Bridge defines 39 | #define MAX_SETTING_SIZE 65536 40 | #define DBG_VERSION 25 41 | 42 | //Bridge functions 43 | 44 | /// 45 | /// Initialize the bridge. 46 | /// 47 | /// On error it returns a non-null error message. 48 | BRIDGE_IMPEXP const wchar_t* BridgeInit(); 49 | 50 | /// 51 | /// Start the bridge. 52 | /// 53 | /// On error it returns a non-null error message. 54 | BRIDGE_IMPEXP const wchar_t* BridgeStart(); 55 | 56 | /// 57 | /// Allocate buffer. Use BridgeFree to free the buffer. 58 | /// 59 | /// Size in bytes of the buffer to allocate. 60 | /// A pointer to the allocated buffer. This function will trigger a crash dump if unsuccessful. 61 | BRIDGE_IMPEXP void* BridgeAlloc(size_t size); 62 | 63 | /// 64 | /// Free buffer allocated by BridgeAlloc. 65 | /// 66 | /// Buffer to free. 67 | BRIDGE_IMPEXP void BridgeFree(void* ptr); 68 | 69 | /// 70 | /// Get a string setting from the in-memory setting store. 71 | /// 72 | /// Section the setting is in. Cannot be null. 73 | /// Setting key (name). Cannot be null. 74 | /// Output buffer for the value. Should be of MAX_SETTING_SIZE. Cannot be null. 75 | /// True if the setting was found and copied in the value parameter. 76 | BRIDGE_IMPEXP bool BridgeSettingGet(const char* section, const char* key, char* value); 77 | 78 | /// 79 | /// Get an integer setting from the in-memory setting store. 80 | /// 81 | /// Section the setting is in. Cannot be null. 82 | /// Setting key (name). Cannot be null. 83 | /// Output value. 84 | /// True if the setting was found and successfully converted to an integer. 85 | BRIDGE_IMPEXP bool BridgeSettingGetUint(const char* section, const char* key, duint* value); 86 | 87 | /// 88 | /// Set a string setting in the in-memory setting store. 89 | /// 90 | /// Section the setting is in. Cannot be null. 91 | /// Setting key (name). Set to null to clear the whole section. 92 | /// New setting value. Set to null to remove the key from the section. 93 | /// True if the operation was successful. 94 | BRIDGE_IMPEXP bool BridgeSettingSet(const char* section, const char* key, const char* value); 95 | 96 | /// 97 | /// Set an integer setting in the in-memory setting store. 98 | /// 99 | /// Section the setting is in. Cannot be null. 100 | /// Setting key (name). Set to null to clear the whole section. 101 | /// New setting value. 102 | /// True if the operation was successful. 103 | BRIDGE_IMPEXP bool BridgeSettingSetUint(const char* section, const char* key, duint value); 104 | 105 | /// 106 | /// Flush the in-memory setting store to disk. 107 | /// 108 | /// 109 | BRIDGE_IMPEXP bool BridgeSettingFlush(); 110 | 111 | /// 112 | /// Read the in-memory setting store from disk. 113 | /// 114 | /// Line where the error occurred. Set to null to ignore this. 115 | /// True if the setting were read and parsed correctly. 116 | BRIDGE_IMPEXP bool BridgeSettingRead(int* errorLine); 117 | 118 | /// 119 | /// Get the debugger version. 120 | /// 121 | /// 25 122 | BRIDGE_IMPEXP int BridgeGetDbgVersion(); 123 | 124 | /// 125 | /// Checks if the current process is elevated. 126 | /// 127 | /// true if the process is elevated, false otherwise. 128 | BRIDGE_IMPEXP bool BridgeIsProcessElevated(); 129 | 130 | #ifdef __cplusplus 131 | } 132 | #endif 133 | 134 | //list structure (and C++ wrapper) 135 | #include "bridgelist.h" 136 | 137 | #include "bridgegraph.h" 138 | 139 | #ifdef __cplusplus 140 | extern "C" 141 | { 142 | #endif 143 | 144 | //Debugger defines 145 | #define MAX_LABEL_SIZE 256 146 | #define MAX_COMMENT_SIZE 512 147 | #define MAX_MODULE_SIZE 256 148 | #define MAX_IMPORT_SIZE 65536 149 | #define MAX_BREAKPOINT_SIZE 256 150 | #define MAX_CONDITIONAL_EXPR_SIZE 256 151 | #define MAX_CONDITIONAL_TEXT_SIZE 256 152 | #define MAX_SCRIPT_LINE_SIZE 2048 153 | #define MAX_THREAD_NAME_SIZE 256 154 | #define MAX_WATCH_NAME_SIZE 256 155 | #define MAX_STRING_SIZE 512 156 | #define MAX_ERROR_SIZE 512 157 | #define RIGHTS_STRING_SIZE (sizeof("ERWCG") + 1) 158 | #define MAX_SECTION_SIZE 10 159 | #define MAX_COMMAND_LINE_SIZE 256 160 | #define MAX_MNEMONIC_SIZE 64 161 | #define PAGE_SIZE 0x1000 162 | 163 | //Debugger enums 164 | typedef enum 165 | { 166 | initialized, 167 | paused, 168 | running, 169 | stopped 170 | } DBGSTATE; 171 | 172 | typedef enum 173 | { 174 | SEG_DEFAULT, 175 | SEG_ES, 176 | SEG_DS, 177 | SEG_FS, 178 | SEG_GS, 179 | SEG_CS, 180 | SEG_SS 181 | } SEGMENTREG; 182 | 183 | typedef enum 184 | { 185 | flagmodule = 0x1, 186 | flaglabel = 0x2, 187 | flagcomment = 0x4, 188 | flagbookmark = 0x8, 189 | flagfunction = 0x10, 190 | flagloop = 0x20, 191 | flagargs = 0x40, 192 | flagNoFuncOffset = 0x80 193 | } ADDRINFOFLAGS; 194 | 195 | typedef enum 196 | { 197 | bp_none = 0, 198 | bp_normal = 1, 199 | bp_hardware = 2, 200 | bp_memory = 4, 201 | bp_dll = 8, 202 | bp_exception = 16 203 | } BPXTYPE; 204 | 205 | typedef enum 206 | { 207 | FUNC_NONE, 208 | FUNC_BEGIN, 209 | FUNC_MIDDLE, 210 | FUNC_END, 211 | FUNC_SINGLE 212 | } FUNCTYPE; 213 | 214 | typedef enum 215 | { 216 | LOOP_NONE, 217 | LOOP_BEGIN, 218 | LOOP_MIDDLE, 219 | LOOP_ENTRY, 220 | LOOP_END, 221 | LOOP_SINGLE 222 | } LOOPTYPE; 223 | 224 | //order by most important type last 225 | typedef enum 226 | { 227 | XREF_NONE, 228 | XREF_DATA, 229 | XREF_JMP, 230 | XREF_CALL 231 | } XREFTYPE; 232 | 233 | typedef enum 234 | { 235 | ARG_NONE, 236 | ARG_BEGIN, 237 | ARG_MIDDLE, 238 | ARG_END, 239 | ARG_SINGLE 240 | } ARGTYPE; 241 | 242 | typedef enum 243 | { 244 | DBG_SCRIPT_LOAD, // param1=const char* filename, param2=unused 245 | DBG_SCRIPT_UNLOAD, // param1=unused, param2=unused 246 | DBG_SCRIPT_RUN, // param1=int destline, param2=unused 247 | DBG_SCRIPT_STEP, // param1=unused, param2=unused 248 | DBG_SCRIPT_BPTOGGLE, // param1=int line, param2=unused 249 | DBG_SCRIPT_BPGET, // param1=int line, param2=unused 250 | DBG_SCRIPT_CMDEXEC, // param1=const char* command, param2=unused 251 | DBG_SCRIPT_ABORT, // param1=unused, param2=unused 252 | DBG_SCRIPT_GETLINETYPE, // param1=int line, param2=unused 253 | DBG_SCRIPT_SETIP, // param1=int line, param2=unused 254 | DBG_SCRIPT_GETBRANCHINFO, // param1=int line, param2=SCRIPTBRANCH* info 255 | DBG_SYMBOL_ENUM, // param1=SYMBOLCBINFO* cbInfo, param2=unused 256 | DBG_ASSEMBLE_AT, // param1=duint addr, param2=const char* instruction 257 | DBG_MODBASE_FROM_NAME, // param1=const char* modname, param2=unused 258 | DBG_DISASM_AT, // param1=duint addr, param2=DISASM_INSTR* instr 259 | DBG_STACK_COMMENT_GET, // param1=duint addr, param2=STACK_COMMENT* comment 260 | DBG_GET_THREAD_LIST, // param1=THREADALLINFO* list, param2=unused 261 | DBG_SETTINGS_UPDATED, // param1=unused, param2=unused 262 | DBG_DISASM_FAST_AT, // param1=duint addr, param2=BASIC_INSTRUCTION_INFO* basicinfo 263 | DBG_MENU_ENTRY_CLICKED, // param1=int hEntry, param2=unused 264 | DBG_FUNCTION_GET, // param1=FUNCTION_LOOP_INFO* info, param2=unused 265 | DBG_FUNCTION_OVERLAPS, // param1=FUNCTION_LOOP_INFO* info, param2=unused 266 | DBG_FUNCTION_ADD, // param1=FUNCTION_LOOP_INFO* info, param2=unused 267 | DBG_FUNCTION_DEL, // param1=FUNCTION_LOOP_INFO* info, param2=unused 268 | DBG_LOOP_GET, // param1=FUNCTION_LOOP_INFO* info, param2=unused 269 | DBG_LOOP_OVERLAPS, // param1=FUNCTION_LOOP_INFO* info, param2=unused 270 | DBG_LOOP_ADD, // param1=FUNCTION_LOOP_INFO* info, param2=unused 271 | DBG_LOOP_DEL, // param1=FUNCTION_LOOP_INFO* info, param2=unused 272 | DBG_IS_RUN_LOCKED, // param1=unused, param2=unused 273 | DBG_IS_BP_DISABLED, // param1=duint addr, param2=unused 274 | DBG_SET_AUTO_COMMENT_AT, // param1=duint addr, param2=const char* text 275 | DBG_DELETE_AUTO_COMMENT_RANGE, // param1=duint start, param2=duint end 276 | DBG_SET_AUTO_LABEL_AT, // param1=duint addr, param2=const char* text 277 | DBG_DELETE_AUTO_LABEL_RANGE, // param1=duint start, param2=duint end 278 | DBG_SET_AUTO_BOOKMARK_AT, // param1=duint addr, param2=const char* text 279 | DBG_DELETE_AUTO_BOOKMARK_RANGE, // param1=duint start, param2=duint end 280 | DBG_SET_AUTO_FUNCTION_AT, // param1=duint addr, param2=const char* text 281 | DBG_DELETE_AUTO_FUNCTION_RANGE, // param1=duint start, param2=duint end 282 | DBG_GET_STRING_AT, // param1=duint addr, param2=unused 283 | DBG_GET_FUNCTIONS, // param1=unused, param2=unused 284 | DBG_WIN_EVENT, // param1=MSG* message, param2=long* result 285 | DBG_WIN_EVENT_GLOBAL, // param1=MSG* message, param2=unused 286 | DBG_INITIALIZE_LOCKS, // param1=unused, param2=unused 287 | DBG_DEINITIALIZE_LOCKS, // param1=unused, param2=unused 288 | DBG_GET_TIME_WASTED_COUNTER, // param1=unused, param2=unused 289 | DBG_SYMBOL_ENUM_FROMCACHE, // param1=SYMBOLCBINFO* cbInfo, param2=unused 290 | DBG_DELETE_COMMENT_RANGE, // param1=duint start, param2=duint end 291 | DBG_DELETE_LABEL_RANGE, // param1=duint start, param2=duint end 292 | DBG_DELETE_BOOKMARK_RANGE, // param1=duint start, param2=duint end 293 | DBG_GET_XREF_COUNT_AT, // param1=duint addr, param2=unused 294 | DBG_GET_XREF_TYPE_AT, // param1=duint addr, param2=unused 295 | DBG_XREF_ADD, // param1=duint addr, param2=duint from 296 | DBG_XREF_DEL_ALL, // param1=duint addr, param2=unused 297 | DBG_XREF_GET, // param1=duint addr, param2=XREF_INFO* info 298 | DBG_GET_ENCODE_TYPE_BUFFER, // param1=duint addr, param2=unused 299 | DBG_ENCODE_TYPE_GET, // param1=duint addr, param2=duint size 300 | DBG_DELETE_ENCODE_TYPE_RANGE, // param1=duint start, param2=duint end 301 | DBG_ENCODE_SIZE_GET, // param1=duint addr, param2=duint codesize 302 | DBG_DELETE_ENCODE_TYPE_SEG, // param1=duint addr, param2=unused 303 | DBG_RELEASE_ENCODE_TYPE_BUFFER, // param1=void* buffer, param2=unused 304 | DBG_ARGUMENT_GET, // param1=FUNCTION* info, param2=unused 305 | DBG_ARGUMENT_OVERLAPS, // param1=FUNCTION* info, param2=unused 306 | DBG_ARGUMENT_ADD, // param1=FUNCTION* info, param2=unused 307 | DBG_ARGUMENT_DEL, // param1=FUNCTION* info, param2=unused 308 | DBG_GET_WATCH_LIST, // param1=ListOf(WATCHINFO), param2=unused 309 | DBG_SELCHANGED, // param1=hWindow, param2=VA 310 | DBG_GET_PROCESS_HANDLE, // param1=unused, param2=unused 311 | DBG_GET_THREAD_HANDLE, // param1=unused, param2=unused 312 | DBG_GET_PROCESS_ID, // param1=unused, param2=unused 313 | DBG_GET_THREAD_ID, // param1=unused, param2=unused 314 | DBG_GET_PEB_ADDRESS, // param1=DWORD ProcessId, param2=unused 315 | DBG_GET_TEB_ADDRESS, // param1=DWORD ThreadId, param2=unused 316 | DBG_ANALYZE_FUNCTION, // param1=BridgeCFGraphList* graph, param2=duint entry 317 | DBG_MENU_PREPARE, // param1=int hMenu, param2=unused 318 | DBG_GET_SYMBOL_INFO, // param1=void* symbol, param2=SYMBOLINFO* info 319 | } DBGMSG; 320 | 321 | typedef enum 322 | { 323 | linecommand, 324 | linebranch, 325 | linelabel, 326 | linecomment, 327 | lineempty, 328 | } SCRIPTLINETYPE; 329 | 330 | typedef enum 331 | { 332 | scriptnobranch, 333 | scriptjmp, 334 | scriptjnejnz, 335 | scriptjejz, 336 | scriptjbjl, 337 | scriptjajg, 338 | scriptjbejle, 339 | scriptjaejge, 340 | scriptcall 341 | } SCRIPTBRANCHTYPE; 342 | 343 | typedef enum 344 | { 345 | instr_normal, 346 | instr_branch, 347 | instr_stack 348 | } DISASM_INSTRTYPE; 349 | 350 | typedef enum 351 | { 352 | arg_normal, 353 | arg_memory 354 | } DISASM_ARGTYPE; 355 | 356 | typedef enum 357 | { 358 | str_none, 359 | str_ascii, 360 | str_unicode 361 | } STRING_TYPE; 362 | 363 | typedef enum 364 | { 365 | _PriorityIdle = -15, 366 | _PriorityAboveNormal = 1, 367 | _PriorityBelowNormal = -1, 368 | _PriorityHighest = 2, 369 | _PriorityLowest = -2, 370 | _PriorityNormal = 0, 371 | _PriorityTimeCritical = 15, 372 | _PriorityUnknown = 0x7FFFFFFF 373 | } THREADPRIORITY; 374 | 375 | typedef enum 376 | { 377 | _Executive = 0, 378 | _FreePage = 1, 379 | _PageIn = 2, 380 | _PoolAllocation = 3, 381 | _DelayExecution = 4, 382 | _Suspended = 5, 383 | _UserRequest = 6, 384 | _WrExecutive = 7, 385 | _WrFreePage = 8, 386 | _WrPageIn = 9, 387 | _WrPoolAllocation = 10, 388 | _WrDelayExecution = 11, 389 | _WrSuspended = 12, 390 | _WrUserRequest = 13, 391 | _WrEventPair = 14, 392 | _WrQueue = 15, 393 | _WrLpcReceive = 16, 394 | _WrLpcReply = 17, 395 | _WrVirtualMemory = 18, 396 | _WrPageOut = 19, 397 | _WrRendezvous = 20, 398 | _Spare2 = 21, 399 | _Spare3 = 22, 400 | _Spare4 = 23, 401 | _Spare5 = 24, 402 | _WrCalloutStack = 25, 403 | _WrKernel = 26, 404 | _WrResource = 27, 405 | _WrPushLock = 28, 406 | _WrMutex = 29, 407 | _WrQuantumEnd = 30, 408 | _WrDispatchInt = 31, 409 | _WrPreempted = 32, 410 | _WrYieldExecution = 33, 411 | _WrFastMutex = 34, 412 | _WrGuardedMutex = 35, 413 | _WrRundown = 36, 414 | } THREADWAITREASON; 415 | 416 | typedef enum 417 | { 418 | size_byte = 1, 419 | size_word = 2, 420 | size_dword = 4, 421 | size_qword = 8 422 | } MEMORY_SIZE; 423 | 424 | typedef enum 425 | { 426 | enc_unknown, //must be 0 427 | enc_byte, //1 byte 428 | enc_word, //2 bytes 429 | enc_dword, //4 bytes 430 | enc_fword, //6 bytes 431 | enc_qword, //8 bytes 432 | enc_tbyte, //10 bytes 433 | enc_oword, //16 bytes 434 | enc_mmword, //8 bytes 435 | enc_xmmword, //16 bytes 436 | enc_ymmword, //32 bytes 437 | enc_zmmword, //64 bytes avx512 not supported 438 | enc_real4, //4 byte float 439 | enc_real8, //8 byte double 440 | enc_real10, //10 byte decimal 441 | enc_ascii, //ascii sequence 442 | enc_unicode, //unicode sequence 443 | enc_code, //start of code 444 | enc_junk, //junk code 445 | enc_middle //middle of data 446 | } ENCODETYPE; 447 | 448 | typedef enum 449 | { 450 | TYPE_UINT, // unsigned integer 451 | TYPE_INT, // signed integer 452 | TYPE_FLOAT,// single precision floating point value 453 | TYPE_ASCII, // ascii string 454 | TYPE_UNICODE, // unicode string 455 | TYPE_INVALID // invalid watch expression or data type 456 | } WATCHVARTYPE; 457 | 458 | typedef enum 459 | { 460 | MODE_DISABLED, // watchdog is disabled 461 | MODE_ISTRUE, // alert if expression is not 0 462 | MODE_ISFALSE, // alert if expression is 0 463 | MODE_CHANGED, // alert if expression is changed 464 | MODE_UNCHANGED // alert if expression is not changed 465 | } WATCHDOGMODE; 466 | 467 | typedef enum 468 | { 469 | hw_access, 470 | hw_write, 471 | hw_execute 472 | } BPHWTYPE; 473 | 474 | typedef enum 475 | { 476 | mem_access, 477 | mem_read, 478 | mem_write, 479 | mem_execute 480 | } BPMEMTYPE; 481 | 482 | typedef enum 483 | { 484 | dll_load = 1, 485 | dll_unload, 486 | dll_all 487 | } BPDLLTYPE; 488 | 489 | typedef enum 490 | { 491 | ex_firstchance = 1, 492 | ex_secondchance, 493 | ex_all 494 | } BPEXTYPE; 495 | 496 | typedef enum 497 | { 498 | hw_byte, 499 | hw_word, 500 | hw_dword, 501 | hw_qword 502 | } BPHWSIZE; 503 | 504 | typedef enum 505 | { 506 | sym_import, 507 | sym_export, 508 | sym_symbol 509 | } SYMBOLTYPE; 510 | 511 | //Debugger typedefs 512 | typedef MEMORY_SIZE VALUE_SIZE; 513 | 514 | typedef struct DBGFUNCTIONS_ DBGFUNCTIONS; 515 | 516 | typedef bool (*CBSYMBOLENUM)(const struct SYMBOLPTR_* symbol, void* user); 517 | 518 | //Debugger structs 519 | typedef struct 520 | { 521 | MEMORY_BASIC_INFORMATION mbi; 522 | char info[MAX_MODULE_SIZE]; 523 | } MEMPAGE; 524 | 525 | typedef struct 526 | { 527 | int count; 528 | MEMPAGE* page; 529 | } MEMMAP; 530 | 531 | typedef struct 532 | { 533 | BPXTYPE type; 534 | duint addr; 535 | bool enabled; 536 | bool singleshoot; 537 | bool active; 538 | char name[MAX_BREAKPOINT_SIZE]; 539 | char mod[MAX_MODULE_SIZE]; 540 | unsigned short slot; 541 | // extended part 542 | unsigned char typeEx; //BPHWTYPE/BPMEMTYPE/BPDLLTYPE/BPEXTYPE 543 | unsigned char hwSize; //BPHWSIZE 544 | unsigned int hitCount; 545 | bool fastResume; 546 | bool silent; 547 | char breakCondition[MAX_CONDITIONAL_EXPR_SIZE]; 548 | char logText[MAX_CONDITIONAL_TEXT_SIZE]; 549 | char logCondition[MAX_CONDITIONAL_EXPR_SIZE]; 550 | char commandText[MAX_CONDITIONAL_TEXT_SIZE]; 551 | char commandCondition[MAX_CONDITIONAL_EXPR_SIZE]; 552 | } BRIDGEBP; 553 | 554 | typedef struct 555 | { 556 | int count; 557 | BRIDGEBP* bp; 558 | } BPMAP; 559 | 560 | typedef struct 561 | { 562 | char WatchName[MAX_WATCH_NAME_SIZE]; 563 | char Expression[MAX_CONDITIONAL_EXPR_SIZE]; 564 | unsigned int window; 565 | unsigned int id; 566 | WATCHVARTYPE varType; 567 | WATCHDOGMODE watchdogMode; 568 | duint value; 569 | bool watchdogTriggered; 570 | } WATCHINFO; 571 | 572 | typedef struct 573 | { 574 | duint start; //OUT 575 | duint end; //OUT 576 | duint instrcount; //OUT 577 | } FUNCTION; 578 | 579 | typedef struct 580 | { 581 | int depth; //IN 582 | duint start; //OUT 583 | duint end; //OUT 584 | duint instrcount; //OUT 585 | } LOOP; 586 | 587 | typedef struct 588 | { 589 | int flags; //ADDRINFOFLAGS (IN) 590 | char module[MAX_MODULE_SIZE]; //module the address is in 591 | char label[MAX_LABEL_SIZE]; 592 | char comment[MAX_COMMENT_SIZE]; 593 | bool isbookmark; 594 | FUNCTION function; 595 | LOOP loop; 596 | FUNCTION args; 597 | } BRIDGE_ADDRINFO; 598 | 599 | typedef struct SYMBOLINFO_ 600 | { 601 | duint addr; 602 | char* decoratedSymbol; 603 | char* undecoratedSymbol; 604 | SYMBOLTYPE type; 605 | bool freeDecorated; 606 | bool freeUndecorated; 607 | DWORD ordinal; 608 | } SYMBOLINFO; 609 | 610 | typedef struct 611 | { 612 | duint base; 613 | char name[MAX_MODULE_SIZE]; 614 | } SYMBOLMODULEINFO; 615 | 616 | typedef struct 617 | { 618 | duint base; 619 | CBSYMBOLENUM cbSymbolEnum; 620 | void* user; 621 | } SYMBOLCBINFO; 622 | 623 | typedef struct 624 | { 625 | bool c; 626 | bool p; 627 | bool a; 628 | bool z; 629 | bool s; 630 | bool t; 631 | bool i; 632 | bool d; 633 | bool o; 634 | } FLAGS; 635 | 636 | typedef struct 637 | { 638 | bool FZ; 639 | bool PM; 640 | bool UM; 641 | bool OM; 642 | bool ZM; 643 | bool IM; 644 | bool DM; 645 | bool DAZ; 646 | bool PE; 647 | bool UE; 648 | bool OE; 649 | bool ZE; 650 | bool DE; 651 | bool IE; 652 | 653 | unsigned short RC; 654 | } MXCSRFIELDS; 655 | 656 | typedef struct 657 | { 658 | bool B; 659 | bool C3; 660 | bool C2; 661 | bool C1; 662 | bool C0; 663 | bool ES; 664 | bool SF; 665 | bool P; 666 | bool U; 667 | bool O; 668 | bool Z; 669 | bool D; 670 | bool I; 671 | 672 | unsigned short TOP; 673 | 674 | } X87STATUSWORDFIELDS; 675 | 676 | typedef struct 677 | { 678 | bool IC; 679 | bool IEM; 680 | bool PM; 681 | bool UM; 682 | bool OM; 683 | bool ZM; 684 | bool DM; 685 | bool IM; 686 | 687 | unsigned short RC; 688 | unsigned short PC; 689 | 690 | } X87CONTROLWORDFIELDS; 691 | 692 | typedef struct DECLSPEC_ALIGN(16) _XMMREGISTER 693 | { 694 | ULONGLONG Low; 695 | LONGLONG High; 696 | } XMMREGISTER; 697 | 698 | typedef struct 699 | { 700 | XMMREGISTER Low; //XMM/SSE part 701 | XMMREGISTER High; //AVX part 702 | } YMMREGISTER; 703 | 704 | typedef struct 705 | { 706 | BYTE data[10]; 707 | int st_value; 708 | int tag; 709 | } X87FPUREGISTER; 710 | 711 | typedef struct 712 | { 713 | WORD ControlWord; 714 | WORD StatusWord; 715 | WORD TagWord; 716 | DWORD ErrorOffset; 717 | DWORD ErrorSelector; 718 | DWORD DataOffset; 719 | DWORD DataSelector; 720 | DWORD Cr0NpxState; 721 | } X87FPU; 722 | 723 | typedef struct 724 | { 725 | ULONG_PTR cax; 726 | ULONG_PTR ccx; 727 | ULONG_PTR cdx; 728 | ULONG_PTR cbx; 729 | ULONG_PTR csp; 730 | ULONG_PTR cbp; 731 | ULONG_PTR csi; 732 | ULONG_PTR cdi; 733 | #ifdef _WIN64 734 | ULONG_PTR r8; 735 | ULONG_PTR r9; 736 | ULONG_PTR r10; 737 | ULONG_PTR r11; 738 | ULONG_PTR r12; 739 | ULONG_PTR r13; 740 | ULONG_PTR r14; 741 | ULONG_PTR r15; 742 | #endif //_WIN64 743 | ULONG_PTR cip; 744 | ULONG_PTR eflags; 745 | unsigned short gs; 746 | unsigned short fs; 747 | unsigned short es; 748 | unsigned short ds; 749 | unsigned short cs; 750 | unsigned short ss; 751 | ULONG_PTR dr0; 752 | ULONG_PTR dr1; 753 | ULONG_PTR dr2; 754 | ULONG_PTR dr3; 755 | ULONG_PTR dr6; 756 | ULONG_PTR dr7; 757 | BYTE RegisterArea[80]; 758 | X87FPU x87fpu; 759 | DWORD MxCsr; 760 | #ifdef _WIN64 761 | XMMREGISTER XmmRegisters[16]; 762 | YMMREGISTER YmmRegisters[16]; 763 | #else // x86 764 | XMMREGISTER XmmRegisters[8]; 765 | YMMREGISTER YmmRegisters[8]; 766 | #endif 767 | } REGISTERCONTEXT; 768 | 769 | typedef struct 770 | { 771 | DWORD code; 772 | char name[128]; 773 | } LASTERROR; 774 | 775 | typedef struct 776 | { 777 | DWORD code; 778 | char name[128]; 779 | } LASTSTATUS; 780 | 781 | typedef struct 782 | { 783 | REGISTERCONTEXT regcontext; 784 | FLAGS flags; 785 | X87FPUREGISTER x87FPURegisters[8]; 786 | unsigned long long mmx[8]; 787 | MXCSRFIELDS MxCsrFields; 788 | X87STATUSWORDFIELDS x87StatusWordFields; 789 | X87CONTROLWORDFIELDS x87ControlWordFields; 790 | LASTERROR lastError; 791 | LASTSTATUS lastStatus; 792 | } REGDUMP; 793 | 794 | typedef struct 795 | { 796 | DISASM_ARGTYPE type; //normal/memory 797 | SEGMENTREG segment; 798 | char mnemonic[64]; 799 | duint constant; //constant in the instruction (imm/disp) 800 | duint value; //equal to constant or equal to the register value 801 | duint memvalue; //memsize:[value] 802 | } DISASM_ARG; 803 | 804 | typedef struct 805 | { 806 | char instruction[64]; 807 | DISASM_INSTRTYPE type; 808 | int argcount; 809 | int instr_size; 810 | DISASM_ARG arg[3]; 811 | } DISASM_INSTR; 812 | 813 | typedef struct 814 | { 815 | char color[8]; //hex color-code 816 | char comment[MAX_COMMENT_SIZE]; 817 | } STACK_COMMENT; 818 | 819 | typedef struct 820 | { 821 | int ThreadNumber; 822 | HANDLE Handle; 823 | DWORD ThreadId; 824 | duint ThreadStartAddress; 825 | duint ThreadLocalBase; 826 | char threadName[MAX_THREAD_NAME_SIZE]; 827 | } THREADINFO; 828 | 829 | typedef struct 830 | { 831 | THREADINFO BasicInfo; 832 | duint ThreadCip; 833 | DWORD SuspendCount; 834 | THREADPRIORITY Priority; 835 | THREADWAITREASON WaitReason; 836 | DWORD LastError; 837 | FILETIME UserTime; 838 | FILETIME KernelTime; 839 | FILETIME CreationTime; 840 | ULONG64 Cycles; // Windows Vista or greater 841 | } THREADALLINFO; 842 | 843 | typedef struct 844 | { 845 | int count; 846 | THREADALLINFO* list; 847 | int CurrentThread; 848 | } THREADLIST; 849 | 850 | typedef struct 851 | { 852 | duint value; //displacement / addrvalue (rip-relative) 853 | MEMORY_SIZE size; //byte/word/dword/qword 854 | char mnemonic[MAX_MNEMONIC_SIZE]; 855 | } MEMORY_INFO; 856 | 857 | typedef struct 858 | { 859 | duint value; 860 | VALUE_SIZE size; 861 | } VALUE_INFO; 862 | 863 | //definitions for BASIC_INSTRUCTION_INFO.type 864 | #define TYPE_VALUE 1 865 | #define TYPE_MEMORY 2 866 | #define TYPE_ADDR 4 867 | 868 | typedef struct 869 | { 870 | DWORD type; //value|memory|addr 871 | VALUE_INFO value; //immediat 872 | MEMORY_INFO memory; 873 | duint addr; //addrvalue (jumps + calls) 874 | bool branch; //jumps/calls 875 | bool call; //instruction is a call 876 | int size; 877 | char instruction[MAX_MNEMONIC_SIZE * 4]; 878 | } BASIC_INSTRUCTION_INFO; 879 | 880 | typedef struct 881 | { 882 | SCRIPTBRANCHTYPE type; 883 | int dest; 884 | char branchlabel[256]; 885 | } SCRIPTBRANCH; 886 | 887 | typedef struct 888 | { 889 | duint addr; 890 | duint start; 891 | duint end; 892 | bool manual; 893 | int depth; 894 | } FUNCTION_LOOP_INFO; 895 | 896 | typedef struct 897 | { 898 | duint addr; 899 | XREFTYPE type; 900 | } XREF_RECORD; 901 | 902 | typedef struct 903 | { 904 | duint refcount; 905 | XREF_RECORD* references; 906 | } XREF_INFO; 907 | 908 | typedef struct SYMBOLPTR_ 909 | { 910 | duint modbase; 911 | const void* symbol; 912 | } SYMBOLPTR; 913 | 914 | //Debugger functions 915 | BRIDGE_IMPEXP const char* DbgInit(); 916 | BRIDGE_IMPEXP void DbgExit(); 917 | BRIDGE_IMPEXP bool DbgMemRead(duint va, void* dest, duint size); 918 | BRIDGE_IMPEXP bool DbgMemWrite(duint va, const void* src, duint size); 919 | BRIDGE_IMPEXP duint DbgMemGetPageSize(duint base); 920 | BRIDGE_IMPEXP duint DbgMemFindBaseAddr(duint addr, duint* size); 921 | 922 | /// 923 | /// Asynchronously execute a debugger command by adding it to the command queue. 924 | /// Note: the command may not have completed before this call returns. Use this 925 | /// function if you don't care when the command gets executed. 926 | /// 927 | /// Example: DbgCmdExec("ClearLog") 928 | /// 929 | /// The command to execute. 930 | /// True if the command was successfully submitted to the command queue. False if the submission failed. 931 | BRIDGE_IMPEXP bool DbgCmdExec(const char* cmd); 932 | 933 | /// 934 | /// Performs synchronous execution of a debugger command. This function call only 935 | /// returns after the command has completed. 936 | /// 937 | /// Example: DbgCmdExecDirect("loadlib advapi32.dll") 938 | /// 939 | /// The command to execute. 940 | /// True if the command executed successfully, False if there was a problem. 941 | BRIDGE_IMPEXP bool DbgCmdExecDirect(const char* cmd); 942 | BRIDGE_IMPEXP bool DbgMemMap(MEMMAP* memmap); 943 | BRIDGE_IMPEXP bool DbgIsValidExpression(const char* expression); 944 | BRIDGE_IMPEXP bool DbgIsDebugging(); 945 | BRIDGE_IMPEXP bool DbgIsJumpGoingToExecute(duint addr); 946 | BRIDGE_IMPEXP bool DbgGetLabelAt(duint addr, SEGMENTREG segment, char* text); 947 | BRIDGE_IMPEXP bool DbgSetLabelAt(duint addr, const char* text); 948 | BRIDGE_IMPEXP void DbgClearLabelRange(duint start, duint end); 949 | BRIDGE_IMPEXP bool DbgGetCommentAt(duint addr, char* text); 950 | BRIDGE_IMPEXP bool DbgSetCommentAt(duint addr, const char* text); 951 | BRIDGE_IMPEXP void DbgClearCommentRange(duint start, duint end); 952 | BRIDGE_IMPEXP bool DbgGetBookmarkAt(duint addr); 953 | BRIDGE_IMPEXP bool DbgSetBookmarkAt(duint addr, bool isbookmark); 954 | BRIDGE_IMPEXP void DbgClearBookmarkRange(duint start, duint end); 955 | BRIDGE_IMPEXP bool DbgGetModuleAt(duint addr, char* text); 956 | BRIDGE_IMPEXP BPXTYPE DbgGetBpxTypeAt(duint addr); 957 | BRIDGE_IMPEXP duint DbgValFromString(const char* string); 958 | BRIDGE_IMPEXP bool DbgGetRegDumpEx(REGDUMP* regdump, size_t size); 959 | BRIDGE_IMPEXP bool DbgValToString(const char* string, duint value); 960 | BRIDGE_IMPEXP bool DbgMemIsValidReadPtr(duint addr); 961 | BRIDGE_IMPEXP int DbgGetBpList(BPXTYPE type, BPMAP* list); 962 | BRIDGE_IMPEXP FUNCTYPE DbgGetFunctionTypeAt(duint addr); 963 | BRIDGE_IMPEXP LOOPTYPE DbgGetLoopTypeAt(duint addr, int depth); 964 | BRIDGE_IMPEXP duint DbgGetBranchDestination(duint addr); 965 | BRIDGE_IMPEXP void DbgScriptLoad(const char* filename); 966 | BRIDGE_IMPEXP void DbgScriptUnload(); 967 | BRIDGE_IMPEXP void DbgScriptRun(int destline); 968 | BRIDGE_IMPEXP void DbgScriptStep(); 969 | BRIDGE_IMPEXP bool DbgScriptBpToggle(int line); 970 | BRIDGE_IMPEXP bool DbgScriptBpGet(int line); 971 | BRIDGE_IMPEXP bool DbgScriptCmdExec(const char* command); 972 | BRIDGE_IMPEXP void DbgScriptAbort(); 973 | BRIDGE_IMPEXP SCRIPTLINETYPE DbgScriptGetLineType(int line); 974 | BRIDGE_IMPEXP void DbgScriptSetIp(int line); 975 | BRIDGE_IMPEXP bool DbgScriptGetBranchInfo(int line, SCRIPTBRANCH* info); 976 | BRIDGE_IMPEXP void DbgSymbolEnum(duint base, CBSYMBOLENUM cbSymbolEnum, void* user); 977 | BRIDGE_IMPEXP void DbgSymbolEnumFromCache(duint base, CBSYMBOLENUM cbSymbolEnum, void* user); 978 | BRIDGE_IMPEXP bool DbgAssembleAt(duint addr, const char* instruction); 979 | BRIDGE_IMPEXP duint DbgModBaseFromName(const char* name); 980 | BRIDGE_IMPEXP void DbgDisasmAt(duint addr, DISASM_INSTR* instr); 981 | BRIDGE_IMPEXP bool DbgStackCommentGet(duint addr, STACK_COMMENT* comment); 982 | BRIDGE_IMPEXP void DbgGetThreadList(THREADLIST* list); 983 | BRIDGE_IMPEXP void DbgSettingsUpdated(); 984 | BRIDGE_IMPEXP void DbgDisasmFastAt(duint addr, BASIC_INSTRUCTION_INFO* basicinfo); 985 | BRIDGE_IMPEXP void DbgMenuEntryClicked(int hEntry); 986 | BRIDGE_IMPEXP bool DbgFunctionGet(duint addr, duint* start, duint* end); 987 | BRIDGE_IMPEXP bool DbgFunctionOverlaps(duint start, duint end); 988 | BRIDGE_IMPEXP bool DbgFunctionAdd(duint start, duint end); 989 | BRIDGE_IMPEXP bool DbgFunctionDel(duint addr); 990 | BRIDGE_IMPEXP bool DbgArgumentGet(duint addr, duint* start, duint* end); 991 | BRIDGE_IMPEXP bool DbgArgumentOverlaps(duint start, duint end); 992 | BRIDGE_IMPEXP bool DbgArgumentAdd(duint start, duint end); 993 | BRIDGE_IMPEXP bool DbgArgumentDel(duint addr); 994 | BRIDGE_IMPEXP bool DbgLoopGet(int depth, duint addr, duint* start, duint* end); 995 | BRIDGE_IMPEXP bool DbgLoopOverlaps(int depth, duint start, duint end); 996 | BRIDGE_IMPEXP bool DbgLoopAdd(duint start, duint end); 997 | BRIDGE_IMPEXP bool DbgLoopDel(int depth, duint addr); 998 | BRIDGE_IMPEXP bool DbgXrefAdd(duint addr, duint from); 999 | BRIDGE_IMPEXP bool DbgXrefDelAll(duint addr); 1000 | BRIDGE_IMPEXP bool DbgXrefGet(duint addr, XREF_INFO* info); 1001 | BRIDGE_IMPEXP size_t DbgGetXrefCountAt(duint addr); 1002 | BRIDGE_IMPEXP XREFTYPE DbgGetXrefTypeAt(duint addr); 1003 | BRIDGE_IMPEXP bool DbgIsRunLocked(); 1004 | BRIDGE_IMPEXP bool DbgIsBpDisabled(duint addr); 1005 | BRIDGE_IMPEXP bool DbgSetAutoCommentAt(duint addr, const char* text); 1006 | BRIDGE_IMPEXP void DbgClearAutoCommentRange(duint start, duint end); 1007 | BRIDGE_IMPEXP bool DbgSetAutoLabelAt(duint addr, const char* text); 1008 | BRIDGE_IMPEXP void DbgClearAutoLabelRange(duint start, duint end); 1009 | BRIDGE_IMPEXP bool DbgSetAutoBookmarkAt(duint addr); 1010 | BRIDGE_IMPEXP void DbgClearAutoBookmarkRange(duint start, duint end); 1011 | BRIDGE_IMPEXP bool DbgSetAutoFunctionAt(duint start, duint end); 1012 | BRIDGE_IMPEXP void DbgClearAutoFunctionRange(duint start, duint end); 1013 | BRIDGE_IMPEXP bool DbgGetStringAt(duint addr, char* text); 1014 | BRIDGE_IMPEXP const DBGFUNCTIONS* DbgFunctions(); 1015 | BRIDGE_IMPEXP bool DbgWinEvent(MSG* message, long* result); 1016 | BRIDGE_IMPEXP bool DbgWinEventGlobal(MSG* message); 1017 | BRIDGE_IMPEXP bool DbgIsRunning(); 1018 | BRIDGE_IMPEXP duint DbgGetTimeWastedCounter(); 1019 | BRIDGE_IMPEXP ARGTYPE DbgGetArgTypeAt(duint addr); 1020 | BRIDGE_IMPEXP void* DbgGetEncodeTypeBuffer(duint addr, duint* size); 1021 | BRIDGE_IMPEXP void DbgReleaseEncodeTypeBuffer(void* buffer); 1022 | BRIDGE_IMPEXP ENCODETYPE DbgGetEncodeTypeAt(duint addr, duint size); 1023 | BRIDGE_IMPEXP duint DbgGetEncodeSizeAt(duint addr, duint codesize); 1024 | BRIDGE_IMPEXP bool DbgSetEncodeType(duint addr, duint size, ENCODETYPE type); 1025 | BRIDGE_IMPEXP void DbgDelEncodeTypeRange(duint start, duint end); 1026 | BRIDGE_IMPEXP void DbgDelEncodeTypeSegment(duint start); 1027 | BRIDGE_IMPEXP bool DbgGetWatchList(ListOf(WATCHINFO) list); 1028 | BRIDGE_IMPEXP void DbgSelChanged(int hWindow, duint VA); 1029 | BRIDGE_IMPEXP HANDLE DbgGetProcessHandle(); 1030 | BRIDGE_IMPEXP HANDLE DbgGetThreadHandle(); 1031 | BRIDGE_IMPEXP DWORD DbgGetProcessId(); 1032 | BRIDGE_IMPEXP DWORD DbgGetThreadId(); 1033 | BRIDGE_IMPEXP duint DbgGetPebAddress(DWORD ProcessId); 1034 | BRIDGE_IMPEXP duint DbgGetTebAddress(DWORD ThreadId); 1035 | BRIDGE_IMPEXP bool DbgAnalyzeFunction(duint entry, BridgeCFGraphList* graph); 1036 | BRIDGE_IMPEXP duint DbgEval(const char* expression, bool* success = 0); 1037 | BRIDGE_IMPEXP void DbgMenuPrepare(int hMenu); 1038 | BRIDGE_IMPEXP void DbgGetSymbolInfo(const SYMBOLPTR* symbolptr, SYMBOLINFO* info); 1039 | 1040 | //Gui defines 1041 | #define GUI_PLUGIN_MENU 0 1042 | #define GUI_DISASM_MENU 1 1043 | #define GUI_DUMP_MENU 2 1044 | #define GUI_STACK_MENU 3 1045 | 1046 | #define GUI_DISASSEMBLY 0 1047 | #define GUI_DUMP 1 1048 | #define GUI_STACK 2 1049 | #define GUI_GRAPH 3 1050 | #define GUI_MEMMAP 4 1051 | #define GUI_SYMMOD 5 1052 | 1053 | #define GUI_MAX_LINE_SIZE 65536 1054 | #define GUI_MAX_DISASSEMBLY_SIZE 2048 1055 | 1056 | //Gui enums 1057 | typedef enum 1058 | { 1059 | GUI_DISASSEMBLE_AT, // param1=(duint)va, param2=(duint)cip 1060 | GUI_SET_DEBUG_STATE, // param1=(DBGSTATE)state, param2=unused 1061 | GUI_ADD_MSG_TO_LOG, // param1=(const char*)msg, param2=unused 1062 | GUI_CLEAR_LOG, // param1=unused, param2=unused 1063 | GUI_UPDATE_REGISTER_VIEW, // param1=unused, param2=unused 1064 | GUI_UPDATE_DISASSEMBLY_VIEW, // param1=unused, param2=unused 1065 | GUI_UPDATE_BREAKPOINTS_VIEW, // param1=unused, param2=unused 1066 | GUI_UPDATE_WINDOW_TITLE, // param1=(const char*)file, param2=unused 1067 | GUI_GET_WINDOW_HANDLE, // param1=unused, param2=unused 1068 | GUI_DUMP_AT, // param1=(duint)va param2=unused 1069 | GUI_SCRIPT_ADD, // param1=int count, param2=const char** lines 1070 | GUI_SCRIPT_CLEAR, // param1=unused, param2=unused 1071 | GUI_SCRIPT_SETIP, // param1=int line, param2=unused 1072 | GUI_SCRIPT_ERROR, // param1=int line, param2=const char* message 1073 | GUI_SCRIPT_SETTITLE, // param1=const char* title, param2=unused 1074 | GUI_SCRIPT_SETINFOLINE, // param1=int line, param2=const char* info 1075 | GUI_SCRIPT_MESSAGE, // param1=const char* message, param2=unused 1076 | GUI_SCRIPT_MSGYN, // param1=const char* message, param2=unused 1077 | GUI_SYMBOL_LOG_ADD, // param1(const char*)msg, param2=unused 1078 | GUI_SYMBOL_LOG_CLEAR, // param1=unused, param2=unused 1079 | GUI_SYMBOL_SET_PROGRESS, // param1=int percent param2=unused 1080 | GUI_SYMBOL_UPDATE_MODULE_LIST, // param1=int count, param2=SYMBOLMODULEINFO* modules 1081 | GUI_REF_ADDCOLUMN, // param1=int width, param2=(const char*)title 1082 | GUI_REF_SETROWCOUNT, // param1=int rows, param2=unused 1083 | GUI_REF_GETROWCOUNT, // param1=unused, param2=unused 1084 | GUI_REF_DELETEALLCOLUMNS, // param1=unused, param2=unused 1085 | GUI_REF_SETCELLCONTENT, // param1=(CELLINFO*)info, param2=unused 1086 | GUI_REF_GETCELLCONTENT, // param1=int row, param2=int col 1087 | GUI_REF_RELOADDATA, // param1=unused, param2=unused 1088 | GUI_REF_SETSINGLESELECTION, // param1=int index, param2=bool scroll 1089 | GUI_REF_SETPROGRESS, // param1=int progress, param2=unused 1090 | GUI_REF_SETCURRENTTASKPROGRESS, // param1=int progress, param2=const char* taskTitle 1091 | GUI_REF_SETSEARCHSTARTCOL, // param1=int col param2=unused 1092 | GUI_STACK_DUMP_AT, // param1=duint addr, param2=duint csp 1093 | GUI_UPDATE_DUMP_VIEW, // param1=unused, param2=unused 1094 | GUI_UPDATE_THREAD_VIEW, // param1=unused, param2=unused 1095 | GUI_ADD_RECENT_FILE, // param1=(const char*)file, param2=unused 1096 | GUI_SET_LAST_EXCEPTION, // param1=unsigned int code, param2=unused 1097 | GUI_GET_DISASSEMBLY, // param1=duint addr, param2=char* text 1098 | GUI_MENU_ADD, // param1=int hMenu, param2=const char* title 1099 | GUI_MENU_ADD_ENTRY, // param1=int hMenu, param2=const char* title 1100 | GUI_MENU_ADD_SEPARATOR, // param1=int hMenu, param2=unused 1101 | GUI_MENU_CLEAR, // param1=int hMenu, param2=unused 1102 | GUI_SELECTION_GET, // param1=int hWindow, param2=SELECTIONDATA* selection 1103 | GUI_SELECTION_SET, // param1=int hWindow, param2=const SELECTIONDATA* selection 1104 | GUI_GETLINE_WINDOW, // param1=const char* title, param2=char* text 1105 | GUI_AUTOCOMPLETE_ADDCMD, // param1=const char* cmd, param2=ununsed 1106 | GUI_AUTOCOMPLETE_DELCMD, // param1=const char* cmd, param2=ununsed 1107 | GUI_AUTOCOMPLETE_CLEARALL, // param1=unused, param2=unused 1108 | GUI_SCRIPT_ENABLEHIGHLIGHTING, // param1=bool enable, param2=unused 1109 | GUI_ADD_MSG_TO_STATUSBAR, // param1=const char* msg, param2=unused 1110 | GUI_UPDATE_SIDEBAR, // param1=unused, param2=unused 1111 | GUI_REPAINT_TABLE_VIEW, // param1=unused, param2=unused 1112 | GUI_UPDATE_PATCHES, // param1=unused, param2=unused 1113 | GUI_UPDATE_CALLSTACK, // param1=unused, param2=unused 1114 | GUI_UPDATE_SEHCHAIN, // param1=unused, param2=unused 1115 | GUI_SYMBOL_REFRESH_CURRENT, // param1=unused, param2=unused 1116 | GUI_UPDATE_MEMORY_VIEW, // param1=unused, param2=unused 1117 | GUI_REF_INITIALIZE, // param1=const char* name, param2=unused 1118 | GUI_LOAD_SOURCE_FILE, // param1=const char* path, param2=duint addr 1119 | GUI_MENU_SET_ICON, // param1=int hMenu, param2=ICONINFO* 1120 | GUI_MENU_SET_ENTRY_ICON, // param1=int hEntry, param2=ICONINFO* 1121 | GUI_SHOW_CPU, // param1=unused, param2=unused 1122 | GUI_ADD_QWIDGET_TAB, // param1=QWidget*, param2=unused 1123 | GUI_SHOW_QWIDGET_TAB, // param1=QWidget*, param2=unused 1124 | GUI_CLOSE_QWIDGET_TAB, // param1=QWidget*, param2=unused 1125 | GUI_EXECUTE_ON_GUI_THREAD, // param1=GUICALLBACK, param2=unused 1126 | GUI_UPDATE_TIME_WASTED_COUNTER, // param1=unused, param2=unused 1127 | GUI_SET_GLOBAL_NOTES, // param1=const char* text, param2=unused 1128 | GUI_GET_GLOBAL_NOTES, // param1=char** text, param2=unused 1129 | GUI_SET_DEBUGGEE_NOTES, // param1=const char* text, param2=unused 1130 | GUI_GET_DEBUGGEE_NOTES, // param1=char** text, param2=unused 1131 | GUI_DUMP_AT_N, // param1=int index, param2=duint va 1132 | GUI_DISPLAY_WARNING, // param1=const char *text, param2=unused 1133 | GUI_REGISTER_SCRIPT_LANG, // param1=SCRIPTTYPEINFO* info, param2=unused 1134 | GUI_UNREGISTER_SCRIPT_LANG, // param1=int id, param2=unused 1135 | GUI_UPDATE_ARGUMENT_VIEW, // param1=unused, param2=unused 1136 | GUI_FOCUS_VIEW, // param1=int hWindow, param2=unused 1137 | GUI_UPDATE_WATCH_VIEW, // param1=unused, param2=unused 1138 | GUI_LOAD_GRAPH, // param1=BridgeCFGraphList* param2=unused 1139 | GUI_GRAPH_AT, // param1=duint addr param2=unused 1140 | GUI_UPDATE_GRAPH_VIEW, // param1=unused, param2=unused 1141 | GUI_SET_LOG_ENABLED, // param1=bool isEnabled param2=unused 1142 | GUI_ADD_FAVOURITE_TOOL, // param1=const char* name param2=const char* description 1143 | GUI_ADD_FAVOURITE_COMMAND, // param1=const char* command param2=const char* shortcut 1144 | GUI_SET_FAVOURITE_TOOL_SHORTCUT,// param1=const char* name param2=const char* shortcut 1145 | GUI_FOLD_DISASSEMBLY, // param1=duint startAddress param2=duint length 1146 | GUI_SELECT_IN_MEMORY_MAP, // param1=duint addr, param2=unused 1147 | GUI_GET_ACTIVE_VIEW, // param1=ACTIVEVIEW*, param2=unused 1148 | GUI_MENU_SET_ENTRY_CHECKED, // param1=int hEntry, param2=bool checked 1149 | GUI_ADD_INFO_LINE, // param1=const char* infoline, param2=unused 1150 | GUI_PROCESS_EVENTS, // param1=unused, param2=unused 1151 | GUI_TYPE_ADDNODE, // param1=void* parent, param2=TYPEDESCRIPTOR* type 1152 | GUI_TYPE_CLEAR, // param1=unused, param2=unused 1153 | GUI_UPDATE_TYPE_WIDGET, // param1=unused, param2=unused 1154 | GUI_CLOSE_APPLICATION, // param1=unused, param2=unused 1155 | GUI_MENU_SET_VISIBLE, // param1=int hMenu, param2=bool visible 1156 | GUI_MENU_SET_ENTRY_VISIBLE, // param1=int hEntry, param2=bool visible 1157 | GUI_MENU_SET_NAME, // param1=int hMenu, param2=const char* name 1158 | GUI_MENU_SET_ENTRY_NAME, // param1=int hEntry, param2=const char* name 1159 | GUI_FLUSH_LOG, // param1=unused, param2=unused 1160 | GUI_MENU_SET_ENTRY_HOTKEY, // param1=int hEntry, param2=const char* hack 1161 | GUI_REF_SEARCH_GETROWCOUNT, // param1=unused, param2=unused 1162 | GUI_REF_SEARCH_GETCELLCONTENT, // param1=int row, param2=int col 1163 | GUI_MENU_REMOVE, // param1=int hEntryMenu, param2=unused 1164 | GUI_REF_ADDCOMMAND, // param1=const char* title, param2=const char* command 1165 | GUI_OPEN_TRACE_FILE, // param1=const char* file name,param2=unused 1166 | GUI_UPDATE_TRACE_BROWSER, // param1=unused, param2=unused 1167 | GUI_INVALIDATE_SYMBOL_SOURCE, // param1=duint base, param2=unused 1168 | } GUIMSG; 1169 | 1170 | //GUI Typedefs 1171 | struct _TYPEDESCRIPTOR; 1172 | 1173 | typedef void (*GUICALLBACK)(); 1174 | typedef bool (*GUISCRIPTEXECUTE)(const char* text); 1175 | typedef void (*GUISCRIPTCOMPLETER)(const char* text, char** entries, int* entryCount); 1176 | typedef bool (*TYPETOSTRING)(const struct _TYPEDESCRIPTOR* type, char* dest, size_t* destCount); //don't change destCount for final failure 1177 | 1178 | //GUI structures 1179 | typedef struct 1180 | { 1181 | int row; 1182 | int col; 1183 | const char* str; 1184 | } CELLINFO; 1185 | 1186 | typedef struct 1187 | { 1188 | duint start; 1189 | duint end; 1190 | } SELECTIONDATA; 1191 | 1192 | typedef struct 1193 | { 1194 | const void* data; 1195 | duint size; 1196 | } ICONDATA; 1197 | 1198 | typedef struct 1199 | { 1200 | char name[64]; 1201 | int id; 1202 | GUISCRIPTEXECUTE execute; 1203 | GUISCRIPTCOMPLETER completeCommand; 1204 | } SCRIPTTYPEINFO; 1205 | 1206 | typedef struct 1207 | { 1208 | void* titleHwnd; 1209 | void* classHwnd; 1210 | char title[MAX_STRING_SIZE]; 1211 | char className[MAX_STRING_SIZE]; 1212 | } ACTIVEVIEW; 1213 | 1214 | typedef struct _TYPEDESCRIPTOR 1215 | { 1216 | bool expanded; //is the type node expanded? 1217 | bool reverse; //big endian? 1218 | const char* name; //type name (int b) 1219 | duint addr; //virtual address 1220 | duint offset; //offset to addr for the actual location 1221 | int id; //type id 1222 | int size; //sizeof(type) 1223 | TYPETOSTRING callback; //convert to string 1224 | void* userdata; //user data 1225 | } TYPEDESCRIPTOR; 1226 | 1227 | //GUI functions 1228 | //code page is utf8 1229 | BRIDGE_IMPEXP const char* GuiTranslateText(const char* Source); 1230 | BRIDGE_IMPEXP void GuiDisasmAt(duint addr, duint cip); 1231 | BRIDGE_IMPEXP void GuiSetDebugState(DBGSTATE state); 1232 | BRIDGE_IMPEXP void GuiSetDebugStateFast(DBGSTATE state); 1233 | BRIDGE_IMPEXP void GuiAddLogMessage(const char* msg); 1234 | BRIDGE_IMPEXP void GuiLogClear(); 1235 | BRIDGE_IMPEXP void GuiUpdateAllViews(); 1236 | BRIDGE_IMPEXP void GuiUpdateRegisterView(); 1237 | BRIDGE_IMPEXP void GuiUpdateDisassemblyView(); 1238 | BRIDGE_IMPEXP void GuiUpdateBreakpointsView(); 1239 | BRIDGE_IMPEXP void GuiUpdateWindowTitle(const char* filename); 1240 | BRIDGE_IMPEXP HWND GuiGetWindowHandle(); 1241 | BRIDGE_IMPEXP void GuiDumpAt(duint va); 1242 | BRIDGE_IMPEXP void GuiScriptAdd(int count, const char** lines); 1243 | BRIDGE_IMPEXP void GuiScriptClear(); 1244 | BRIDGE_IMPEXP void GuiScriptSetIp(int line); 1245 | BRIDGE_IMPEXP void GuiScriptError(int line, const char* message); 1246 | BRIDGE_IMPEXP void GuiScriptSetTitle(const char* title); 1247 | BRIDGE_IMPEXP void GuiScriptSetInfoLine(int line, const char* info); 1248 | BRIDGE_IMPEXP void GuiScriptMessage(const char* message); 1249 | BRIDGE_IMPEXP int GuiScriptMsgyn(const char* message); 1250 | BRIDGE_IMPEXP void GuiScriptEnableHighlighting(bool enable); 1251 | BRIDGE_IMPEXP void GuiSymbolLogAdd(const char* message); 1252 | BRIDGE_IMPEXP void GuiSymbolLogClear(); 1253 | BRIDGE_IMPEXP void GuiSymbolSetProgress(int percent); 1254 | BRIDGE_IMPEXP void GuiSymbolUpdateModuleList(int count, SYMBOLMODULEINFO* modules); 1255 | BRIDGE_IMPEXP void GuiSymbolRefreshCurrent(); 1256 | BRIDGE_IMPEXP void GuiReferenceAddColumn(int width, const char* title); 1257 | BRIDGE_IMPEXP void GuiReferenceSetRowCount(int count); 1258 | BRIDGE_IMPEXP int GuiReferenceGetRowCount(); 1259 | BRIDGE_IMPEXP int GuiReferenceSearchGetRowCount(); 1260 | BRIDGE_IMPEXP void GuiReferenceDeleteAllColumns(); 1261 | BRIDGE_IMPEXP void GuiReferenceInitialize(const char* name); 1262 | BRIDGE_IMPEXP void GuiReferenceSetCellContent(int row, int col, const char* str); 1263 | BRIDGE_IMPEXP char* GuiReferenceGetCellContent(int row, int col); 1264 | BRIDGE_IMPEXP char* GuiReferenceSearchGetCellContent(int row, int col); 1265 | BRIDGE_IMPEXP void GuiReferenceReloadData(); 1266 | BRIDGE_IMPEXP void GuiReferenceSetSingleSelection(int index, bool scroll); 1267 | BRIDGE_IMPEXP void GuiReferenceSetProgress(int progress); 1268 | BRIDGE_IMPEXP void GuiReferenceSetCurrentTaskProgress(int progress, const char* taskTitle); 1269 | BRIDGE_IMPEXP void GuiReferenceSetSearchStartCol(int col); 1270 | BRIDGE_IMPEXP void GuiStackDumpAt(duint addr, duint csp); 1271 | BRIDGE_IMPEXP void GuiUpdateDumpView(); 1272 | BRIDGE_IMPEXP void GuiUpdateWatchView(); 1273 | BRIDGE_IMPEXP void GuiUpdateThreadView(); 1274 | BRIDGE_IMPEXP void GuiUpdateMemoryView(); 1275 | BRIDGE_IMPEXP void GuiAddRecentFile(const char* file); 1276 | BRIDGE_IMPEXP void GuiSetLastException(unsigned int exception); 1277 | BRIDGE_IMPEXP bool GuiGetDisassembly(duint addr, char* text); 1278 | BRIDGE_IMPEXP int GuiMenuAdd(int hMenu, const char* title); 1279 | BRIDGE_IMPEXP int GuiMenuAddEntry(int hMenu, const char* title); 1280 | BRIDGE_IMPEXP void GuiMenuAddSeparator(int hMenu); 1281 | BRIDGE_IMPEXP void GuiMenuClear(int hMenu); 1282 | BRIDGE_IMPEXP void GuiMenuRemove(int hEntryMenu); 1283 | BRIDGE_IMPEXP bool GuiSelectionGet(int hWindow, SELECTIONDATA* selection); 1284 | BRIDGE_IMPEXP bool GuiSelectionSet(int hWindow, const SELECTIONDATA* selection); 1285 | BRIDGE_IMPEXP bool GuiGetLineWindow(const char* title, char* text); 1286 | BRIDGE_IMPEXP void GuiAutoCompleteAddCmd(const char* cmd); 1287 | BRIDGE_IMPEXP void GuiAutoCompleteDelCmd(const char* cmd); 1288 | BRIDGE_IMPEXP void GuiAutoCompleteClearAll(); 1289 | BRIDGE_IMPEXP void GuiAddStatusBarMessage(const char* msg); 1290 | BRIDGE_IMPEXP void GuiUpdateSideBar(); 1291 | BRIDGE_IMPEXP void GuiRepaintTableView(); 1292 | BRIDGE_IMPEXP void GuiUpdatePatches(); 1293 | BRIDGE_IMPEXP void GuiUpdateCallStack(); 1294 | BRIDGE_IMPEXP void GuiUpdateSEHChain(); 1295 | BRIDGE_IMPEXP void GuiLoadSourceFileEx(const char* path, duint addr); 1296 | BRIDGE_IMPEXP void GuiMenuSetIcon(int hMenu, const ICONDATA* icon); 1297 | BRIDGE_IMPEXP void GuiMenuSetEntryIcon(int hEntry, const ICONDATA* icon); 1298 | BRIDGE_IMPEXP void GuiMenuSetEntryChecked(int hEntry, bool checked); 1299 | BRIDGE_IMPEXP void GuiMenuSetVisible(int hMenu, bool visible); 1300 | BRIDGE_IMPEXP void GuiMenuSetEntryVisible(int hEntry, bool visible); 1301 | BRIDGE_IMPEXP void GuiMenuSetName(int hMenu, const char* name); 1302 | BRIDGE_IMPEXP void GuiMenuSetEntryName(int hEntry, const char* name); 1303 | BRIDGE_IMPEXP void GuiMenuSetEntryHotkey(int hEntry, const char* hack); 1304 | BRIDGE_IMPEXP void GuiShowCpu(); 1305 | BRIDGE_IMPEXP void GuiAddQWidgetTab(void* qWidget); 1306 | BRIDGE_IMPEXP void GuiShowQWidgetTab(void* qWidget); 1307 | BRIDGE_IMPEXP void GuiCloseQWidgetTab(void* qWidget); 1308 | BRIDGE_IMPEXP void GuiExecuteOnGuiThread(GUICALLBACK cbGuiThread); 1309 | BRIDGE_IMPEXP void GuiUpdateTimeWastedCounter(); 1310 | BRIDGE_IMPEXP void GuiSetGlobalNotes(const char* text); 1311 | BRIDGE_IMPEXP void GuiGetGlobalNotes(char** text); 1312 | BRIDGE_IMPEXP void GuiSetDebuggeeNotes(const char* text); 1313 | BRIDGE_IMPEXP void GuiGetDebuggeeNotes(char** text); 1314 | BRIDGE_IMPEXP void GuiDumpAtN(duint va, int index); 1315 | BRIDGE_IMPEXP void GuiDisplayWarning(const char* title, const char* text); 1316 | BRIDGE_IMPEXP void GuiRegisterScriptLanguage(SCRIPTTYPEINFO* info); 1317 | BRIDGE_IMPEXP void GuiUnregisterScriptLanguage(int id); 1318 | BRIDGE_IMPEXP void GuiUpdateArgumentWidget(); 1319 | BRIDGE_IMPEXP void GuiFocusView(int hWindow); 1320 | BRIDGE_IMPEXP bool GuiIsUpdateDisabled(); 1321 | BRIDGE_IMPEXP void GuiUpdateEnable(bool updateNow); 1322 | BRIDGE_IMPEXP void GuiUpdateDisable(); 1323 | BRIDGE_IMPEXP bool GuiLoadGraph(BridgeCFGraphList* graph, duint addr); 1324 | BRIDGE_IMPEXP duint GuiGraphAt(duint addr); 1325 | BRIDGE_IMPEXP void GuiUpdateGraphView(); 1326 | BRIDGE_IMPEXP void GuiDisableLog(); 1327 | BRIDGE_IMPEXP void GuiEnableLog(); 1328 | BRIDGE_IMPEXP void GuiAddFavouriteTool(const char* name, const char* description); 1329 | BRIDGE_IMPEXP void GuiAddFavouriteCommand(const char* name, const char* shortcut); 1330 | BRIDGE_IMPEXP void GuiSetFavouriteToolShortcut(const char* name, const char* shortcut); 1331 | BRIDGE_IMPEXP void GuiFoldDisassembly(duint startAddress, duint length); 1332 | BRIDGE_IMPEXP void GuiSelectInMemoryMap(duint addr); 1333 | BRIDGE_IMPEXP void GuiGetActiveView(ACTIVEVIEW* activeView); 1334 | BRIDGE_IMPEXP void GuiAddInfoLine(const char* infoLine); 1335 | BRIDGE_IMPEXP void GuiProcessEvents(); 1336 | BRIDGE_IMPEXP void* GuiTypeAddNode(void* parent, const TYPEDESCRIPTOR* type); 1337 | BRIDGE_IMPEXP bool GuiTypeClear(); 1338 | BRIDGE_IMPEXP void GuiUpdateTypeWidget(); 1339 | BRIDGE_IMPEXP void GuiCloseApplication(); 1340 | BRIDGE_IMPEXP void GuiFlushLog(); 1341 | BRIDGE_IMPEXP void GuiReferenceAddCommand(const char* title, const char* command); 1342 | BRIDGE_IMPEXP void GuiUpdateTraceBrowser(); 1343 | BRIDGE_IMPEXP void GuiOpenTraceFile(const char* fileName); 1344 | BRIDGE_IMPEXP void GuiInvalidateSymbolSource(duint base); 1345 | 1346 | #ifdef __cplusplus 1347 | } 1348 | #endif 1349 | 1350 | #pragma pack(pop) 1351 | 1352 | #endif // _BRIDGEMAIN_H_ 1353 | -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/dbghelp/dbghelp_x64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/dbghelp/dbghelp_x64.a -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/dbghelp/dbghelp_x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/dbghelp/dbghelp_x64.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/dbghelp/dbghelp_x86.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/dbghelp/dbghelp_x86.a -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/dbghelp/dbghelp_x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/dbghelp/dbghelp_x86.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/jansson/jansson.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | */ 7 | 8 | #ifndef JANSSON_H 9 | #define JANSSON_H 10 | 11 | #include 12 | #include /* for size_t */ 13 | #include 14 | 15 | #include "jansson_config.h" 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /* version */ 22 | 23 | #define JANSSON_MAJOR_VERSION 2 24 | #define JANSSON_MINOR_VERSION 9 25 | #define JANSSON_MICRO_VERSION 0 26 | 27 | /* Micro version is omitted if it's 0 */ 28 | #define JANSSON_VERSION "2.9" 29 | 30 | /* Version as a 3-byte hex number, e.g. 0x010201 == 1.2.1. Use this 31 | for numeric comparisons, e.g. #if JANSSON_VERSION_HEX >= ... */ 32 | #define JANSSON_VERSION_HEX ((JANSSON_MAJOR_VERSION << 16) | \ 33 | (JANSSON_MINOR_VERSION << 8) | \ 34 | (JANSSON_MICRO_VERSION << 0)) 35 | 36 | 37 | /* types */ 38 | 39 | typedef enum 40 | { 41 | JSON_OBJECT, 42 | JSON_ARRAY, 43 | JSON_STRING, 44 | JSON_INTEGER, 45 | JSON_REAL, 46 | JSON_TRUE, 47 | JSON_FALSE, 48 | JSON_NULL 49 | } json_type; 50 | 51 | typedef struct json_t 52 | { 53 | json_type type; 54 | size_t refcount; 55 | } json_t; 56 | 57 | #ifndef JANSSON_USING_CMAKE /* disabled if using cmake */ 58 | #if JSON_INTEGER_IS_LONG_LONG 59 | #ifdef _WIN32 60 | #define JSON_INTEGER_FORMAT "I64d" 61 | #else 62 | #define JSON_INTEGER_FORMAT "lld" 63 | #endif 64 | typedef long long json_int_t; 65 | #else 66 | #define JSON_INTEGER_FORMAT "ld" 67 | typedef long json_int_t; 68 | #endif /* JSON_INTEGER_IS_LONG_LONG */ 69 | #endif 70 | 71 | #define json_typeof(json) ((json)->type) 72 | #define json_is_object(json) ((json) && json_typeof(json) == JSON_OBJECT) 73 | #define json_is_array(json) ((json) && json_typeof(json) == JSON_ARRAY) 74 | #define json_is_string(json) ((json) && json_typeof(json) == JSON_STRING) 75 | #define json_is_integer(json) ((json) && json_typeof(json) == JSON_INTEGER) 76 | #define json_is_real(json) ((json) && json_typeof(json) == JSON_REAL) 77 | #define json_is_number(json) (json_is_integer(json) || json_is_real(json)) 78 | #define json_is_true(json) ((json) && json_typeof(json) == JSON_TRUE) 79 | #define json_is_false(json) ((json) && json_typeof(json) == JSON_FALSE) 80 | #define json_boolean_value json_is_true 81 | #define json_is_boolean(json) (json_is_true(json) || json_is_false(json)) 82 | #define json_is_null(json) ((json) && json_typeof(json) == JSON_NULL) 83 | 84 | /* construction, destruction, reference counting */ 85 | 86 | __declspec(dllimport) json_t* json_object(void); 87 | __declspec(dllimport) json_t* json_array(void); 88 | __declspec(dllimport) json_t* json_string(const char* value); 89 | __declspec(dllimport) json_t* json_stringn(const char* value, size_t len); 90 | __declspec(dllimport) json_t* json_string_nocheck(const char* value); 91 | __declspec(dllimport) json_t* json_stringn_nocheck(const char* value, size_t len); 92 | __declspec(dllimport) json_t* json_integer(json_int_t value); 93 | __declspec(dllimport) json_t* json_real(double value); 94 | __declspec(dllimport) json_t* json_true(void); 95 | __declspec(dllimport) json_t* json_false(void); 96 | #define json_boolean(val) ((val) ? json_true() : json_false()) 97 | __declspec(dllimport) json_t* json_null(void); 98 | 99 | static JSON_INLINE 100 | json_t* json_incref(json_t* json) 101 | { 102 | if(json && json->refcount != (size_t) - 1) 103 | ++json->refcount; 104 | return json; 105 | } 106 | 107 | /* do not call json_delete directly */ 108 | __declspec(dllimport) void json_delete(json_t* json); 109 | 110 | static JSON_INLINE 111 | void json_decref(json_t* json) 112 | { 113 | if(json && json->refcount != (size_t) - 1 && --json->refcount == 0) 114 | json_delete(json); 115 | } 116 | 117 | #if defined(__GNUC__) || defined(__clang__) 118 | static JSON_INLINE 119 | void json_decrefp(json_t** json) 120 | { 121 | if(json) 122 | { 123 | json_decref(*json); 124 | *json = NULL; 125 | } 126 | } 127 | 128 | #define json_auto_t json_t __attribute__((cleanup(json_decrefp))) 129 | #endif 130 | 131 | 132 | /* error reporting */ 133 | 134 | #define JSON_ERROR_TEXT_LENGTH 160 135 | #define JSON_ERROR_SOURCE_LENGTH 80 136 | 137 | typedef struct 138 | { 139 | int line; 140 | int column; 141 | int position; 142 | char source[JSON_ERROR_SOURCE_LENGTH]; 143 | char text[JSON_ERROR_TEXT_LENGTH]; 144 | } json_error_t; 145 | 146 | 147 | /* getters, setters, manipulation */ 148 | 149 | __declspec(dllimport) void json_object_seed(size_t seed); 150 | __declspec(dllimport) size_t json_object_size(const json_t* object); 151 | __declspec(dllimport) json_t* json_object_get(const json_t* object, const char* key); 152 | __declspec(dllimport) int json_object_set_new(json_t* object, const char* key, json_t* value); 153 | __declspec(dllimport) int json_object_set_new_nocheck(json_t* object, const char* key, json_t* value); 154 | __declspec(dllimport) int json_object_del(json_t* object, const char* key); 155 | __declspec(dllimport) int json_object_clear(json_t* object); 156 | __declspec(dllimport) int json_object_update(json_t* object, json_t* other); 157 | __declspec(dllimport) int json_object_update_existing(json_t* object, json_t* other); 158 | __declspec(dllimport) int json_object_update_missing(json_t* object, json_t* other); 159 | __declspec(dllimport) void* json_object_iter(json_t* object); 160 | __declspec(dllimport) void* json_object_iter_at(json_t* object, const char* key); 161 | __declspec(dllimport) void* json_object_key_to_iter(const char* key); 162 | __declspec(dllimport) void* json_object_iter_next(json_t* object, void* iter); 163 | __declspec(dllimport) const char* json_object_iter_key(void* iter); 164 | __declspec(dllimport) json_t* json_object_iter_value(void* iter); 165 | __declspec(dllimport) int json_object_iter_set_new(json_t* object, void* iter, json_t* value); 166 | 167 | #define json_object_foreach(object, key, value) \ 168 | for(key = json_object_iter_key(json_object_iter(object)); \ 169 | key && (value = json_object_iter_value(json_object_key_to_iter(key))); \ 170 | key = json_object_iter_key(json_object_iter_next(object, json_object_key_to_iter(key)))) 171 | 172 | #define json_object_foreach_safe(object, n, key, value) \ 173 | for(key = json_object_iter_key(json_object_iter(object)), \ 174 | n = json_object_iter_next(object, json_object_key_to_iter(key)); \ 175 | key && (value = json_object_iter_value(json_object_key_to_iter(key))); \ 176 | key = json_object_iter_key(n), \ 177 | n = json_object_iter_next(object, json_object_key_to_iter(key))) 178 | 179 | #define json_array_foreach(array, index, value) \ 180 | for(index = 0; \ 181 | index < json_array_size(array) && (value = json_array_get(array, index)); \ 182 | index++) 183 | 184 | static JSON_INLINE 185 | int json_object_set(json_t* object, const char* key, json_t* value) 186 | { 187 | return json_object_set_new(object, key, json_incref(value)); 188 | } 189 | 190 | static JSON_INLINE 191 | int json_object_set_nocheck(json_t* object, const char* key, json_t* value) 192 | { 193 | return json_object_set_new_nocheck(object, key, json_incref(value)); 194 | } 195 | 196 | static JSON_INLINE 197 | int json_object_iter_set(json_t* object, void* iter, json_t* value) 198 | { 199 | return json_object_iter_set_new(object, iter, json_incref(value)); 200 | } 201 | 202 | __declspec(dllimport) size_t json_array_size(const json_t* array); 203 | __declspec(dllimport) json_t* json_array_get(const json_t* array, size_t index); 204 | __declspec(dllimport) int json_array_set_new(json_t* array, size_t index, json_t* value); 205 | __declspec(dllimport) int json_array_append_new(json_t* array, json_t* value); 206 | __declspec(dllimport) int json_array_insert_new(json_t* array, size_t index, json_t* value); 207 | __declspec(dllimport) int json_array_remove(json_t* array, size_t index); 208 | __declspec(dllimport) int json_array_clear(json_t* array); 209 | __declspec(dllimport) int json_array_extend(json_t* array, json_t* other); 210 | 211 | static JSON_INLINE 212 | int json_array_set(json_t* array, size_t ind, json_t* value) 213 | { 214 | return json_array_set_new(array, ind, json_incref(value)); 215 | } 216 | 217 | static JSON_INLINE 218 | int json_array_append(json_t* array, json_t* value) 219 | { 220 | return json_array_append_new(array, json_incref(value)); 221 | } 222 | 223 | static JSON_INLINE 224 | int json_array_insert(json_t* array, size_t ind, json_t* value) 225 | { 226 | return json_array_insert_new(array, ind, json_incref(value)); 227 | } 228 | 229 | __declspec(dllimport) const char* json_string_value(const json_t* string); 230 | __declspec(dllimport) size_t json_string_length(const json_t* string); 231 | __declspec(dllimport) json_int_t json_integer_value(const json_t* integer); 232 | __declspec(dllimport) double json_real_value(const json_t* real); 233 | __declspec(dllimport) double json_number_value(const json_t* json); 234 | 235 | __declspec(dllimport) int json_string_set(json_t* string, const char* value); 236 | __declspec(dllimport) int json_string_setn(json_t* string, const char* value, size_t len); 237 | __declspec(dllimport) int json_string_set_nocheck(json_t* string, const char* value); 238 | __declspec(dllimport) int json_string_setn_nocheck(json_t* string, const char* value, size_t len); 239 | __declspec(dllimport) int json_integer_set(json_t* integer, json_int_t value); 240 | __declspec(dllimport) int json_real_set(json_t* real, double value); 241 | 242 | /* pack, unpack */ 243 | 244 | __declspec(dllimport) json_t* json_pack(const char* fmt, ...); 245 | __declspec(dllimport) json_t* json_pack_ex(json_error_t* error, size_t flags, const char* fmt, ...); 246 | __declspec(dllimport) json_t* json_vpack_ex(json_error_t* error, size_t flags, const char* fmt, va_list ap); 247 | 248 | #define JSON_VALIDATE_ONLY 0x1 249 | #define JSON_STRICT 0x2 250 | 251 | __declspec(dllimport) int json_unpack(json_t* root, const char* fmt, ...); 252 | __declspec(dllimport) int json_unpack_ex(json_t* root, json_error_t* error, size_t flags, const char* fmt, ...); 253 | __declspec(dllimport) int json_vunpack_ex(json_t* root, json_error_t* error, size_t flags, const char* fmt, va_list ap); 254 | 255 | 256 | /* equality */ 257 | 258 | __declspec(dllimport) int json_equal(json_t* value1, json_t* value2); 259 | 260 | 261 | /* copying */ 262 | 263 | __declspec(dllimport) json_t* json_copy(json_t* value); 264 | __declspec(dllimport) json_t* json_deep_copy(const json_t* value); 265 | 266 | 267 | /* decoding */ 268 | 269 | #define JSON_REJECT_DUPLICATES 0x1 270 | #define JSON_DISABLE_EOF_CHECK 0x2 271 | #define JSON_DECODE_ANY 0x4 272 | #define JSON_DECODE_INT_AS_REAL 0x8 273 | #define JSON_ALLOW_NUL 0x10 274 | 275 | typedef size_t (*json_load_callback_t)(void* buffer, size_t buflen, void* data); 276 | 277 | __declspec(dllimport) json_t* json_loads(const char* input, size_t flags, json_error_t* error); 278 | __declspec(dllimport) json_t* json_loadb(const char* buffer, size_t buflen, size_t flags, json_error_t* error); 279 | __declspec(dllimport) json_t* json_loadf(FILE* input, size_t flags, json_error_t* error); 280 | __declspec(dllimport) json_t* json_load_file(const char* path, size_t flags, json_error_t* error); 281 | __declspec(dllimport) json_t* json_load_callback(json_load_callback_t callback, void* data, size_t flags, json_error_t* error); 282 | 283 | 284 | /* encoding */ 285 | 286 | #define JSON_MAX_INDENT 0x1F 287 | #define JSON_INDENT(n) ((n) & JSON_MAX_INDENT) 288 | #define JSON_COMPACT 0x20 289 | #define JSON_ENSURE_ASCII 0x40 290 | #define JSON_SORT_KEYS 0x80 291 | #define JSON_PRESERVE_ORDER 0x100 292 | #define JSON_ENCODE_ANY 0x200 293 | #define JSON_ESCAPE_SLASH 0x400 294 | #define JSON_REAL_PRECISION(n) (((n) & 0x1F) << 11) 295 | 296 | typedef int (*json_dump_callback_t)(const char* buffer, size_t size, void* data); 297 | 298 | __declspec(dllimport) char* json_dumps(const json_t* json, size_t flags); 299 | __declspec(dllimport) int json_dumpf(const json_t* json, FILE* output, size_t flags); 300 | __declspec(dllimport) int json_dump_file(const json_t* json, const char* path, size_t flags); 301 | __declspec(dllimport) int json_dump_callback(const json_t* json, json_dump_callback_t callback, void* data, size_t flags); 302 | 303 | /* custom memory allocation */ 304 | 305 | typedef void* (*json_malloc_t)(size_t); 306 | typedef void (*json_free_t)(void*); 307 | 308 | __declspec(dllimport) void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn); 309 | __declspec(dllimport) void json_get_alloc_funcs(json_malloc_t* malloc_fn, json_free_t* free_fn); 310 | 311 | #ifdef __cplusplus 312 | } 313 | #endif 314 | 315 | #endif 316 | -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/jansson/jansson_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | * 7 | * 8 | * This file specifies a part of the site-specific configuration for 9 | * Jansson, namely those things that affect the public API in 10 | * jansson.h. 11 | * 12 | * The CMake system will generate the jansson_config.h file and 13 | * copy it to the build and install directories. 14 | */ 15 | 16 | #ifndef JANSSON_CONFIG_H 17 | #define JANSSON_CONFIG_H 18 | 19 | /* Define this so that we can disable scattered automake configuration in source files */ 20 | #ifndef JANSSON_USING_CMAKE 21 | #define JANSSON_USING_CMAKE 22 | #endif 23 | 24 | /* Note: when using cmake, JSON_INTEGER_IS_LONG_LONG is not defined nor used, 25 | * as we will also check for __int64 etc types. 26 | * (the definition was used in the automake system) */ 27 | 28 | /* Bring in the cmake-detected defines */ 29 | #define HAVE_STDINT_H 1 30 | /* #undef HAVE_INTTYPES_H */ 31 | /* #undef HAVE_SYS_TYPES_H */ 32 | 33 | /* Include our standard type header for the integer typedef */ 34 | 35 | #if defined(HAVE_STDINT_H) 36 | # include 37 | #elif defined(HAVE_INTTYPES_H) 38 | # include 39 | #elif defined(HAVE_SYS_TYPES_H) 40 | # include 41 | #endif 42 | 43 | 44 | /* If your compiler supports the inline keyword in C, JSON_INLINE is 45 | defined to `inline', otherwise empty. In C++, the inline is always 46 | supported. */ 47 | #ifdef __cplusplus 48 | #define JSON_INLINE inline 49 | #else 50 | #define JSON_INLINE __inline 51 | #endif 52 | 53 | 54 | #define json_int_t long long 55 | #define json_strtoint strtoll 56 | #define JSON_INTEGER_FORMAT "I64d" 57 | 58 | 59 | /* If locale.h and localeconv() are available, define to 1, otherwise to 0. */ 60 | #define JSON_HAVE_LOCALECONV 1 61 | 62 | 63 | /* Maximum recursion depth for parsing JSON input. 64 | This limits the depth of e.g. array-within-array constructions. */ 65 | #define JSON_PARSER_MAX_DEPTH 2048 66 | 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/jansson/jansson_x64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/jansson/jansson_x64.a -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/jansson/jansson_x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/jansson/jansson_x64.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/jansson/jansson_x64dbg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "jansson.h" 4 | 5 | typedef json_t* JSON; 6 | 7 | static JSON_INLINE 8 | json_t* json_hex(unsigned json_int_t value) 9 | { 10 | char hexvalue[20]; 11 | sprintf_s(hexvalue, "0x%llX", value); 12 | return json_string(hexvalue); 13 | } 14 | 15 | static JSON_INLINE 16 | unsigned json_int_t json_hex_value(const json_t* hex) 17 | { 18 | unsigned json_int_t ret = 0; 19 | const char* hexvalue; 20 | hexvalue = json_string_value(hex); 21 | if(!hexvalue) 22 | return 0; 23 | sscanf_s(hexvalue, "0x%llX", &ret); 24 | return ret; 25 | } 26 | -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/jansson/jansson_x86.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/jansson/jansson_x86.a -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/jansson/jansson_x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/jansson/jansson_x86.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/lz4/lz4.h: -------------------------------------------------------------------------------- 1 | /* 2 | LZ4 - Fast LZ compression algorithm 3 | Header File 4 | Copyright (C) 2011-2014, Yann Collet. 5 | BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are 9 | met: 10 | 11 | * Redistributions of source code must retain the above copyright 12 | notice, this list of conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following disclaimer 15 | in the documentation and/or other materials provided with the 16 | distribution. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | You can contact the author at : 31 | - LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html 32 | - LZ4 source repository : http://code.google.com/p/lz4/ 33 | */ 34 | #ifndef _LZ4_H 35 | #define _LZ4_H 36 | 37 | #if defined (__cplusplus) 38 | extern "C" 39 | { 40 | #endif 41 | 42 | 43 | /************************************** 44 | Version 45 | **************************************/ 46 | #define LZ4_VERSION_MAJOR 1 /* for major interface/format changes */ 47 | #define LZ4_VERSION_MINOR 1 /* for minor interface/format changes */ 48 | #define LZ4_VERSION_RELEASE 3 /* for tweaks, bug-fixes, or development */ 49 | 50 | 51 | /************************************** 52 | Compiler Options 53 | **************************************/ 54 | #if (defined(__GNUC__) && defined(__STRICT_ANSI__)) || (defined(_MSC_VER) && !defined(__cplusplus)) /* Visual Studio */ 55 | # define inline __inline /* Visual C is not C99, but supports some kind of inline */ 56 | #endif 57 | 58 | 59 | /************************************** 60 | Simple Functions 61 | **************************************/ 62 | 63 | __declspec(dllimport) int LZ4_compress(const char* source, char* dest, int inputSize); 64 | __declspec(dllimport) int LZ4_decompress_safe(const char* source, char* dest, int inputSize, int maxOutputSize); 65 | 66 | /* 67 | LZ4_compress() : 68 | Compresses 'inputSize' bytes from 'source' into 'dest'. 69 | Destination buffer must be already allocated, 70 | and must be sized to handle worst cases situations (input data not compressible) 71 | Worst case size evaluation is provided by function LZ4_compressBound() 72 | inputSize : Max supported value is LZ4_MAX_INPUT_VALUE 73 | return : the number of bytes written in buffer dest 74 | or 0 if the compression fails 75 | 76 | LZ4_decompress_safe() : 77 | maxOutputSize : is the size of the destination buffer (which must be already allocated) 78 | return : the number of bytes decoded in the destination buffer (necessarily <= maxOutputSize) 79 | If the source stream is detected malformed, the function will stop decoding and return a negative result. 80 | This function is protected against buffer overflow exploits (never writes outside of output buffer, and never reads outside of input buffer). Therefore, it is protected against malicious data packets 81 | */ 82 | 83 | 84 | /************************************** 85 | Advanced Functions 86 | **************************************/ 87 | #define LZ4_MAX_INPUT_SIZE 0x7E000000 /* 2 113 929 216 bytes */ 88 | #define LZ4_COMPRESSBOUND(isize) ((unsigned int)(isize) > (unsigned int)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16) 89 | 90 | /* 91 | LZ4_compressBound() : 92 | Provides the maximum size that LZ4 may output in a "worst case" scenario (input data not compressible) 93 | primarily useful for memory allocation of output buffer. 94 | inline function is recommended for the general case, 95 | macro is also provided when result needs to be evaluated at compilation (such as stack memory allocation). 96 | 97 | isize : is the input size. Max supported value is LZ4_MAX_INPUT_SIZE 98 | return : maximum output size in a "worst case" scenario 99 | or 0, if input size is too large ( > LZ4_MAX_INPUT_SIZE) 100 | */ 101 | __declspec(dllimport) int LZ4_compressBound(int isize); 102 | 103 | 104 | /* 105 | LZ4_compress_limitedOutput() : 106 | Compress 'inputSize' bytes from 'source' into an output buffer 'dest' of maximum size 'maxOutputSize'. 107 | If it cannot achieve it, compression will stop, and result of the function will be zero. 108 | This function never writes outside of provided output buffer. 109 | 110 | inputSize : Max supported value is LZ4_MAX_INPUT_VALUE 111 | maxOutputSize : is the size of the destination buffer (which must be already allocated) 112 | return : the number of bytes written in buffer 'dest' 113 | or 0 if the compression fails 114 | */ 115 | __declspec(dllimport) int LZ4_compress_limitedOutput(const char* source, char* dest, int inputSize, int maxOutputSize); 116 | 117 | 118 | /* 119 | LZ4_decompress_fast() : 120 | originalSize : is the original and therefore uncompressed size 121 | return : the number of bytes read from the source buffer (in other words, the compressed size) 122 | If the source stream is malformed, the function will stop decoding and return a negative result. 123 | note : This function is a bit faster than LZ4_decompress_safe() 124 | This function never writes outside of output buffers, but may read beyond input buffer in case of malicious data packet. 125 | Use this function preferably into a trusted environment (data to decode comes from a trusted source). 126 | Destination buffer must be already allocated. Its size must be a minimum of 'outputSize' bytes. 127 | */ 128 | __declspec(dllimport) int LZ4_decompress_fast(const char* source, char* dest, int originalSize); 129 | 130 | 131 | /* 132 | LZ4_decompress_safe_partial() : 133 | This function decompress a compressed block of size 'inputSize' at position 'source' 134 | into output buffer 'dest' of size 'maxOutputSize'. 135 | The function tries to stop decompressing operation as soon as 'targetOutputSize' has been reached, 136 | reducing decompression time. 137 | return : the number of bytes decoded in the destination buffer (necessarily <= maxOutputSize) 138 | Note : this number can be < 'targetOutputSize' should the compressed block to decode be smaller. 139 | Always control how many bytes were decoded. 140 | If the source stream is detected malformed, the function will stop decoding and return a negative result. 141 | This function never writes outside of output buffer, and never reads outside of input buffer. It is therefore protected against malicious data packets 142 | */ 143 | __declspec(dllimport) int LZ4_decompress_safe_partial(const char* source, char* dest, int inputSize, int targetOutputSize, int maxOutputSize); 144 | 145 | 146 | /* 147 | These functions are provided should you prefer to allocate memory for compression tables with your own allocation methods. 148 | To know how much memory must be allocated for the compression tables, use : 149 | int LZ4_sizeofState(); 150 | 151 | Note that tables must be aligned on 4-bytes boundaries, otherwise compression will fail (return code 0). 152 | 153 | The allocated memory can be provided to the compressions functions using 'void* state' parameter. 154 | LZ4_compress_withState() and LZ4_compress_limitedOutput_withState() are equivalent to previously described functions. 155 | They just use the externally allocated memory area instead of allocating their own (on stack, or on heap). 156 | */ 157 | __declspec(dllimport) int LZ4_sizeofState(void); 158 | __declspec(dllimport) int LZ4_compress_withState(void* state, const char* source, char* dest, int inputSize); 159 | __declspec(dllimport) int LZ4_compress_limitedOutput_withState(void* state, const char* source, char* dest, int inputSize, int maxOutputSize); 160 | 161 | 162 | /************************************** 163 | Streaming Functions 164 | **************************************/ 165 | __declspec(dllimport) void* LZ4_create(const char* inputBuffer); 166 | __declspec(dllimport) int LZ4_compress_continue(void* LZ4_Data, const char* source, char* dest, int inputSize); 167 | __declspec(dllimport) int LZ4_compress_limitedOutput_continue(void* LZ4_Data, const char* source, char* dest, int inputSize, int maxOutputSize); 168 | __declspec(dllimport) char* LZ4_slideInputBuffer(void* LZ4_Data); 169 | __declspec(dllimport) int LZ4_free(void* LZ4_Data); 170 | 171 | /* 172 | These functions allow the compression of dependent blocks, where each block benefits from prior 64 KB within preceding blocks. 173 | In order to achieve this, it is necessary to start creating the LZ4 Data Structure, thanks to the function : 174 | 175 | void* LZ4_create (const char* inputBuffer); 176 | The result of the function is the (void*) pointer on the LZ4 Data Structure. 177 | This pointer will be needed in all other functions. 178 | If the pointer returned is NULL, then the allocation has failed, and compression must be aborted. 179 | The only parameter 'const char* inputBuffer' must, obviously, point at the beginning of input buffer. 180 | The input buffer must be already allocated, and size at least 192KB. 181 | 'inputBuffer' will also be the 'const char* source' of the first block. 182 | 183 | All blocks are expected to lay next to each other within the input buffer, starting from 'inputBuffer'. 184 | To compress each block, use either LZ4_compress_continue() or LZ4_compress_limitedOutput_continue(). 185 | Their behavior are identical to LZ4_compress() or LZ4_compress_limitedOutput(), 186 | but require the LZ4 Data Structure as their first argument, and check that each block starts right after the previous one. 187 | If next block does not begin immediately after the previous one, the compression will fail (return 0). 188 | 189 | When it's no longer possible to lay the next block after the previous one (not enough space left into input buffer), a call to : 190 | char* LZ4_slideInputBuffer(void* LZ4_Data); 191 | must be performed. It will typically copy the latest 64KB of input at the beginning of input buffer. 192 | Note that, for this function to work properly, minimum size of an input buffer must be 192KB. 193 | ==> The memory position where the next input data block must start is provided as the result of the function. 194 | 195 | Compression can then resume, using LZ4_compress_continue() or LZ4_compress_limitedOutput_continue(), as usual. 196 | 197 | When compression is completed, a call to LZ4_free() will release the memory used by the LZ4 Data Structure. 198 | */ 199 | 200 | 201 | __declspec(dllimport) int LZ4_sizeofStreamState(void); 202 | __declspec(dllimport) int LZ4_resetStreamState(void* state, const char* inputBuffer); 203 | 204 | /* 205 | These functions achieve the same result as : 206 | void* LZ4_create (const char* inputBuffer); 207 | 208 | They are provided here to allow the user program to allocate memory using its own routines. 209 | 210 | To know how much space must be allocated, use LZ4_sizeofStreamState(); 211 | Note also that space must be 4-bytes aligned. 212 | 213 | Once space is allocated, you must initialize it using : LZ4_resetStreamState(void* state, const char* inputBuffer); 214 | void* state is a pointer to the space allocated. 215 | It must be aligned on 4-bytes boundaries, and be large enough. 216 | The parameter 'const char* inputBuffer' must, obviously, point at the beginning of input buffer. 217 | The input buffer must be already allocated, and size at least 192KB. 218 | 'inputBuffer' will also be the 'const char* source' of the first block. 219 | 220 | The same space can be re-used multiple times, just by initializing it each time with LZ4_resetStreamState(). 221 | return value of LZ4_resetStreamState() must be 0 is OK. 222 | Any other value means there was an error (typically, pointer is not aligned on 4-bytes boundaries). 223 | */ 224 | 225 | 226 | __declspec(dllimport) int LZ4_decompress_safe_withPrefix64k(const char* source, char* dest, int inputSize, int maxOutputSize); 227 | __declspec(dllimport) int LZ4_decompress_fast_withPrefix64k(const char* source, char* dest, int outputSize); 228 | 229 | /* 230 | *_withPrefix64k() : 231 | These decoding functions work the same as their "normal name" versions, 232 | but can use up to 64KB of data in front of 'char* dest'. 233 | These functions are necessary to decode inter-dependant blocks. 234 | */ 235 | 236 | 237 | /************************************** 238 | Obsolete Functions 239 | **************************************/ 240 | /* 241 | These functions are deprecated and should no longer be used. 242 | They are provided here for compatibility with existing user programs. 243 | */ 244 | __declspec(dllimport) int LZ4_uncompress(const char* source, char* dest, int outputSize); 245 | __declspec(dllimport) int LZ4_uncompress_unknownOutputSize(const char* source, char* dest, int isize, int maxOutputSize); 246 | 247 | 248 | #if defined (__cplusplus) 249 | } 250 | #endif 251 | 252 | #endif //_LZ4_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/lz4/lz4_x64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/lz4/lz4_x64.a -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/lz4/lz4_x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/lz4/lz4_x64.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/lz4/lz4_x86.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/lz4/lz4_x86.a -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/lz4/lz4_x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/lz4/lz4_x86.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/lz4/lz4file.h: -------------------------------------------------------------------------------- 1 | #ifndef _LZ4FILE_H 2 | #define _LZ4FILE_H 3 | 4 | typedef enum _LZ4_STATUS 5 | { 6 | LZ4_SUCCESS, 7 | LZ4_FAILED_OPEN_INPUT, 8 | LZ4_FAILED_OPEN_OUTPUT, 9 | LZ4_NOT_ENOUGH_MEMORY, 10 | LZ4_INVALID_ARCHIVE, 11 | LZ4_CORRUPTED_ARCHIVE 12 | } LZ4_STATUS; 13 | 14 | #if defined (__cplusplus) 15 | extern "C" 16 | { 17 | #endif 18 | 19 | __declspec(dllimport) LZ4_STATUS LZ4_compress_file(const char* input_filename, const char* output_filename); 20 | __declspec(dllimport) LZ4_STATUS LZ4_compress_fileW(const wchar_t* input_filename, const wchar_t* output_filename); 21 | __declspec(dllimport) LZ4_STATUS LZ4_decompress_file(const char* input_filename, const char* output_filename); 22 | __declspec(dllimport) LZ4_STATUS LZ4_decompress_fileW(const wchar_t* input_filename, const wchar_t* output_filename); 23 | 24 | #if defined (__cplusplus) 25 | } 26 | #endif 27 | 28 | #endif //_LZ4FILE_H -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/lz4/lz4hc.h: -------------------------------------------------------------------------------- 1 | /* 2 | LZ4 HC - High Compression Mode of LZ4 3 | Header File 4 | Copyright (C) 2011-2014, Yann Collet. 5 | BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are 9 | met: 10 | 11 | * Redistributions of source code must retain the above copyright 12 | notice, this list of conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following disclaimer 15 | in the documentation and/or other materials provided with the 16 | distribution. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | You can contact the author at : 31 | - LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html 32 | - LZ4 source repository : http://code.google.com/p/lz4/ 33 | */ 34 | #ifndef _LZ4HC_H 35 | #define _LZ4HC_H 36 | 37 | #if defined (__cplusplus) 38 | extern "C" 39 | { 40 | #endif 41 | 42 | 43 | __declspec(dllimport) int LZ4_compressHC(const char* source, char* dest, int inputSize); 44 | /* 45 | LZ4_compressHC : 46 | return : the number of bytes in compressed buffer dest 47 | or 0 if compression fails. 48 | note : destination buffer must be already allocated. 49 | To avoid any problem, size it to handle worst cases situations (input data not compressible) 50 | Worst case size evaluation is provided by function LZ4_compressBound() (see "lz4.h") 51 | */ 52 | 53 | __declspec(dllimport) int LZ4_compressHC_limitedOutput(const char* source, char* dest, int inputSize, int maxOutputSize); 54 | /* 55 | LZ4_compress_limitedOutput() : 56 | Compress 'inputSize' bytes from 'source' into an output buffer 'dest' of maximum size 'maxOutputSize'. 57 | If it cannot achieve it, compression will stop, and result of the function will be zero. 58 | This function never writes outside of provided output buffer. 59 | 60 | inputSize : Max supported value is 1 GB 61 | maxOutputSize : is maximum allowed size into the destination buffer (which must be already allocated) 62 | return : the number of output bytes written in buffer 'dest' 63 | or 0 if compression fails. 64 | */ 65 | 66 | 67 | __declspec(dllimport) int LZ4_compressHC2(const char* source, char* dest, int inputSize, int compressionLevel); 68 | __declspec(dllimport) int LZ4_compressHC2_limitedOutput(const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel); 69 | /* 70 | Same functions as above, but with programmable 'compressionLevel'. 71 | Recommended values are between 4 and 9, although any value between 0 and 16 will work. 72 | 'compressionLevel'==0 means use default 'compressionLevel' value. 73 | Values above 16 behave the same as 16. 74 | Equivalent variants exist for all other compression functions below. 75 | */ 76 | 77 | /* Note : 78 | Decompression functions are provided within LZ4 source code (see "lz4.h") (BSD license) 79 | */ 80 | 81 | 82 | /************************************** 83 | Using an external allocation 84 | **************************************/ 85 | __declspec(dllimport) int LZ4_sizeofStateHC(void); 86 | __declspec(dllimport) int LZ4_compressHC_withStateHC(void* state, const char* source, char* dest, int inputSize); 87 | __declspec(dllimport) int LZ4_compressHC_limitedOutput_withStateHC(void* state, const char* source, char* dest, int inputSize, int maxOutputSize); 88 | 89 | __declspec(dllimport) int LZ4_compressHC2_withStateHC(void* state, const char* source, char* dest, int inputSize, int compressionLevel); 90 | __declspec(dllimport) int LZ4_compressHC2_limitedOutput_withStateHC(void* state, const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel); 91 | 92 | /* 93 | These functions are provided should you prefer to allocate memory for compression tables with your own allocation methods. 94 | To know how much memory must be allocated for the compression tables, use : 95 | int LZ4_sizeofStateHC(); 96 | 97 | Note that tables must be aligned for pointer (32 or 64 bits), otherwise compression will fail (return code 0). 98 | 99 | The allocated memory can be provided to the compressions functions using 'void* state' parameter. 100 | LZ4_compress_withStateHC() and LZ4_compress_limitedOutput_withStateHC() are equivalent to previously described functions. 101 | They just use the externally allocated memory area instead of allocating their own (on stack, or on heap). 102 | */ 103 | 104 | 105 | /************************************** 106 | Streaming Functions 107 | **************************************/ 108 | __declspec(dllimport) void* LZ4_createHC(const char* inputBuffer); 109 | __declspec(dllimport) int LZ4_compressHC_continue(void* LZ4HC_Data, const char* source, char* dest, int inputSize); 110 | __declspec(dllimport) int LZ4_compressHC_limitedOutput_continue(void* LZ4HC_Data, const char* source, char* dest, int inputSize, int maxOutputSize); 111 | __declspec(dllimport) char* LZ4_slideInputBufferHC(void* LZ4HC_Data); 112 | __declspec(dllimport) int LZ4_freeHC(void* LZ4HC_Data); 113 | 114 | __declspec(dllimport) int LZ4_compressHC2_continue(void* LZ4HC_Data, const char* source, char* dest, int inputSize, int compressionLevel); 115 | __declspec(dllimport) int LZ4_compressHC2_limitedOutput_continue(void* LZ4HC_Data, const char* source, char* dest, int inputSize, int maxOutputSize, int compressionLevel); 116 | 117 | /* 118 | These functions allow the compression of dependent blocks, where each block benefits from prior 64 KB within preceding blocks. 119 | In order to achieve this, it is necessary to start creating the LZ4HC Data Structure, thanks to the function : 120 | 121 | void* LZ4_createHC (const char* inputBuffer); 122 | The result of the function is the (void*) pointer on the LZ4HC Data Structure. 123 | This pointer will be needed in all other functions. 124 | If the pointer returned is NULL, then the allocation has failed, and compression must be aborted. 125 | The only parameter 'const char* inputBuffer' must, obviously, point at the beginning of input buffer. 126 | The input buffer must be already allocated, and size at least 192KB. 127 | 'inputBuffer' will also be the 'const char* source' of the first block. 128 | 129 | All blocks are expected to lay next to each other within the input buffer, starting from 'inputBuffer'. 130 | To compress each block, use either LZ4_compressHC_continue() or LZ4_compressHC_limitedOutput_continue(). 131 | Their behavior are identical to LZ4_compressHC() or LZ4_compressHC_limitedOutput(), 132 | but require the LZ4HC Data Structure as their first argument, and check that each block starts right after the previous one. 133 | If next block does not begin immediately after the previous one, the compression will fail (return 0). 134 | 135 | When it's no longer possible to lay the next block after the previous one (not enough space left into input buffer), a call to : 136 | char* LZ4_slideInputBufferHC(void* LZ4HC_Data); 137 | must be performed. It will typically copy the latest 64KB of input at the beginning of input buffer. 138 | Note that, for this function to work properly, minimum size of an input buffer must be 192KB. 139 | ==> The memory position where the next input data block must start is provided as the result of the function. 140 | 141 | Compression can then resume, using LZ4_compressHC_continue() or LZ4_compressHC_limitedOutput_continue(), as usual. 142 | 143 | When compression is completed, a call to LZ4_freeHC() will release the memory used by the LZ4HC Data Structure. 144 | */ 145 | 146 | __declspec(dllimport) int LZ4_sizeofStreamStateHC(void); 147 | __declspec(dllimport) int LZ4_resetStreamStateHC(void* state, const char* inputBuffer); 148 | 149 | /* 150 | These functions achieve the same result as : 151 | void* LZ4_createHC (const char* inputBuffer); 152 | 153 | They are provided here to allow the user program to allocate memory using its own routines. 154 | 155 | To know how much space must be allocated, use LZ4_sizeofStreamStateHC(); 156 | Note also that space must be aligned for pointers (32 or 64 bits). 157 | 158 | Once space is allocated, you must initialize it using : LZ4_resetStreamStateHC(void* state, const char* inputBuffer); 159 | void* state is a pointer to the space allocated. 160 | It must be aligned for pointers (32 or 64 bits), and be large enough. 161 | The parameter 'const char* inputBuffer' must, obviously, point at the beginning of input buffer. 162 | The input buffer must be already allocated, and size at least 192KB. 163 | 'inputBuffer' will also be the 'const char* source' of the first block. 164 | 165 | The same space can be re-used multiple times, just by initializing it each time with LZ4_resetStreamState(). 166 | return value of LZ4_resetStreamStateHC() must be 0 is OK. 167 | Any other value means there was an error (typically, state is not aligned for pointers (32 or 64 bits)). 168 | */ 169 | 170 | 171 | #if defined (__cplusplus) 172 | } 173 | #endif 174 | 175 | #endif //_LZ4HC_H 176 | -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/x32bridge.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/x32bridge.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/x32dbg.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/x32dbg.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/x64bridge.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/x64bridge.lib -------------------------------------------------------------------------------- /x64dbg_headless/pluginsdk/x64dbg.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/x64dbg/x64dbg_headless/60e9ca00e84e83bd6c9c24b25bd3d6bc63bf4ba0/x64dbg_headless/pluginsdk/x64dbg.lib -------------------------------------------------------------------------------- /x64dbg_headless/stringutils.cpp: -------------------------------------------------------------------------------- 1 | #include "stringutils.h" 2 | #include 3 | #include 4 | #include 5 | 6 | // Functions from x64dbg project: https://github.com/x64dbg/x64dbg 7 | //Conversion functions taken from: http://www.nubaria.com/en/blog/?p=289 8 | String Utf16ToUtf8(const WString & wstr) 9 | { 10 | String convertedString; 11 | int requiredSize = WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), -1, 0, 0, 0, 0); 12 | if(requiredSize > 0) 13 | { 14 | std::vector buffer(requiredSize); 15 | WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), -1, &buffer[0], requiredSize, 0, 0); 16 | convertedString.assign(buffer.begin(), buffer.end() - 1); 17 | } 18 | return convertedString; 19 | } 20 | 21 | String Utf16ToUtf8(const wchar_t* wstr) 22 | { 23 | return Utf16ToUtf8(wstr ? WString(wstr) : WString()); 24 | } 25 | 26 | WString Utf8ToUtf16(const String & str) 27 | { 28 | WString convertedString; 29 | int requiredSize = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, 0, 0); 30 | if(requiredSize > 0) 31 | { 32 | std::vector buffer(requiredSize); 33 | MultiByteToWideChar(CP_UTF8, 0, str.c_str(), -1, &buffer[0], requiredSize); 34 | convertedString.assign(buffer.begin(), buffer.end() - 1); 35 | } 36 | return convertedString; 37 | } 38 | 39 | WString Utf8ToUtf16(const char* str) 40 | { 41 | return Utf8ToUtf16(str ? String(str) : String()); 42 | } -------------------------------------------------------------------------------- /x64dbg_headless/stringutils.h: -------------------------------------------------------------------------------- 1 | #ifndef _STRINGUTILS_H 2 | #define _STRINGUTILS_H 3 | 4 | #include 5 | #include 6 | 7 | typedef std::string String; 8 | typedef std::wstring WString; 9 | 10 | 11 | String Utf16ToUtf8(const WString & wstr); 12 | String Utf16ToUtf8(const wchar_t* wstr); 13 | WString Utf8ToUtf16(const String & str); 14 | WString Utf8ToUtf16(const char* str); 15 | 16 | #endif //_STRINGUTILS_H -------------------------------------------------------------------------------- /x64dbg_headless/tostring.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | static const char* guimsg2str(GUIMSG msg) 4 | { 5 | switch(msg) 6 | { 7 | case GUI_DISASSEMBLE_AT: return "GUI_DISASSEMBLE_AT"; 8 | case GUI_SET_DEBUG_STATE: return "GUI_SET_DEBUG_STATE"; 9 | case GUI_ADD_MSG_TO_LOG: return "GUI_ADD_MSG_TO_LOG"; 10 | case GUI_CLEAR_LOG: return "GUI_CLEAR_LOG"; 11 | case GUI_UPDATE_REGISTER_VIEW: return "GUI_UPDATE_REGISTER_VIEW"; 12 | case GUI_UPDATE_DISASSEMBLY_VIEW: return "GUI_UPDATE_DISASSEMBLY_VIEW"; 13 | case GUI_UPDATE_BREAKPOINTS_VIEW: return "GUI_UPDATE_BREAKPOINTS_VIEW"; 14 | case GUI_UPDATE_WINDOW_TITLE: return "GUI_UPDATE_WINDOW_TITLE"; 15 | case GUI_GET_WINDOW_HANDLE: return "GUI_GET_WINDOW_HANDLE"; 16 | case GUI_DUMP_AT: return "GUI_DUMP_AT"; 17 | case GUI_SCRIPT_ADD: return "GUI_SCRIPT_ADD"; 18 | case GUI_SCRIPT_CLEAR: return "GUI_SCRIPT_CLEAR"; 19 | case GUI_SCRIPT_SETIP: return "GUI_SCRIPT_SETIP"; 20 | case GUI_SCRIPT_ERROR: return "GUI_SCRIPT_ERROR"; 21 | case GUI_SCRIPT_SETTITLE: return "GUI_SCRIPT_SETTITLE"; 22 | case GUI_SCRIPT_SETINFOLINE: return "GUI_SCRIPT_SETINFOLINE"; 23 | case GUI_SCRIPT_MESSAGE: return "GUI_SCRIPT_MESSAGE"; 24 | case GUI_SCRIPT_MSGYN: return "GUI_SCRIPT_MSGYN"; 25 | case GUI_SYMBOL_LOG_ADD: return "GUI_SYMBOL_LOG_ADD"; 26 | case GUI_SYMBOL_LOG_CLEAR: return "GUI_SYMBOL_LOG_CLEAR"; 27 | case GUI_SYMBOL_SET_PROGRESS: return "GUI_SYMBOL_SET_PROGRESS"; 28 | case GUI_SYMBOL_UPDATE_MODULE_LIST: return "GUI_SYMBOL_UPDATE_MODULE_LIST"; 29 | case GUI_REF_ADDCOLUMN: return "GUI_REF_ADDCOLUMN"; 30 | case GUI_REF_SETROWCOUNT: return "GUI_REF_SETROWCOUNT"; 31 | case GUI_REF_GETROWCOUNT: return "GUI_REF_GETROWCOUNT"; 32 | case GUI_REF_DELETEALLCOLUMNS: return "GUI_REF_DELETEALLCOLUMNS"; 33 | case GUI_REF_SETCELLCONTENT: return "GUI_REF_SETCELLCONTENT"; 34 | case GUI_REF_GETCELLCONTENT: return "GUI_REF_GETCELLCONTENT"; 35 | case GUI_REF_RELOADDATA: return "GUI_REF_RELOADDATA"; 36 | case GUI_REF_SETSINGLESELECTION: return "GUI_REF_SETSINGLESELECTION"; 37 | case GUI_REF_SETPROGRESS: return "GUI_REF_SETPROGRESS"; 38 | case GUI_REF_SETCURRENTTASKPROGRESS: return "GUI_REF_SETCURRENTTASKPROGRESS"; 39 | case GUI_REF_SETSEARCHSTARTCOL: return "GUI_REF_SETSEARCHSTARTCOL"; 40 | case GUI_STACK_DUMP_AT: return "GUI_STACK_DUMP_AT"; 41 | case GUI_UPDATE_DUMP_VIEW: return "GUI_UPDATE_DUMP_VIEW"; 42 | case GUI_UPDATE_THREAD_VIEW: return "GUI_UPDATE_THREAD_VIEW"; 43 | case GUI_ADD_RECENT_FILE: return "GUI_ADD_RECENT_FILE"; 44 | case GUI_SET_LAST_EXCEPTION: return "GUI_SET_LAST_EXCEPTION"; 45 | case GUI_GET_DISASSEMBLY: return "GUI_GET_DISASSEMBLY"; 46 | case GUI_MENU_ADD: return "GUI_MENU_ADD"; 47 | case GUI_MENU_ADD_ENTRY: return "GUI_MENU_ADD_ENTRY"; 48 | case GUI_MENU_ADD_SEPARATOR: return "GUI_MENU_ADD_SEPARATOR"; 49 | case GUI_MENU_CLEAR: return "GUI_MENU_CLEAR"; 50 | case GUI_SELECTION_GET: return "GUI_SELECTION_GET"; 51 | case GUI_SELECTION_SET: return "GUI_SELECTION_SET"; 52 | case GUI_GETLINE_WINDOW: return "GUI_GETLINE_WINDOW"; 53 | case GUI_AUTOCOMPLETE_ADDCMD: return "GUI_AUTOCOMPLETE_ADDCMD"; 54 | case GUI_AUTOCOMPLETE_DELCMD: return "GUI_AUTOCOMPLETE_DELCMD"; 55 | case GUI_AUTOCOMPLETE_CLEARALL: return "GUI_AUTOCOMPLETE_CLEARALL"; 56 | case GUI_SCRIPT_ENABLEHIGHLIGHTING: return "GUI_SCRIPT_ENABLEHIGHLIGHTING"; 57 | case GUI_ADD_MSG_TO_STATUSBAR: return "GUI_ADD_MSG_TO_STATUSBAR"; 58 | case GUI_UPDATE_SIDEBAR: return "GUI_UPDATE_SIDEBAR"; 59 | case GUI_REPAINT_TABLE_VIEW: return "GUI_REPAINT_TABLE_VIEW"; 60 | case GUI_UPDATE_PATCHES: return "GUI_UPDATE_PATCHES"; 61 | case GUI_UPDATE_CALLSTACK: return "GUI_UPDATE_CALLSTACK"; 62 | case GUI_UPDATE_SEHCHAIN: return "GUI_UPDATE_SEHCHAIN"; 63 | case GUI_SYMBOL_REFRESH_CURRENT: return "GUI_SYMBOL_REFRESH_CURRENT"; 64 | case GUI_UPDATE_MEMORY_VIEW: return "GUI_UPDATE_MEMORY_VIEW"; 65 | case GUI_REF_INITIALIZE: return "GUI_REF_INITIALIZE"; 66 | case GUI_LOAD_SOURCE_FILE: return "GUI_LOAD_SOURCE_FILE"; 67 | case GUI_MENU_SET_ICON: return "GUI_MENU_SET_ICON"; 68 | case GUI_MENU_SET_ENTRY_ICON: return "GUI_MENU_SET_ENTRY_ICON"; 69 | case GUI_SHOW_CPU: return "GUI_SHOW_CPU"; 70 | case GUI_ADD_QWIDGET_TAB: return "GUI_ADD_QWIDGET_TAB"; 71 | case GUI_SHOW_QWIDGET_TAB: return "GUI_SHOW_QWIDGET_TAB"; 72 | case GUI_CLOSE_QWIDGET_TAB: return "GUI_CLOSE_QWIDGET_TAB"; 73 | case GUI_EXECUTE_ON_GUI_THREAD: return "GUI_EXECUTE_ON_GUI_THREAD"; 74 | case GUI_UPDATE_TIME_WASTED_COUNTER: return "GUI_UPDATE_TIME_WASTED_COUNTER"; 75 | case GUI_SET_GLOBAL_NOTES: return "GUI_SET_GLOBAL_NOTES"; 76 | case GUI_GET_GLOBAL_NOTES: return "GUI_GET_GLOBAL_NOTES"; 77 | case GUI_SET_DEBUGGEE_NOTES: return "GUI_SET_DEBUGGEE_NOTES"; 78 | case GUI_GET_DEBUGGEE_NOTES: return "GUI_GET_DEBUGGEE_NOTES"; 79 | case GUI_DUMP_AT_N: return "GUI_DUMP_AT_N"; 80 | case GUI_DISPLAY_WARNING: return "GUI_DISPLAY_WARNING"; 81 | case GUI_REGISTER_SCRIPT_LANG: return "GUI_REGISTER_SCRIPT_LANG"; 82 | case GUI_UNREGISTER_SCRIPT_LANG: return "GUI_UNREGISTER_SCRIPT_LANG"; 83 | case GUI_UPDATE_ARGUMENT_VIEW: return "GUI_UPDATE_ARGUMENT_VIEW"; 84 | case GUI_FOCUS_VIEW: return "GUI_FOCUS_VIEW"; 85 | case GUI_UPDATE_WATCH_VIEW: return "GUI_UPDATE_WATCH_VIEW"; 86 | case GUI_LOAD_GRAPH: return "GUI_LOAD_GRAPH"; 87 | case GUI_GRAPH_AT: return "GUI_GRAPH_AT"; 88 | case GUI_UPDATE_GRAPH_VIEW: return "GUI_UPDATE_GRAPH_VIEW"; 89 | case GUI_SET_LOG_ENABLED: return "GUI_SET_LOG_ENABLED"; 90 | case GUI_ADD_FAVOURITE_TOOL: return "GUI_ADD_FAVOURITE_TOOL"; 91 | case GUI_ADD_FAVOURITE_COMMAND: return "GUI_ADD_FAVOURITE_COMMAND"; 92 | case GUI_SET_FAVOURITE_TOOL_SHORTCUT: return "GUI_SET_FAVOURITE_TOOL_SHORTCUT"; 93 | case GUI_FOLD_DISASSEMBLY: return "GUI_FOLD_DISASSEMBLY"; 94 | case GUI_SELECT_IN_MEMORY_MAP: return "GUI_SELECT_IN_MEMORY_MAP"; 95 | case GUI_GET_ACTIVE_VIEW: return "GUI_GET_ACTIVE_VIEW"; 96 | case GUI_MENU_SET_ENTRY_CHECKED: return "GUI_MENU_SET_ENTRY_CHECKED"; 97 | case GUI_ADD_INFO_LINE: return "GUI_ADD_INFO_LINE"; 98 | case GUI_PROCESS_EVENTS: return "GUI_PROCESS_EVENTS"; 99 | case GUI_TYPE_ADDNODE: return "GUI_TYPE_ADDNODE"; 100 | case GUI_TYPE_CLEAR: return "GUI_TYPE_CLEAR"; 101 | case GUI_UPDATE_TYPE_WIDGET: return "GUI_UPDATE_TYPE_WIDGET"; 102 | case GUI_CLOSE_APPLICATION: return "GUI_CLOSE_APPLICATION"; 103 | case GUI_MENU_SET_VISIBLE: return "GUI_MENU_SET_VISIBLE"; 104 | case GUI_MENU_SET_ENTRY_VISIBLE: return "GUI_MENU_SET_ENTRY_VISIBLE"; 105 | case GUI_MENU_SET_NAME: return "GUI_MENU_SET_NAME"; 106 | case GUI_MENU_SET_ENTRY_NAME: return "GUI_MENU_SET_ENTRY_NAME"; 107 | case GUI_FLUSH_LOG: return "GUI_FLUSH_LOG"; 108 | case GUI_MENU_SET_ENTRY_HOTKEY: return "GUI_MENU_SET_ENTRY_HOTKEY"; 109 | case GUI_REF_SEARCH_GETROWCOUNT: return "GUI_REF_SEARCH_GETROWCOUNT"; 110 | case GUI_REF_SEARCH_GETCELLCONTENT: return "GUI_REF_SEARCH_GETCELLCONTENT"; 111 | case GUI_MENU_REMOVE: return "GUI_MENU_REMOVE"; 112 | case GUI_REF_ADDCOMMAND: return "GUI_REF_ADDCOMMAND"; 113 | case GUI_OPEN_TRACE_FILE: return "GUI_OPEN_TRACE_FILE"; 114 | case GUI_UPDATE_TRACE_BROWSER: return "GUI_UPDATE_TRACE_BROWSER"; 115 | case GUI_INVALIDATE_SYMBOL_SOURCE: return "GUI_INVALIDATE_SYMBOL_SOURCE"; 116 | } 117 | return ""; 118 | } 119 | 120 | static const char* dbgstate2str(DBGSTATE s) 121 | { 122 | switch(s) 123 | { 124 | case initialized: return "initialized"; 125 | case paused: return "paused"; 126 | case running: return "running"; 127 | case stopped: return "stopped"; 128 | } 129 | return ""; 130 | } -------------------------------------------------------------------------------- /x64dbg_headless/x64dbg_gui.cpp: -------------------------------------------------------------------------------- 1 | #include "pluginsdk/bridgemain.h" 2 | #include "pluginsdk/_plugins.h" 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "stringutils.h" 9 | 10 | #ifdef _WIN64 11 | #pragma comment(lib, "pluginsdk/x64dbg.lib") 12 | #pragma comment(lib, "pluginsdk/x64bridge.lib") 13 | #pragma comment(lib, "pluginsdk/DeviceNameResolver/DeviceNameResolver_x64.lib") 14 | #pragma comment(lib, "pluginsdk/jansson/jansson_x64.lib") 15 | #pragma comment(lib, "pluginsdk/lz4/lz4_x64.lib") 16 | #pragma comment(lib, "pluginsdk/TitanEngine/TitanEngine_x64.lib") 17 | #pragma comment(lib, "pluginsdk/XEDParse/XEDParse_x64.lib") 18 | #else 19 | #pragma comment(lib, "pluginsdk/x32dbg.lib") 20 | #pragma comment(lib, "pluginsdk/x32bridge.lib") 21 | #pragma comment(lib, "pluginsdk/DeviceNameResolver/DeviceNameResolver_x86.lib") 22 | #pragma comment(lib, "pluginsdk/jansson/jansson_x86.lib") 23 | #pragma comment(lib, "pluginsdk/lz4/lz4_x86.lib") 24 | #pragma comment(lib, "pluginsdk/TitanEngine/TitanEngine_x86.lib") 25 | #pragma comment(lib, "pluginsdk/XEDParse/XEDParse_x86.lib") 26 | #endif //_WIN64 27 | 28 | #define Cmd(x) DbgCmdExecDirect(x) 29 | #define Eval(x) DbgValFromString(x) 30 | #define dprintf(x, ...) _plugin_logprintf("[" PLUGIN_NAME "] " x, __VA_ARGS__) 31 | #define dputs(x) _plugin_logprintf("[" PLUGIN_NAME "] %s\n", x) 32 | #define PLUG_EXPORT extern "C" __declspec(dllexport) 33 | 34 | BOOL WINAPI DllMain( 35 | _In_ HINSTANCE hinstDLL, 36 | _In_ DWORD fdwReason, 37 | _In_ LPVOID lpvReserved 38 | ) 39 | { 40 | if (fdwReason == DLL_PROCESS_ATTACH) 41 | { 42 | 43 | } 44 | return TRUE; 45 | } 46 | 47 | static std::vector scriptInfo; 48 | static int curScriptId = 0; 49 | static bool dbgStopped = false; 50 | 51 | struct GuiState 52 | { 53 | duint disasm = 0; 54 | duint cip = 0; 55 | duint dump = 0; 56 | duint stack = 0; 57 | duint csp = 0; 58 | std::string globalNotes; 59 | std::string debuggeeNotes; 60 | } guistate; 61 | 62 | extern "C" __declspec(dllexport) int _gui_guiinit(int argc, char* argv[]) 63 | { 64 | // Allocate console 65 | if (AllocConsole()) 66 | { 67 | FILE* ptrNewStdIn = nullptr; 68 | FILE* ptrNewStdOut = nullptr; 69 | FILE* ptrNewStdErr = nullptr; 70 | 71 | freopen_s(&ptrNewStdIn, "CONIN$", "r", stdin); 72 | freopen_s(&ptrNewStdOut, "CONOUT$", "w", stdout); 73 | freopen_s(&ptrNewStdErr, "CONOUT$", "w", stderr); 74 | } 75 | 76 | // Init debugger 77 | const char* errormsg = DbgInit(); 78 | if(errormsg) 79 | { 80 | MessageBoxA(0, errormsg, "DbgInit Error!", MB_SYSTEMMODAL | MB_ICONERROR); 81 | return 1; 82 | } 83 | while(true) 84 | { 85 | std::string command; 86 | std::getline(std::cin, command); 87 | if(command == "exit") 88 | { 89 | DbgExit(); 90 | dbgStopped = true; 91 | break; 92 | } 93 | else if(command == "langs") 94 | { 95 | for(auto& info : scriptInfo) 96 | printf("%d:%s\n", info.id, info.name); 97 | } 98 | else if(command == "state") 99 | { 100 | printf("disasm: 0x%p\n", guistate.disasm); 101 | printf(" cip: 0x%p\n", guistate.cip); 102 | printf(" dump: 0x%p\n", guistate.dump); 103 | printf(" stack: 0x%p\n", guistate.stack); 104 | printf(" csp: 0x%p\n", guistate.csp); 105 | } 106 | else 107 | { 108 | int scriptId = 0; 109 | if(command.size() > 2 && isdigit(command[0]) && command[1] == '>') 110 | { 111 | scriptId = command[0] - '0'; 112 | command = command.substr(2); 113 | } 114 | if(scriptId >= scriptInfo.size()) 115 | { 116 | printf("[FAIL] no script id registered %d\n", scriptId); 117 | continue; 118 | } 119 | if(!scriptInfo[scriptId].execute(command.c_str())) 120 | { 121 | puts("[FAIL] command failed"); 122 | } 123 | } 124 | } 125 | return 0; 126 | } 127 | 128 | #include "tostring.h" 129 | 130 | extern "C" __declspec(dllexport) void* _gui_sendmessage(GUIMSG type, void* param1, void* param2) 131 | { 132 | if(dbgStopped) //there can be no more messages if the debugger stopped = IGNORE 133 | { 134 | printf("[WARN] Ignored %s (%d)\n", guimsg2str(type), type); 135 | return nullptr; 136 | } 137 | 138 | switch(type) 139 | { 140 | case GUI_AUTOCOMPLETE_ADDCMD: 141 | case GUI_UPDATE_TIME_WASTED_COUNTER: 142 | case GUI_FLUSH_LOG: 143 | case GUI_INVALIDATE_SYMBOL_SOURCE: 144 | case GUI_UPDATE_ARGUMENT_VIEW: 145 | case GUI_UPDATE_BREAKPOINTS_VIEW: 146 | case GUI_UPDATE_CALLSTACK: 147 | case GUI_UPDATE_DISASSEMBLY_VIEW: 148 | case GUI_UPDATE_DUMP_VIEW: 149 | case GUI_UPDATE_GRAPH_VIEW: 150 | case GUI_UPDATE_MEMORY_VIEW: 151 | case GUI_UPDATE_PATCHES: 152 | case GUI_UPDATE_REGISTER_VIEW: 153 | case GUI_UPDATE_SEHCHAIN: 154 | case GUI_UPDATE_SIDEBAR: 155 | case GUI_UPDATE_THREAD_VIEW: 156 | case GUI_UPDATE_TRACE_BROWSER: 157 | case GUI_UPDATE_TYPE_WIDGET: 158 | case GUI_UPDATE_WATCH_VIEW: 159 | case GUI_SYMBOL_UPDATE_MODULE_LIST: 160 | case GUI_FOCUS_VIEW: 161 | case GUI_REPAINT_TABLE_VIEW: 162 | case GUI_ADD_RECENT_FILE: 163 | case GUI_SCRIPT_SETIP: 164 | case GUI_SHOW_CPU: 165 | break; 166 | 167 | case GUI_UPDATE_WINDOW_TITLE: 168 | SetConsoleTitleW(Utf8ToUtf16((const char*)param1).c_str()); 169 | break; 170 | 171 | case GUI_GET_WINDOW_HANDLE: 172 | return GetConsoleWindow(); 173 | 174 | case GUI_SYMBOL_LOG_ADD: 175 | printf("[SYMBOL] %s", param1); 176 | break; 177 | 178 | case GUI_ADD_MSG_TO_LOG: 179 | printf("%s", param1); 180 | break; 181 | 182 | case GUI_SET_DEBUG_STATE: 183 | { 184 | auto s = DBGSTATE(duint(param1)); 185 | printf("[STATE] %s\n", dbgstate2str(s)); 186 | } 187 | break; 188 | 189 | case GUI_REGISTER_SCRIPT_LANG: 190 | { 191 | SCRIPTTYPEINFO* info = (SCRIPTTYPEINFO*)param1; 192 | info->id = (int)scriptInfo.size(); 193 | scriptInfo.push_back(*info); 194 | } 195 | break; 196 | 197 | case GUI_UNREGISTER_SCRIPT_LANG: 198 | { 199 | int id = (int)param1; 200 | if(id != 0) 201 | { 202 | puts("[TODO] Not implemented GUI_UNREGISTER_SCRIPT_LANG"); 203 | } 204 | } 205 | break; 206 | 207 | case GUI_DUMP_AT: 208 | guistate.dump = (duint)param1; 209 | break; 210 | 211 | case GUI_DISASSEMBLE_AT: 212 | guistate.disasm = (duint)param1; 213 | guistate.cip = (duint)param2; 214 | break; 215 | 216 | case GUI_STACK_DUMP_AT: 217 | guistate.stack = (duint)param1; 218 | guistate.csp = (duint)param2; 219 | break; 220 | 221 | case GUI_SET_GLOBAL_NOTES: 222 | { 223 | if(param1) 224 | guistate.globalNotes = (const char*)param1; 225 | } 226 | break; 227 | 228 | case GUI_SET_DEBUGGEE_NOTES: 229 | { 230 | if(param1) 231 | guistate.debuggeeNotes = (const char*)param1; 232 | } 233 | break; 234 | 235 | case GUI_GET_GLOBAL_NOTES: 236 | { 237 | char* result = nullptr; 238 | if(!guistate.globalNotes.empty()) 239 | { 240 | result = (char*)BridgeAlloc(guistate.globalNotes.size() + 1); 241 | strcpy_s(result, guistate.globalNotes.size() + 1, guistate.globalNotes.c_str()); 242 | } 243 | *(char**)param1 = result; 244 | } 245 | break; 246 | 247 | case GUI_GET_DEBUGGEE_NOTES: 248 | { 249 | char* result = nullptr; 250 | if(!guistate.debuggeeNotes.empty()) 251 | { 252 | result = (char*)BridgeAlloc(guistate.debuggeeNotes.size() + 1); 253 | strcpy_s(result, guistate.debuggeeNotes.size() + 1, guistate.debuggeeNotes.c_str()); 254 | } 255 | *(char**)param1 = result; 256 | } 257 | break; 258 | 259 | case GUI_SELECTION_GET: 260 | { 261 | int hWindow = (int)param1; 262 | SELECTIONDATA* selection = (SELECTIONDATA*)param2; 263 | if(!DbgIsDebugging()) 264 | return (void*)false; 265 | duint p = 0; 266 | switch(hWindow) 267 | { 268 | case GUI_DISASSEMBLY: 269 | p = guistate.disasm; 270 | break; 271 | case GUI_DUMP: 272 | p = guistate.dump; 273 | break; 274 | case GUI_STACK: 275 | p = guistate.stack; 276 | break; 277 | default: 278 | return (void*)false; 279 | } 280 | selection->start = selection->end = p; 281 | return (void*)true; 282 | } 283 | break; 284 | 285 | case GUI_SELECTION_SET: 286 | { 287 | int hWindow = (int)param1; 288 | const SELECTIONDATA* selection = (const SELECTIONDATA*)param2; 289 | if(!DbgIsDebugging()) 290 | return (void*)false; 291 | duint p = 0; 292 | switch(hWindow) 293 | { 294 | case GUI_DISASSEMBLY: 295 | guistate.disasm = selection->start; 296 | break; 297 | case GUI_DUMP: 298 | guistate.dump = selection->start; 299 | break; 300 | case GUI_STACK: 301 | guistate.stack = selection->start; 302 | break; 303 | default: 304 | return (void*)false; 305 | } 306 | return (void*)true; 307 | } 308 | break; 309 | 310 | default: 311 | { 312 | printf("[TODO] Not implemented %s (%d)\n", guimsg2str(type), type); 313 | break; 314 | } 315 | } 316 | return nullptr; 317 | } 318 | 319 | extern "C" __declspec(dllexport) const char* _gui_translate_text(const char* source) 320 | { 321 | return source; 322 | } 323 | -------------------------------------------------------------------------------- /x64dbg_headless/x64dbg_headless.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 15.0 23 | {D65E1831-DF2D-4C74-B370-2A3038998886} 24 | x64dbgheadless 25 | 10.0.17763.0 26 | x64dbg_headless 27 | 28 | 29 | 30 | DynamicLibrary 31 | true 32 | v120_xp 33 | MultiByte 34 | 35 | 36 | DynamicLibrary 37 | false 38 | v120_xp 39 | true 40 | MultiByte 41 | 42 | 43 | DynamicLibrary 44 | true 45 | v120_xp 46 | MultiByte 47 | 48 | 49 | DynamicLibrary 50 | false 51 | v120_xp 52 | true 53 | MultiByte 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | x32gui 75 | 76 | 77 | x32gui 78 | 79 | 80 | x64gui 81 | 82 | 83 | x64gui 84 | 85 | 86 | 87 | Level3 88 | Disabled 89 | true 90 | true 91 | 92 | 93 | Windows 94 | true 95 | 96 | 97 | 98 | 99 | Level3 100 | Disabled 101 | true 102 | true 103 | 104 | 105 | Windows 106 | true 107 | 108 | 109 | 110 | 111 | Level3 112 | MaxSpeed 113 | true 114 | true 115 | true 116 | true 117 | 118 | 119 | true 120 | true 121 | Windows 122 | true 123 | 124 | 125 | 126 | 127 | Level3 128 | MaxSpeed 129 | true 130 | true 131 | true 132 | true 133 | 134 | 135 | true 136 | true 137 | Windows 138 | true 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /x64dbg_headless/x64dbg_headless.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {0a6dcb01-38dc-45a0-b124-43f964a80de6} 18 | 19 | 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Header Files\pluginsdk 31 | 32 | 33 | Header Files\pluginsdk 34 | 35 | 36 | Header Files\pluginsdk 37 | 38 | 39 | Header Files\pluginsdk 40 | 41 | 42 | Header Files\pluginsdk 43 | 44 | 45 | Header Files\pluginsdk 46 | 47 | 48 | Header Files\pluginsdk 49 | 50 | 51 | Header Files\pluginsdk 52 | 53 | 54 | Header Files\pluginsdk 55 | 56 | 57 | Header Files\pluginsdk 58 | 59 | 60 | Header Files\pluginsdk 61 | 62 | 63 | Header Files\pluginsdk 64 | 65 | 66 | Header Files\pluginsdk 67 | 68 | 69 | Header Files\pluginsdk 70 | 71 | 72 | Header Files\pluginsdk 73 | 74 | 75 | Header Files\pluginsdk 76 | 77 | 78 | Header Files\pluginsdk 79 | 80 | 81 | Header Files\pluginsdk 82 | 83 | 84 | Header Files\pluginsdk 85 | 86 | 87 | Header Files\pluginsdk 88 | 89 | 90 | Header Files\pluginsdk 91 | 92 | 93 | Header Files\pluginsdk 94 | 95 | 96 | Header Files\pluginsdk 97 | 98 | 99 | Header Files 100 | 101 | 102 | Header Files 103 | 104 | 105 | --------------------------------------------------------------------------------