├── .gitattributes ├── .gitignore ├── README.md ├── picture ├── 1.png ├── 2.png └── 3.png ├── x128dbg.sln └── x128dbg ├── plugin.cpp ├── plugin.h ├── pluginmain.cpp ├── pluginmain.h ├── 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 ├── x128dbg.vcxproj └── x128dbg.vcxproj.filters /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # Build Results of an ATL Project 47 | [Dd]ebugPS/ 48 | [Rr]eleasePS/ 49 | dlldata.c 50 | 51 | # Benchmark Results 52 | BenchmarkDotNet.Artifacts/ 53 | 54 | # .NET Core 55 | project.lock.json 56 | project.fragment.lock.json 57 | artifacts/ 58 | 59 | # StyleCop 60 | StyleCopReport.xml 61 | 62 | # Files built by Visual Studio 63 | *_i.c 64 | *_p.c 65 | *_h.h 66 | *.ilk 67 | *.meta 68 | *.obj 69 | *.iobj 70 | *.pch 71 | *.pdb 72 | *.ipdb 73 | *.pgc 74 | *.pgd 75 | *.rsp 76 | *.sbr 77 | *.tlb 78 | *.tli 79 | *.tlh 80 | *.tmp 81 | *.tmp_proj 82 | *_wpftmp.csproj 83 | *.log 84 | *.vspscc 85 | *.vssscc 86 | .builds 87 | *.pidb 88 | *.svclog 89 | *.scc 90 | 91 | # Chutzpah Test files 92 | _Chutzpah* 93 | 94 | # Visual C++ cache files 95 | ipch/ 96 | *.aps 97 | *.ncb 98 | *.opendb 99 | *.opensdf 100 | *.sdf 101 | *.cachefile 102 | *.VC.db 103 | *.VC.VC.opendb 104 | 105 | # Visual Studio profiler 106 | *.psess 107 | *.vsp 108 | *.vspx 109 | *.sap 110 | 111 | # Visual Studio Trace Files 112 | *.e2e 113 | 114 | # TFS 2012 Local Workspace 115 | $tf/ 116 | 117 | # Guidance Automation Toolkit 118 | *.gpState 119 | 120 | # ReSharper is a .NET coding add-in 121 | _ReSharper*/ 122 | *.[Rr]e[Ss]harper 123 | *.DotSettings.user 124 | 125 | # JustCode is a .NET coding add-in 126 | .JustCode 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # The packages folder can be ignored because of Package Restore 186 | **/[Pp]ackages/* 187 | # except build/, which is used as an MSBuild target. 188 | !**/[Pp]ackages/build/ 189 | # Uncomment if necessary however generally it will be regenerated when needed 190 | #!**/[Pp]ackages/repositories.config 191 | # NuGet v3's project.json files produces more ignorable files 192 | *.nuget.props 193 | *.nuget.targets 194 | 195 | # Microsoft Azure Build Output 196 | csx/ 197 | *.build.csdef 198 | 199 | # Microsoft Azure Emulator 200 | ecf/ 201 | rcf/ 202 | 203 | # Windows Store app package directories and files 204 | AppPackages/ 205 | BundleArtifacts/ 206 | Package.StoreAssociation.xml 207 | _pkginfo.txt 208 | *.appx 209 | 210 | # Visual Studio cache files 211 | # files ending in .cache can be ignored 212 | *.[Cc]ache 213 | # but keep track of directories ending in .cache 214 | !?*.[Cc]ache/ 215 | 216 | # Others 217 | ClientBin/ 218 | ~$* 219 | *~ 220 | *.dbmdl 221 | *.dbproj.schemaview 222 | *.jfm 223 | *.pfx 224 | *.publishsettings 225 | orleans.codegen.cs 226 | 227 | # Including strong name files can present a security risk 228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 229 | #*.snk 230 | 231 | # Since there are multiple workflows, uncomment next line to ignore bower_components 232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 233 | #bower_components/ 234 | 235 | # RIA/Silverlight projects 236 | Generated_Code/ 237 | 238 | # Backup & report files from converting an old project file 239 | # to a newer Visual Studio version. Backup files are not needed, 240 | # because we have git ;-) 241 | _UpgradeReport_Files/ 242 | Backup*/ 243 | UpgradeLog*.XML 244 | UpgradeLog*.htm 245 | ServiceFabricBackup/ 246 | *.rptproj.bak 247 | 248 | # SQL Server files 249 | *.mdf 250 | *.ldf 251 | *.ndf 252 | 253 | # Business Intelligence projects 254 | *.rdl.data 255 | *.bim.layout 256 | *.bim_*.settings 257 | *.rptproj.rsuser 258 | *- Backup*.rdl 259 | 260 | # Microsoft Fakes 261 | FakesAssemblies/ 262 | 263 | # GhostDoc plugin setting file 264 | *.GhostDoc.xml 265 | 266 | # Node.js Tools for Visual Studio 267 | .ntvs_analysis.dat 268 | node_modules/ 269 | 270 | # Visual Studio 6 build log 271 | *.plg 272 | 273 | # Visual Studio 6 workspace options file 274 | *.opt 275 | 276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 277 | *.vbw 278 | 279 | # Visual Studio LightSwitch build output 280 | **/*.HTMLClient/GeneratedArtifacts 281 | **/*.DesktopClient/GeneratedArtifacts 282 | **/*.DesktopClient/ModelManifest.xml 283 | **/*.Server/GeneratedArtifacts 284 | **/*.Server/ModelManifest.xml 285 | _Pvt_Extensions 286 | 287 | # Paket dependency manager 288 | .paket/paket.exe 289 | paket-files/ 290 | 291 | # FAKE - F# Make 292 | .fake/ 293 | 294 | # JetBrains Rider 295 | .idea/ 296 | *.sln.iml 297 | 298 | # CodeRush personal settings 299 | .cr/personal 300 | 301 | # Python Tools for Visual Studio (PTVS) 302 | __pycache__/ 303 | *.pyc 304 | 305 | # Cake - Uncomment if you are using it 306 | # tools/** 307 | # !tools/packages.config 308 | 309 | # Tabs Studio 310 | *.tss 311 | 312 | # Telerik's JustMock configuration file 313 | *.jmconfig 314 | 315 | # BizTalk build output 316 | *.btp.cs 317 | *.btm.cs 318 | *.odx.cs 319 | *.xsd.cs 320 | 321 | # OpenCover UI analysis results 322 | OpenCover/ 323 | 324 | # Azure Stream Analytics local run output 325 | ASALocalRun/ 326 | 327 | # MSBuild Binary and Structured Log 328 | *.binlog 329 | 330 | # NVidia Nsight GPU debugger configuration file 331 | *.nvuser 332 | 333 | # MFractors (Xamarin productivity tool) working folder 334 | .mfractor/ 335 | 336 | # Local History for Visual Studio 337 | .localhistory/ 338 | 339 | # BeatPulse healthcheck temp database 340 | healthchecksdb -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # x128dbg 2 | 3 | **x128dbg** 是一个 **x64dbg** 的插件,随着时间的推移,它会有越来越多的功能 4 | 5 | 6 | 7 | 目前的 **x128dbg** 的版本为 **v1** ,它提供了查看汇编指令手册的功能 8 | 9 | 10 | 11 | #### 查看汇编指令手册 12 | 13 | 有时,我们在使用 **x64dbg** 调试时,会碰到不认识的汇编指令(即使开启了 **x64dbg** 自带的 **Ctrl+Shift+F1** 显示指令提示功能也无济于事),我们拿 **shufps** 指令为例 14 | 15 | ![](picture/1.png) 16 | 17 | 当我们上网搜索时,却发现了这种方式的弊端 18 | 19 | ![](picture/2.png) 20 | 21 | 网上的信息繁杂且质量参差不齐,其中某度搜索引擎更是被XXDN、XX园、某机翻StackOverflow网站等给霸占了首页 22 | 23 | 24 | 25 | 我们为了了解指令的详细信息不得不面临大海捞针、真假难辨的风险 26 | 27 | 28 | 29 | 有的文章用粗陋的寥寥几字就概况了一条指令,更有的文章仅凭作者主观臆断就信笔写下了错误的字句 30 | 31 | 32 | 33 | 我们不禁想到,为什么不查看 **Intel** 官方指令手册呢? 34 | 35 | 36 | 37 | **x128dbg** 提供了便捷的快捷键和准确无误的官方手册,遇到不清楚的指令,只需按下 **/** 键即可快速查看汇编指令手册 38 | 39 | ![](picture/3.png) 40 | 41 | 通过按下快捷键,可以直接打开对应指令的官方文档页面,其中清晰的记录了指令的操作数、字节码、描述、所需架构环境、副作用、中断相关,更有图文并茂的介绍和指令内部工作机制 42 | 43 | 44 | 45 | **x128dbg** 提供了查看本地手册和查看网络手册两种模式,可以通过按下 **Ctrl+Alt+/** 快捷键切换 46 | 47 | 48 | 49 | 插件会自动检测 **plugins\x128dbg** 目录下是否存在 **manual** 目录,若存在,则默认使用本地手册,否则默认使用网络手册 50 | 51 | 52 | 53 | 插件默认提供了一个网络手册Url,由作者维护,因为是一台5M带宽的服务器,不支持太多人同时访问,因此有条件的可以自己搭建一个网络手册网站,通过在 **plugins\x128dbg** 目录下创建 **manual.txt** ,在其中填入自己的网站Url即可(注意:Url必须在txt的第一行,以 **http(s)://** 开头,以 **/manual/** 结尾) 54 | 55 | 56 | 57 | 通过解压本地手册压缩包并将 **manual** 目录放在 **plugins\x128dbg** 目录下,可以使用本地手册 58 | 59 | 60 | 61 | 网络手册不会占用硬盘空间,但是需要联网且加载速度视情况而定,本地手册需要占用硬盘空间,但是可以零流量秒打开 62 | 63 | 64 | 65 | 目前该功能支持从 [Intel官方手册](https://software.intel.com/content/www/us/en/develop/download/intel-64-and-ia-32-architectures-sdm-combined-volumes-1-2a-2b-2c-2d-3a-3b-3c-3d-and-4.html) 中获取的共1089条汇编指令 66 | 67 | 68 | 69 | #### BUG与建议 70 | 71 | 受限于作者的精力与技术,不敢保证该插件100%完美,如果你有发现任何 **BUG** 或者有更好的 **建议** ,欢迎联系作者 ┗|`O′|┛ 嗷~~ -------------------------------------------------------------------------------- /picture/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/picture/1.png -------------------------------------------------------------------------------- /picture/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/picture/2.png -------------------------------------------------------------------------------- /picture/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/picture/3.png -------------------------------------------------------------------------------- /x128dbg.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30717.126 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "x128dbg", "x128dbg\x128dbg.vcxproj", "{88E355EA-C75D-4162-AC6F-A39E3E8784DE}" 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 | {88E355EA-C75D-4162-AC6F-A39E3E8784DE}.Debug|x64.ActiveCfg = Debug|x64 17 | {88E355EA-C75D-4162-AC6F-A39E3E8784DE}.Debug|x64.Build.0 = Debug|x64 18 | {88E355EA-C75D-4162-AC6F-A39E3E8784DE}.Debug|x86.ActiveCfg = Debug|Win32 19 | {88E355EA-C75D-4162-AC6F-A39E3E8784DE}.Debug|x86.Build.0 = Debug|Win32 20 | {88E355EA-C75D-4162-AC6F-A39E3E8784DE}.Release|x64.ActiveCfg = Release|x64 21 | {88E355EA-C75D-4162-AC6F-A39E3E8784DE}.Release|x64.Build.0 = Release|x64 22 | {88E355EA-C75D-4162-AC6F-A39E3E8784DE}.Release|x86.ActiveCfg = Release|Win32 23 | {88E355EA-C75D-4162-AC6F-A39E3E8784DE}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {96407586-0414-44C3-9F8E-45A7EC73DEF9} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /x128dbg/plugin.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/plugin.cpp -------------------------------------------------------------------------------- /x128dbg/plugin.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "pluginmain.h" 4 | 5 | #include 6 | #include 7 | 8 | using namespace std; 9 | 10 | extern int hViewManual; 11 | extern int hLocalManual; 12 | extern vector instructions; 13 | extern string manualUrl; 14 | extern bool debugging; 15 | extern bool localManual; 16 | extern duint cursor; 17 | 18 | bool pluginInit(PLUG_INITSTRUCT* initStruct); 19 | void pluginStop(); 20 | void pluginSetup(); 21 | 22 | void initMenu(); 23 | void initCallback(); 24 | void initInstructions(); 25 | void initManual(); 26 | 27 | void cbMenuEntry(CBTYPE cbType, void* callbackInfo); 28 | void cbEnterDebugging(CBTYPE cbType, void* callbackInfo); 29 | void cbLeaveDebugging(CBTYPE cbType, void* callbackInfo); -------------------------------------------------------------------------------- /x128dbg/pluginmain.cpp: -------------------------------------------------------------------------------- 1 | #include "pluginmain.h" 2 | #include "plugin.h" 3 | 4 | int pluginHandle; 5 | HWND hwndDlg; 6 | int hMenu; 7 | int hMenuDisasm; 8 | int hMenuDump; 9 | int hMenuStack; 10 | 11 | PLUG_EXPORT bool pluginit(PLUG_INITSTRUCT* initStruct) 12 | { 13 | initStruct->pluginVersion = PLUGIN_VERSION; 14 | initStruct->sdkVersion = PLUG_SDKVERSION; 15 | strncpy_s(initStruct->pluginName, PLUGIN_NAME, _TRUNCATE); 16 | pluginHandle = initStruct->pluginHandle; 17 | return pluginInit(initStruct); 18 | } 19 | 20 | PLUG_EXPORT bool plugstop() 21 | { 22 | pluginStop(); 23 | return true; 24 | } 25 | 26 | PLUG_EXPORT void plugsetup(PLUG_SETUPSTRUCT* setupStruct) 27 | { 28 | hwndDlg = setupStruct->hwndDlg; 29 | hMenu = setupStruct->hMenu; 30 | hMenuDisasm = setupStruct->hMenuDisasm; 31 | hMenuDump = setupStruct->hMenuDump; 32 | hMenuStack = setupStruct->hMenuStack; 33 | pluginSetup(); 34 | } -------------------------------------------------------------------------------- /x128dbg/pluginmain.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define PLUGIN_NAME "x128dbg" 4 | #define PLUGIN_VERSION 1 5 | 6 | #include "pluginsdk/bridgemain.h" 7 | #include "pluginsdk/_plugins.h" 8 | #include "pluginsdk/_scriptapi_argument.h" 9 | #include "pluginsdk/_scriptapi_assembler.h" 10 | #include "pluginsdk/_scriptapi_bookmark.h" 11 | #include "pluginsdk/_scriptapi_comment.h" 12 | #include "pluginsdk/_scriptapi_debug.h" 13 | #include "pluginsdk/_scriptapi_flag.h" 14 | #include "pluginsdk/_scriptapi_function.h" 15 | #include "pluginsdk/_scriptapi_gui.h" 16 | #include "pluginsdk/_scriptapi_label.h" 17 | #include "pluginsdk/_scriptapi_memory.h" 18 | #include "pluginsdk/_scriptapi_misc.h" 19 | #include "pluginsdk/_scriptapi_module.h" 20 | #include "pluginsdk/_scriptapi_pattern.h" 21 | #include "pluginsdk/_scriptapi_register.h" 22 | #include "pluginsdk/_scriptapi_stack.h" 23 | #include "pluginsdk/_scriptapi_symbol.h" 24 | #include "pluginsdk/DeviceNameResolver/DeviceNameResolver.h" 25 | #include "pluginsdk/jansson/jansson.h" 26 | #include "pluginsdk/lz4/lz4file.h" 27 | #include "pluginsdk/TitanEngine/TitanEngine.h" 28 | #include "pluginsdk/XEDParse/XEDParse.h" 29 | 30 | #ifdef _WIN64 31 | #pragma comment(lib, "pluginsdk/x64dbg.lib") 32 | #pragma comment(lib, "pluginsdk/x64bridge.lib") 33 | #pragma comment(lib, "pluginsdk/DeviceNameResolver/DeviceNameResolver_x64.lib") 34 | #pragma comment(lib, "pluginsdk/jansson/jansson_x64.lib") 35 | #pragma comment(lib, "pluginsdk/lz4/lz4_x64.lib") 36 | #pragma comment(lib, "pluginsdk/TitanEngine/TitanEngine_x64.lib") 37 | #pragma comment(lib, "pluginsdk/XEDParse/XEDParse_x64.lib") 38 | #else 39 | #pragma comment(lib, "pluginsdk/x32dbg.lib") 40 | #pragma comment(lib, "pluginsdk/x32bridge.lib") 41 | #pragma comment(lib, "pluginsdk/DeviceNameResolver/DeviceNameResolver_x86.lib") 42 | #pragma comment(lib, "pluginsdk/jansson/jansson_x86.lib") 43 | #pragma comment(lib, "pluginsdk/lz4/lz4_x86.lib") 44 | #pragma comment(lib, "pluginsdk/TitanEngine/TitanEngine_x86.lib") 45 | #pragma comment(lib, "pluginsdk/XEDParse/XEDParse_x86.lib") 46 | #endif 47 | 48 | #define Cmd(x) DbgCmdExecDirect(x) 49 | #define Eval(x) DbgValFromString(x) 50 | #define dprintf(x, ...) _plugin_logprintf("[" PLUGIN_NAME "] " x, __VA_ARGS__) 51 | #define dputs(x) _plugin_logputs("[" PLUGIN_NAME "] " x) 52 | #define PLUG_EXPORT extern "C" __declspec(dllexport) 53 | 54 | extern int pluginHandle; 55 | extern HWND hwndDlg; 56 | extern int hMenu; 57 | extern int hMenuDisasm; 58 | extern int hMenuDump; 59 | extern int hMenuStack; -------------------------------------------------------------------------------- /x128dbg/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 | -------------------------------------------------------------------------------- /x128dbg/pluginsdk/DeviceNameResolver/DeviceNameResolver_x64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/DeviceNameResolver/DeviceNameResolver_x64.a -------------------------------------------------------------------------------- /x128dbg/pluginsdk/DeviceNameResolver/DeviceNameResolver_x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/DeviceNameResolver/DeviceNameResolver_x64.lib -------------------------------------------------------------------------------- /x128dbg/pluginsdk/DeviceNameResolver/DeviceNameResolver_x86.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/DeviceNameResolver/DeviceNameResolver_x86.a -------------------------------------------------------------------------------- /x128dbg/pluginsdk/DeviceNameResolver/DeviceNameResolver_x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/DeviceNameResolver/DeviceNameResolver_x86.lib -------------------------------------------------------------------------------- /x128dbg/pluginsdk/TitanEngine/TitanEngine_x64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/TitanEngine/TitanEngine_x64.a -------------------------------------------------------------------------------- /x128dbg/pluginsdk/TitanEngine/TitanEngine_x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/TitanEngine/TitanEngine_x64.lib -------------------------------------------------------------------------------- /x128dbg/pluginsdk/TitanEngine/TitanEngine_x86.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/TitanEngine/TitanEngine_x86.a -------------------------------------------------------------------------------- /x128dbg/pluginsdk/TitanEngine/TitanEngine_x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/TitanEngine/TitanEngine_x86.lib -------------------------------------------------------------------------------- /x128dbg/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 | -------------------------------------------------------------------------------- /x128dbg/pluginsdk/XEDParse/XEDParse_x64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/XEDParse/XEDParse_x64.a -------------------------------------------------------------------------------- /x128dbg/pluginsdk/XEDParse/XEDParse_x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/XEDParse/XEDParse_x64.lib -------------------------------------------------------------------------------- /x128dbg/pluginsdk/XEDParse/XEDParse_x86.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/XEDParse/XEDParse_x86.a -------------------------------------------------------------------------------- /x128dbg/pluginsdk/XEDParse/XEDParse_x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/XEDParse/XEDParse_x86.lib -------------------------------------------------------------------------------- /x128dbg/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 enum 133 | { 134 | MODSYMUNLOADED = 0, 135 | MODSYMLOADING, 136 | MODSYMLOADED 137 | } MODULESYMBOLSTATUS; 138 | 139 | typedef bool (*ASSEMBLEATEX)(duint addr, const char* instruction, char* error, bool fillnop); 140 | typedef bool (*SECTIONFROMADDR)(duint addr, char* section); 141 | typedef bool (*MODNAMEFROMADDR)(duint addr, char* modname, bool extension); 142 | typedef duint(*MODBASEFROMADDR)(duint addr); 143 | typedef duint(*MODBASEFROMNAME)(const char* modname); 144 | typedef duint(*MODSIZEFROMADDR)(duint addr); 145 | typedef bool (*ASSEMBLE)(duint addr, unsigned char* dest, int* size, const char* instruction, char* error); 146 | typedef bool (*PATCHGET)(duint addr); 147 | typedef bool (*PATCHINRANGE)(duint start, duint end); 148 | typedef bool (*MEMPATCH)(duint va, const unsigned char* src, duint size); 149 | typedef void (*PATCHRESTORERANGE)(duint start, duint end); 150 | typedef bool (*PATCHENUM)(DBGPATCHINFO* patchlist, size_t* cbsize); 151 | typedef bool (*PATCHRESTORE)(duint addr); 152 | typedef int (*PATCHFILE)(DBGPATCHINFO* patchlist, int count, const char* szFileName, char* error); 153 | typedef int (*MODPATHFROMADDR)(duint addr, char* path, int size); 154 | typedef int (*MODPATHFROMNAME)(const char* modname, char* path, int size); 155 | typedef bool (*DISASMFAST)(const unsigned char* data, duint addr, BASIC_INSTRUCTION_INFO* basicinfo); 156 | typedef void (*MEMUPDATEMAP)(); 157 | typedef void (*GETCALLSTACK)(DBGCALLSTACK* callstack); 158 | typedef void (*GETSEHCHAIN)(DBGSEHCHAIN* sehchain); 159 | typedef void (*SYMBOLDOWNLOADALLSYMBOLS)(const char* szSymbolStore); 160 | typedef bool (*GETJIT)(char* jit, bool x64); 161 | typedef bool (*GETJITAUTO)(bool* jitauto); 162 | typedef bool (*GETDEFJIT)(char* defjit); 163 | typedef bool (*GETPROCESSLIST)(DBGPROCESSINFO** entries, int* count); 164 | typedef bool (*GETPAGERIGHTS)(duint addr, char* rights); 165 | typedef bool (*SETPAGERIGHTS)(duint addr, const char* rights); 166 | typedef bool (*PAGERIGHTSTOSTRING)(DWORD protect, char* rights); 167 | typedef bool (*ISPROCESSELEVATED)(); 168 | typedef bool (*GETCMDLINE)(char* cmdline, size_t* cbsize); 169 | typedef bool (*SETCMDLINE)(const char* cmdline); 170 | typedef duint(*FILEOFFSETTOVA)(const char* modname, duint offset); 171 | typedef duint(*VATOFILEOFFSET)(duint va); 172 | typedef duint(*GETADDRFROMLINE)(const char* szSourceFile, int line, duint* displacement); 173 | typedef bool (*GETSOURCEFROMADDR)(duint addr, char* szSourceFile, int* line); 174 | typedef bool (*VALFROMSTRING)(const char* string, duint* value); 175 | typedef bool (*PATCHGETEX)(duint addr, DBGPATCHINFO* info); 176 | typedef bool (*GETBRIDGEBP)(BPXTYPE type, duint addr, BRIDGEBP* bp); 177 | typedef bool (*STRINGFORMATINLINE)(const char* format, size_t resultSize, char* result); 178 | typedef void (*GETMNEMONICBRIEF)(const char* mnem, size_t resultSize, char* result); 179 | typedef unsigned int (*GETTRACERECORDHITCOUNT)(duint address); 180 | typedef TRACERECORDBYTETYPE(*GETTRACERECORDBYTETYPE)(duint address); 181 | typedef bool (*SETTRACERECORDTYPE)(duint pageAddress, TRACERECORDTYPE type); 182 | typedef TRACERECORDTYPE(*GETTRACERECORDTYPE)(duint pageAddress); 183 | typedef bool (*ENUMHANDLES)(ListOf(HANDLEINFO) handles); 184 | typedef bool (*GETHANDLENAME)(duint handle, char* name, size_t nameSize, char* typeName, size_t typeNameSize); 185 | typedef bool (*ENUMTCPCONNECTIONS)(ListOf(TCPCONNECTIONINFO) connections); 186 | typedef duint(*GETDBGEVENTS)(); 187 | typedef MODULEPARTY(*MODGETPARTY)(duint base); 188 | typedef void (*MODSETPARTY)(duint base, MODULEPARTY party); 189 | typedef bool(*WATCHISWATCHDOGTRIGGERED)(unsigned int id); 190 | typedef bool(*MEMISCODEPAGE)(duint addr, bool refresh); 191 | typedef bool(*ANIMATECOMMAND)(const char* command); 192 | typedef void(*DBGSETDEBUGGEEINITSCRIPT)(const char* fileName); 193 | typedef const char* (*DBGGETDEBUGGEEINITSCRIPT)(); 194 | typedef bool(*HANDLESENUMWINDOWS)(ListOf(WINDOW_INFO) windows); 195 | typedef bool(*HANDLESENUMHEAPS)(ListOf(HEAPINFO) heaps); 196 | typedef bool(*THREADGETNAME)(DWORD tid, char* name); 197 | typedef bool(*ISDEPENABLED)(); 198 | typedef void(*GETCALLSTACKEX)(DBGCALLSTACK* callstack, bool cache); 199 | typedef bool(*GETUSERCOMMENT)(duint addr, char* comment); 200 | typedef void(*ENUMCONSTANTS)(ListOf(CONSTANTINFO) constants); 201 | typedef duint(*MEMBPSIZE)(duint addr); 202 | typedef bool(*MODRELOCATIONSFROMADDR)(duint addr, ListOf(DBGRELOCATIONINFO) relocations); 203 | typedef bool(*MODRELOCATIONATADDR)(duint addr, DBGRELOCATIONINFO* relocation); 204 | typedef bool(*MODRELOCATIONSINRANGE)(duint addr, duint size, ListOf(DBGRELOCATIONINFO) relocations); 205 | typedef duint(*DBGETHASH)(); 206 | typedef int(*SYMAUTOCOMPLETE)(const char* Search, char** Buffer, int MaxSymbols); 207 | typedef void(*REFRESHMODULELIST)(); 208 | typedef duint(*GETADDRFROMLINEEX)(duint mod, const char* szSourceFile, int line); 209 | typedef MODULESYMBOLSTATUS(*MODSYMBOLSTATUS)(duint mod); 210 | 211 | //The list of all the DbgFunctions() return value. 212 | //WARNING: This list is append only. Do not insert things in the middle or plugins would break. 213 | typedef struct DBGFUNCTIONS_ 214 | { 215 | ASSEMBLEATEX AssembleAtEx; 216 | SECTIONFROMADDR SectionFromAddr; 217 | MODNAMEFROMADDR ModNameFromAddr; 218 | MODBASEFROMADDR ModBaseFromAddr; 219 | MODBASEFROMNAME ModBaseFromName; 220 | MODSIZEFROMADDR ModSizeFromAddr; 221 | ASSEMBLE Assemble; 222 | PATCHGET PatchGet; 223 | PATCHINRANGE PatchInRange; 224 | MEMPATCH MemPatch; 225 | PATCHRESTORERANGE PatchRestoreRange; 226 | PATCHENUM PatchEnum; 227 | PATCHRESTORE PatchRestore; 228 | PATCHFILE PatchFile; 229 | MODPATHFROMADDR ModPathFromAddr; 230 | MODPATHFROMNAME ModPathFromName; 231 | DISASMFAST DisasmFast; 232 | MEMUPDATEMAP MemUpdateMap; 233 | GETCALLSTACK GetCallStack; 234 | GETSEHCHAIN GetSEHChain; 235 | SYMBOLDOWNLOADALLSYMBOLS SymbolDownloadAllSymbols; 236 | GETJITAUTO GetJitAuto; 237 | GETJIT GetJit; 238 | GETDEFJIT GetDefJit; 239 | GETPROCESSLIST GetProcessList; 240 | GETPAGERIGHTS GetPageRights; 241 | SETPAGERIGHTS SetPageRights; 242 | PAGERIGHTSTOSTRING PageRightsToString; 243 | ISPROCESSELEVATED IsProcessElevated; 244 | GETCMDLINE GetCmdline; 245 | SETCMDLINE SetCmdline; 246 | FILEOFFSETTOVA FileOffsetToVa; 247 | VATOFILEOFFSET VaToFileOffset; 248 | GETADDRFROMLINE GetAddrFromLine; 249 | GETSOURCEFROMADDR GetSourceFromAddr; 250 | VALFROMSTRING ValFromString; 251 | PATCHGETEX PatchGetEx; 252 | GETBRIDGEBP GetBridgeBp; 253 | STRINGFORMATINLINE StringFormatInline; 254 | GETMNEMONICBRIEF GetMnemonicBrief; 255 | GETTRACERECORDHITCOUNT GetTraceRecordHitCount; 256 | GETTRACERECORDBYTETYPE GetTraceRecordByteType; 257 | SETTRACERECORDTYPE SetTraceRecordType; 258 | GETTRACERECORDTYPE GetTraceRecordType; 259 | ENUMHANDLES EnumHandles; 260 | GETHANDLENAME GetHandleName; 261 | ENUMTCPCONNECTIONS EnumTcpConnections; 262 | GETDBGEVENTS GetDbgEvents; 263 | MODGETPARTY ModGetParty; 264 | MODSETPARTY ModSetParty; 265 | WATCHISWATCHDOGTRIGGERED WatchIsWatchdogTriggered; 266 | MEMISCODEPAGE MemIsCodePage; 267 | ANIMATECOMMAND AnimateCommand; 268 | DBGSETDEBUGGEEINITSCRIPT DbgSetDebuggeeInitScript; 269 | DBGGETDEBUGGEEINITSCRIPT DbgGetDebuggeeInitScript; 270 | HANDLESENUMWINDOWS EnumWindows; 271 | HANDLESENUMHEAPS EnumHeaps; 272 | THREADGETNAME ThreadGetName; 273 | ISDEPENABLED IsDepEnabled; 274 | GETCALLSTACKEX GetCallStackEx; 275 | GETUSERCOMMENT GetUserComment; 276 | ENUMCONSTANTS EnumConstants; 277 | ENUMCONSTANTS EnumErrorCodes; 278 | ENUMCONSTANTS EnumExceptions; 279 | MEMBPSIZE MemBpSize; 280 | MODRELOCATIONSFROMADDR ModRelocationsFromAddr; 281 | MODRELOCATIONATADDR ModRelocationAtAddr; 282 | MODRELOCATIONSINRANGE ModRelocationsInRange; 283 | DBGETHASH DbGetHash; 284 | SYMAUTOCOMPLETE SymAutoComplete; 285 | REFRESHMODULELIST RefreshModuleList; 286 | GETADDRFROMLINEEX GetAddrFromLineEx; 287 | MODSYMBOLSTATUS ModSymbolStatus; 288 | } DBGFUNCTIONS; 289 | 290 | #ifdef BUILD_DBG 291 | 292 | const DBGFUNCTIONS* dbgfunctionsget(); 293 | void dbgfunctionsinit(); 294 | 295 | #endif //BUILD_DBG 296 | 297 | #endif //_DBGFUNCTIONS_H 298 | -------------------------------------------------------------------------------- /x128dbg/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 | -------------------------------------------------------------------------------- /x128dbg/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 | int hMenuGraph; //plugin graph menu handle 51 | int hMenuMemmap; //plugin memory map menu handle 52 | int hMenuSymmod; //plugin symbol module menu handle 53 | } PLUG_SETUPSTRUCT; 54 | 55 | typedef struct 56 | { 57 | void* data; //user data 58 | } PLUG_SCRIPTSTRUCT; 59 | 60 | //callback structures 61 | typedef struct 62 | { 63 | const char* szFileName; 64 | } PLUG_CB_INITDEBUG; 65 | 66 | typedef struct 67 | { 68 | void* reserved; 69 | } PLUG_CB_STOPDEBUG; 70 | 71 | typedef struct 72 | { 73 | CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo; 74 | IMAGEHLP_MODULE64* modInfo; 75 | const char* DebugFileName; 76 | PROCESS_INFORMATION* fdProcessInfo; 77 | } PLUG_CB_CREATEPROCESS; 78 | 79 | typedef struct 80 | { 81 | EXIT_PROCESS_DEBUG_INFO* ExitProcess; 82 | } PLUG_CB_EXITPROCESS; 83 | 84 | typedef struct 85 | { 86 | CREATE_THREAD_DEBUG_INFO* CreateThread; 87 | DWORD dwThreadId; 88 | } PLUG_CB_CREATETHREAD; 89 | 90 | typedef struct 91 | { 92 | EXIT_THREAD_DEBUG_INFO* ExitThread; 93 | DWORD dwThreadId; 94 | } PLUG_CB_EXITTHREAD; 95 | 96 | typedef struct 97 | { 98 | void* reserved; 99 | } PLUG_CB_SYSTEMBREAKPOINT; 100 | 101 | typedef struct 102 | { 103 | LOAD_DLL_DEBUG_INFO* LoadDll; 104 | IMAGEHLP_MODULE64* modInfo; 105 | const char* modname; 106 | } PLUG_CB_LOADDLL; 107 | 108 | typedef struct 109 | { 110 | UNLOAD_DLL_DEBUG_INFO* UnloadDll; 111 | } PLUG_CB_UNLOADDLL; 112 | 113 | typedef struct 114 | { 115 | OUTPUT_DEBUG_STRING_INFO* DebugString; 116 | } PLUG_CB_OUTPUTDEBUGSTRING; 117 | 118 | typedef struct 119 | { 120 | EXCEPTION_DEBUG_INFO* Exception; 121 | } PLUG_CB_EXCEPTION; 122 | 123 | typedef struct 124 | { 125 | BRIDGEBP* breakpoint; 126 | } PLUG_CB_BREAKPOINT; 127 | 128 | typedef struct 129 | { 130 | void* reserved; 131 | } PLUG_CB_PAUSEDEBUG; 132 | 133 | typedef struct 134 | { 135 | void* reserved; 136 | } PLUG_CB_RESUMEDEBUG; 137 | 138 | typedef struct 139 | { 140 | void* reserved; 141 | } PLUG_CB_STEPPED; 142 | 143 | typedef struct 144 | { 145 | DWORD dwProcessId; 146 | } PLUG_CB_ATTACH; 147 | 148 | typedef struct 149 | { 150 | PROCESS_INFORMATION* fdProcessInfo; 151 | } PLUG_CB_DETACH; 152 | 153 | typedef struct 154 | { 155 | DEBUG_EVENT* DebugEvent; 156 | } PLUG_CB_DEBUGEVENT; 157 | 158 | typedef struct 159 | { 160 | int hEntry; 161 | } PLUG_CB_MENUENTRY; 162 | 163 | typedef struct 164 | { 165 | MSG* message; 166 | long* result; 167 | bool retval; 168 | } PLUG_CB_WINEVENT; 169 | 170 | typedef struct 171 | { 172 | MSG* message; 173 | bool retval; 174 | } PLUG_CB_WINEVENTGLOBAL; 175 | 176 | typedef struct 177 | { 178 | json_t* root; 179 | int loadSaveType; 180 | } PLUG_CB_LOADSAVEDB; 181 | 182 | typedef struct 183 | { 184 | const char* symbol; 185 | bool retval; 186 | } PLUG_CB_FILTERSYMBOL; 187 | 188 | typedef struct 189 | { 190 | duint cip; 191 | bool stop; 192 | } PLUG_CB_TRACEEXECUTE; 193 | 194 | typedef struct 195 | { 196 | int hWindow; 197 | duint VA; 198 | } PLUG_CB_SELCHANGED; 199 | 200 | typedef struct 201 | { 202 | BridgeCFGraphList graph; 203 | } PLUG_CB_ANALYZE; 204 | 205 | typedef struct 206 | { 207 | duint addr; 208 | BRIDGE_ADDRINFO* addrinfo; 209 | bool retval; 210 | } PLUG_CB_ADDRINFO; 211 | 212 | typedef struct 213 | { 214 | const char* string; 215 | duint value; 216 | int* value_size; 217 | bool* isvar; 218 | bool* hexonly; 219 | bool retval; 220 | } PLUG_CB_VALFROMSTRING; 221 | 222 | typedef struct 223 | { 224 | const char* string; 225 | duint value; 226 | bool retval; 227 | } PLUG_CB_VALTOSTRING; 228 | 229 | typedef struct 230 | { 231 | GUIMENUTYPE hMenu; 232 | } PLUG_CB_MENUPREPARE; 233 | 234 | //enums 235 | typedef enum 236 | { 237 | CB_INITDEBUG, //PLUG_CB_INITDEBUG 238 | CB_STOPDEBUG, //PLUG_CB_STOPDEBUG 239 | CB_CREATEPROCESS, //PLUG_CB_CREATEPROCESS 240 | CB_EXITPROCESS, //PLUG_CB_EXITPROCESS 241 | CB_CREATETHREAD, //PLUG_CB_CREATETHREAD 242 | CB_EXITTHREAD, //PLUG_CB_EXITTHREAD 243 | CB_SYSTEMBREAKPOINT, //PLUG_CB_SYSTEMBREAKPOINT 244 | CB_LOADDLL, //PLUG_CB_LOADDLL 245 | CB_UNLOADDLL, //PLUG_CB_UNLOADDLL 246 | CB_OUTPUTDEBUGSTRING, //PLUG_CB_OUTPUTDEBUGSTRING 247 | CB_EXCEPTION, //PLUG_CB_EXCEPTION 248 | CB_BREAKPOINT, //PLUG_CB_BREAKPOINT 249 | CB_PAUSEDEBUG, //PLUG_CB_PAUSEDEBUG 250 | CB_RESUMEDEBUG, //PLUG_CB_RESUMEDEBUG 251 | CB_STEPPED, //PLUG_CB_STEPPED 252 | CB_ATTACH, //PLUG_CB_ATTACHED (before attaching, after CB_INITDEBUG) 253 | CB_DETACH, //PLUG_CB_DETACH (before detaching, before CB_STOPDEBUG) 254 | CB_DEBUGEVENT, //PLUG_CB_DEBUGEVENT (called on any debug event) 255 | CB_MENUENTRY, //PLUG_CB_MENUENTRY 256 | CB_WINEVENT, //PLUG_CB_WINEVENT 257 | CB_WINEVENTGLOBAL, //PLUG_CB_WINEVENTGLOBAL 258 | CB_LOADDB, //PLUG_CB_LOADSAVEDB 259 | CB_SAVEDB, //PLUG_CB_LOADSAVEDB 260 | CB_FILTERSYMBOL, //PLUG_CB_FILTERSYMBOL 261 | CB_TRACEEXECUTE, //PLUG_CB_TRACEEXECUTE 262 | CB_SELCHANGED, //PLUG_CB_SELCHANGED 263 | CB_ANALYZE, //PLUG_CB_ANALYZE 264 | CB_ADDRINFO, //PLUG_CB_ADDRINFO 265 | CB_VALFROMSTRING, //PLUG_CB_VALFROMSTRING 266 | CB_VALTOSTRING, //PLUG_CB_VALTOSTRING 267 | CB_MENUPREPARE, //PLUG_CB_MENUPREPARE 268 | CB_LAST 269 | } CBTYPE; 270 | 271 | typedef enum 272 | { 273 | FORMAT_ERROR, //generic failure (no message) 274 | FORMAT_SUCCESS, //success 275 | FORMAT_ERROR_MESSAGE, //formatting failed but an error was put in the buffer (there are always at least 511 characters available). 276 | FORMAT_BUFFER_TOO_SMALL //buffer too small (x64dbg will retry until the buffer is big enough) 277 | } FORMATRESULT; 278 | 279 | //typedefs 280 | typedef void (*CBPLUGIN)(CBTYPE cbType, void* callbackInfo); 281 | typedef bool (*CBPLUGINCOMMAND)(int argc, char** argv); 282 | typedef void (*CBPLUGINSCRIPT)(); 283 | typedef duint(*CBPLUGINEXPRFUNCTION)(int argc, duint* argv, void* userdata); 284 | typedef FORMATRESULT(*CBPLUGINFORMATFUNCTION)(char* dest, size_t destCount, int argc, char* argv[], duint value, void* userdata); 285 | typedef bool (*CBPLUGINPREDICATE)(void* userdata); 286 | 287 | //exports 288 | #ifdef __cplusplus 289 | extern "C" 290 | { 291 | #endif 292 | 293 | PLUG_IMPEXP void _plugin_registercallback(int pluginHandle, CBTYPE cbType, CBPLUGIN cbPlugin); 294 | PLUG_IMPEXP bool _plugin_unregistercallback(int pluginHandle, CBTYPE cbType); 295 | PLUG_IMPEXP bool _plugin_registercommand(int pluginHandle, const char* command, CBPLUGINCOMMAND cbCommand, bool debugonly); 296 | PLUG_IMPEXP bool _plugin_unregistercommand(int pluginHandle, const char* command); 297 | PLUG_IMPEXP void _plugin_logprintf(const char* format, ...); 298 | PLUG_IMPEXP void _plugin_logputs(const char* text); 299 | PLUG_IMPEXP void _plugin_logprint(const char* text); 300 | PLUG_IMPEXP void _plugin_debugpause(); 301 | PLUG_IMPEXP void _plugin_debugskipexceptions(bool skip); 302 | PLUG_IMPEXP int _plugin_menuadd(int hMenu, const char* title); 303 | PLUG_IMPEXP bool _plugin_menuaddentry(int hMenu, int hEntry, const char* title); 304 | PLUG_IMPEXP bool _plugin_menuaddseparator(int hMenu); 305 | PLUG_IMPEXP bool _plugin_menuclear(int hMenu); 306 | PLUG_IMPEXP void _plugin_menuseticon(int hMenu, const ICONDATA* icon); 307 | PLUG_IMPEXP void _plugin_menuentryseticon(int pluginHandle, int hEntry, const ICONDATA* icon); 308 | PLUG_IMPEXP void _plugin_menuentrysetchecked(int pluginHandle, int hEntry, bool checked); 309 | PLUG_IMPEXP void _plugin_menusetvisible(int pluginHandle, int hMenu, bool visible); 310 | PLUG_IMPEXP void _plugin_menuentrysetvisible(int pluginHandle, int hEntry, bool visible); 311 | PLUG_IMPEXP void _plugin_menusetname(int pluginHandle, int hMenu, const char* name); 312 | PLUG_IMPEXP void _plugin_menuentrysetname(int pluginHandle, int hEntry, const char* name); 313 | PLUG_IMPEXP void _plugin_menuentrysethotkey(int pluginHandle, int hEntry, const char* hotkey); 314 | PLUG_IMPEXP bool _plugin_menuremove(int hMenu); 315 | PLUG_IMPEXP bool _plugin_menuentryremove(int pluginHandle, int hEntry); 316 | PLUG_IMPEXP void _plugin_startscript(CBPLUGINSCRIPT cbScript); 317 | PLUG_IMPEXP bool _plugin_waituntilpaused(); 318 | PLUG_IMPEXP bool _plugin_registerexprfunction(int pluginHandle, const char* name, int argc, CBPLUGINEXPRFUNCTION cbFunction, void* userdata); 319 | PLUG_IMPEXP bool _plugin_unregisterexprfunction(int pluginHandle, const char* name); 320 | PLUG_IMPEXP bool _plugin_unload(const char* pluginName); 321 | PLUG_IMPEXP bool _plugin_load(const char* pluginName); 322 | PLUG_IMPEXP duint _plugin_hash(const void* data, duint size); 323 | PLUG_IMPEXP bool _plugin_registerformatfunction(int pluginHandle, const char* type, CBPLUGINFORMATFUNCTION cbFunction, void* userdata); 324 | PLUG_IMPEXP bool _plugin_unregisterformatfunction(int pluginHandle, const char* type); 325 | 326 | #ifdef __cplusplus 327 | } 328 | #endif 329 | 330 | #pragma pack(pop) 331 | 332 | #endif // _PLUGINS_H 333 | -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 | -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 | -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 = 0; //function of which this node is a part 44 | duint start = 0; //va of the first instruction in the block 45 | duint end = 0; //va of the last instruction in the block (inclusive) 46 | duint brtrue = 0; //destination if condition is true 47 | duint brfalse = 0; //destination if condition is false 48 | duint icount = 0; //number of instructions in node 49 | bool terminal = false; //node is a RET 50 | bool split = false; //node is a split (brtrue points to the next node) 51 | bool indirectcall = false; //node contains indirect calls (call reg, call [reg+X]) 52 | void* userdata = nullptr; //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 | BridgeCFNode() = default; 65 | 66 | BridgeCFNode(const BridgeCFNodeList* nodeList, bool freedata) 67 | { 68 | if(!nodeList) 69 | __debugbreak(); 70 | parentGraph = nodeList->parentGraph; 71 | start = nodeList->start; 72 | end = nodeList->end; 73 | brtrue = nodeList->brtrue; 74 | brfalse = nodeList->brfalse; 75 | icount = nodeList->icount; 76 | terminal = nodeList->terminal; 77 | indirectcall = nodeList->indirectcall; 78 | split = nodeList->split; 79 | userdata = nodeList->userdata; 80 | if(!BridgeList::ToVector(&nodeList->exits, exits, freedata)) 81 | __debugbreak(); 82 | if(!BridgeList::ToVector(&nodeList->instrs, instrs, freedata)) 83 | __debugbreak(); 84 | } 85 | 86 | BridgeCFNode(duint parentGraph, duint start, duint end) 87 | : parentGraph(parentGraph), 88 | start(start), 89 | end(end) 90 | { 91 | } 92 | 93 | BridgeCFNodeList ToNodeList() const 94 | { 95 | BridgeCFNodeList out; 96 | out.parentGraph = parentGraph; 97 | out.start = start; 98 | out.end = end; 99 | out.brtrue = brtrue; 100 | out.brfalse = brfalse; 101 | out.icount = icount; 102 | out.terminal = terminal; 103 | out.indirectcall = indirectcall; 104 | out.split = split; 105 | out.userdata = userdata; 106 | BridgeList::CopyData(&out.exits, exits); 107 | BridgeList::CopyData(&out.instrs, instrs); 108 | return std::move(out); 109 | } 110 | }; 111 | 112 | struct BridgeCFGraph 113 | { 114 | duint entryPoint; //graph entry point 115 | void* userdata; //user data 116 | std::unordered_map nodes; //CFNode.start -> CFNode 117 | std::unordered_map> parents; //CFNode.start -> parents 118 | 119 | static void Free(const BridgeCFGraphList* graphList) 120 | { 121 | if(!graphList || graphList->nodes.size != graphList->nodes.count * sizeof(BridgeCFNodeList)) 122 | __debugbreak(); 123 | auto data = (BridgeCFNodeList*)graphList->nodes.data; 124 | for(int i = 0; i < graphList->nodes.count; i++) 125 | BridgeCFNode::Free(&data[i]); 126 | BridgeFree(data); 127 | } 128 | 129 | explicit BridgeCFGraph(const BridgeCFGraphList* graphList, bool freedata) 130 | { 131 | if(!graphList || graphList->nodes.size != graphList->nodes.count * sizeof(BridgeCFNodeList)) 132 | __debugbreak(); 133 | entryPoint = graphList->entryPoint; 134 | userdata = graphList->userdata; 135 | auto data = (BridgeCFNodeList*)graphList->nodes.data; 136 | for(int i = 0; i < graphList->nodes.count; i++) 137 | AddNode(BridgeCFNode(&data[i], freedata)); 138 | if(freedata && data) 139 | BridgeFree(data); 140 | } 141 | 142 | explicit BridgeCFGraph(duint entryPoint) 143 | : entryPoint(entryPoint), 144 | userdata(nullptr) 145 | { 146 | } 147 | 148 | void AddNode(const BridgeCFNode & node) 149 | { 150 | nodes[node.start] = node; 151 | AddParent(node.start, node.brtrue); 152 | AddParent(node.start, node.brfalse); 153 | } 154 | 155 | void AddParent(duint child, duint parent) 156 | { 157 | if(!child || !parent) 158 | return; 159 | auto found = parents.find(child); 160 | if(found == parents.end()) 161 | { 162 | parents[child] = std::unordered_set(); 163 | parents[child].insert(parent); 164 | } 165 | else 166 | found->second.insert(parent); 167 | } 168 | 169 | BridgeCFGraphList ToGraphList() const 170 | { 171 | BridgeCFGraphList out; 172 | out.entryPoint = entryPoint; 173 | out.userdata = userdata; 174 | std::vector nodeList; 175 | nodeList.reserve(nodes.size()); 176 | for(const auto & nodeIt : nodes) 177 | nodeList.push_back(nodeIt.second.ToNodeList()); 178 | BridgeList::CopyData(&out.nodes, nodeList); 179 | return std::move(out); 180 | } 181 | }; 182 | 183 | #endif //_MSC_VER 184 | #endif //__cplusplus 185 | 186 | #endif //_GRAPH_H -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/pluginsdk/bridgemain.h: -------------------------------------------------------------------------------- 1 | #ifndef _BRIDGEMAIN_H_ 2 | #define _BRIDGEMAIN_H_ 3 | 4 | #include 5 | 6 | #ifndef __cplusplus 7 | #include 8 | #define DEFAULT_PARAM(name, value) name 9 | #else 10 | #define DEFAULT_PARAM(name, value) name = value 11 | #endif 12 | 13 | //default structure alignments forced 14 | #ifdef _WIN64 15 | #pragma pack(push, 16) 16 | #else //x86 17 | #pragma pack(push, 8) 18 | #endif //_WIN64 19 | 20 | #ifdef _WIN64 21 | typedef unsigned long long duint; 22 | typedef signed long long dsint; 23 | #else 24 | typedef unsigned long duint; 25 | typedef signed long dsint; 26 | #endif //_WIN64 27 | 28 | #ifndef BRIDGE_IMPEXP 29 | #ifdef BUILD_BRIDGE 30 | #define BRIDGE_IMPEXP __declspec(dllexport) 31 | #else 32 | #define BRIDGE_IMPEXP __declspec(dllimport) 33 | #endif //BUILD_BRIDGE 34 | #endif //BRIDGE_IMPEXP 35 | 36 | #ifdef __cplusplus 37 | extern "C" 38 | { 39 | #endif 40 | 41 | //Bridge defines 42 | #define MAX_SETTING_SIZE 65536 43 | #define DBG_VERSION 25 44 | 45 | //Bridge functions 46 | 47 | /// 48 | /// Initialize the bridge. 49 | /// 50 | /// On error it returns a non-null error message. 51 | BRIDGE_IMPEXP const wchar_t* BridgeInit(); 52 | 53 | /// 54 | /// Start the bridge. 55 | /// 56 | /// On error it returns a non-null error message. 57 | BRIDGE_IMPEXP const wchar_t* BridgeStart(); 58 | 59 | /// 60 | /// Allocate buffer. Use BridgeFree to free the buffer. 61 | /// 62 | /// Size in bytes of the buffer to allocate. 63 | /// A pointer to the allocated buffer. This function will trigger a crash dump if unsuccessful. 64 | BRIDGE_IMPEXP void* BridgeAlloc(size_t size); 65 | 66 | /// 67 | /// Free buffer allocated by BridgeAlloc. 68 | /// 69 | /// Buffer to free. 70 | BRIDGE_IMPEXP void BridgeFree(void* ptr); 71 | 72 | /// 73 | /// Get a string setting from the in-memory setting store. 74 | /// 75 | /// Section the setting is in. Cannot be null. 76 | /// Setting key (name). Cannot be null. 77 | /// Output buffer for the value. Should be of MAX_SETTING_SIZE. Cannot be null. 78 | /// True if the setting was found and copied in the value parameter. 79 | BRIDGE_IMPEXP bool BridgeSettingGet(const char* section, const char* key, char* value); 80 | 81 | /// 82 | /// Get an integer setting from the in-memory setting store. 83 | /// 84 | /// Section the setting is in. Cannot be null. 85 | /// Setting key (name). Cannot be null. 86 | /// Output value. 87 | /// True if the setting was found and successfully converted to an integer. 88 | BRIDGE_IMPEXP bool BridgeSettingGetUint(const char* section, const char* key, duint* value); 89 | 90 | /// 91 | /// Set a string setting in the in-memory setting store. 92 | /// 93 | /// Section the setting is in. Cannot be null. 94 | /// Setting key (name). Set to null to clear the whole section. 95 | /// New setting value. Set to null to remove the key from the section. 96 | /// True if the operation was successful. 97 | BRIDGE_IMPEXP bool BridgeSettingSet(const char* section, const char* key, const char* value); 98 | 99 | /// 100 | /// Set an integer setting in the in-memory setting store. 101 | /// 102 | /// Section the setting is in. Cannot be null. 103 | /// Setting key (name). Set to null to clear the whole section. 104 | /// New setting value. 105 | /// True if the operation was successful. 106 | BRIDGE_IMPEXP bool BridgeSettingSetUint(const char* section, const char* key, duint value); 107 | 108 | /// 109 | /// Flush the in-memory setting store to disk. 110 | /// 111 | /// 112 | BRIDGE_IMPEXP bool BridgeSettingFlush(); 113 | 114 | /// 115 | /// Read the in-memory setting store from disk. 116 | /// 117 | /// Line where the error occurred. Set to null to ignore this. 118 | /// True if the setting were read and parsed correctly. 119 | BRIDGE_IMPEXP bool BridgeSettingRead(int* errorLine); 120 | 121 | /// 122 | /// Get the debugger version. 123 | /// 124 | /// 25 125 | BRIDGE_IMPEXP int BridgeGetDbgVersion(); 126 | 127 | /// 128 | /// Checks if the current process is elevated. 129 | /// 130 | /// true if the process is elevated, false otherwise. 131 | BRIDGE_IMPEXP bool BridgeIsProcessElevated(); 132 | 133 | #ifdef __cplusplus 134 | } 135 | #endif 136 | 137 | //list structure (and C++ wrapper) 138 | #include "bridgelist.h" 139 | 140 | #include "bridgegraph.h" 141 | 142 | #ifdef __cplusplus 143 | extern "C" 144 | { 145 | #endif 146 | 147 | //Debugger defines 148 | #define MAX_LABEL_SIZE 256 149 | #define MAX_COMMENT_SIZE 512 150 | #define MAX_MODULE_SIZE 256 151 | #define MAX_IMPORT_SIZE 65536 152 | #define MAX_BREAKPOINT_SIZE 256 153 | #define MAX_CONDITIONAL_EXPR_SIZE 256 154 | #define MAX_CONDITIONAL_TEXT_SIZE 256 155 | #define MAX_SCRIPT_LINE_SIZE 2048 156 | #define MAX_THREAD_NAME_SIZE 256 157 | #define MAX_WATCH_NAME_SIZE 256 158 | #define MAX_STRING_SIZE 512 159 | #define MAX_ERROR_SIZE 512 160 | #define RIGHTS_STRING_SIZE (sizeof("ERWCG") + 1) 161 | #define MAX_SECTION_SIZE 10 162 | #define MAX_COMMAND_LINE_SIZE 256 163 | #define MAX_MNEMONIC_SIZE 64 164 | #define PAGE_SIZE 0x1000 165 | 166 | //Debugger enums 167 | typedef enum 168 | { 169 | initialized, 170 | paused, 171 | running, 172 | stopped 173 | } DBGSTATE; 174 | 175 | typedef enum 176 | { 177 | SEG_DEFAULT, 178 | SEG_ES, 179 | SEG_DS, 180 | SEG_FS, 181 | SEG_GS, 182 | SEG_CS, 183 | SEG_SS 184 | } SEGMENTREG; 185 | 186 | typedef enum 187 | { 188 | flagmodule = 0x1, 189 | flaglabel = 0x2, 190 | flagcomment = 0x4, 191 | flagbookmark = 0x8, 192 | flagfunction = 0x10, 193 | flagloop = 0x20, 194 | flagargs = 0x40, 195 | flagNoFuncOffset = 0x80 196 | } ADDRINFOFLAGS; 197 | 198 | typedef enum 199 | { 200 | bp_none = 0, 201 | bp_normal = 1, 202 | bp_hardware = 2, 203 | bp_memory = 4, 204 | bp_dll = 8, 205 | bp_exception = 16 206 | } BPXTYPE; 207 | 208 | typedef enum 209 | { 210 | FUNC_NONE, 211 | FUNC_BEGIN, 212 | FUNC_MIDDLE, 213 | FUNC_END, 214 | FUNC_SINGLE 215 | } FUNCTYPE; 216 | 217 | typedef enum 218 | { 219 | LOOP_NONE, 220 | LOOP_BEGIN, 221 | LOOP_MIDDLE, 222 | LOOP_ENTRY, 223 | LOOP_END, 224 | LOOP_SINGLE 225 | } LOOPTYPE; 226 | 227 | //order by most important type last 228 | typedef enum 229 | { 230 | XREF_NONE, 231 | XREF_DATA, 232 | XREF_JMP, 233 | XREF_CALL 234 | } XREFTYPE; 235 | 236 | typedef enum 237 | { 238 | ARG_NONE, 239 | ARG_BEGIN, 240 | ARG_MIDDLE, 241 | ARG_END, 242 | ARG_SINGLE 243 | } ARGTYPE; 244 | 245 | typedef enum 246 | { 247 | DBG_SCRIPT_LOAD, // param1=const char* filename, param2=unused 248 | DBG_SCRIPT_UNLOAD, // param1=unused, param2=unused 249 | DBG_SCRIPT_RUN, // param1=int destline, param2=unused 250 | DBG_SCRIPT_STEP, // param1=unused, param2=unused 251 | DBG_SCRIPT_BPTOGGLE, // param1=int line, param2=unused 252 | DBG_SCRIPT_BPGET, // param1=int line, param2=unused 253 | DBG_SCRIPT_CMDEXEC, // param1=const char* command, param2=unused 254 | DBG_SCRIPT_ABORT, // param1=unused, param2=unused 255 | DBG_SCRIPT_GETLINETYPE, // param1=int line, param2=unused 256 | DBG_SCRIPT_SETIP, // param1=int line, param2=unused 257 | DBG_SCRIPT_GETBRANCHINFO, // param1=int line, param2=SCRIPTBRANCH* info 258 | DBG_SYMBOL_ENUM, // param1=SYMBOLCBINFO* cbInfo, param2=unused 259 | DBG_ASSEMBLE_AT, // param1=duint addr, param2=const char* instruction 260 | DBG_MODBASE_FROM_NAME, // param1=const char* modname, param2=unused 261 | DBG_DISASM_AT, // param1=duint addr, param2=DISASM_INSTR* instr 262 | DBG_STACK_COMMENT_GET, // param1=duint addr, param2=STACK_COMMENT* comment 263 | DBG_GET_THREAD_LIST, // param1=THREADALLINFO* list, param2=unused 264 | DBG_SETTINGS_UPDATED, // param1=unused, param2=unused 265 | DBG_DISASM_FAST_AT, // param1=duint addr, param2=BASIC_INSTRUCTION_INFO* basicinfo 266 | DBG_MENU_ENTRY_CLICKED, // param1=int hEntry, param2=unused 267 | DBG_FUNCTION_GET, // param1=FUNCTION_LOOP_INFO* info, param2=unused 268 | DBG_FUNCTION_OVERLAPS, // param1=FUNCTION_LOOP_INFO* info, param2=unused 269 | DBG_FUNCTION_ADD, // param1=FUNCTION_LOOP_INFO* info, param2=unused 270 | DBG_FUNCTION_DEL, // param1=FUNCTION_LOOP_INFO* info, param2=unused 271 | DBG_LOOP_GET, // param1=FUNCTION_LOOP_INFO* info, param2=unused 272 | DBG_LOOP_OVERLAPS, // param1=FUNCTION_LOOP_INFO* info, param2=unused 273 | DBG_LOOP_ADD, // param1=FUNCTION_LOOP_INFO* info, param2=unused 274 | DBG_LOOP_DEL, // param1=FUNCTION_LOOP_INFO* info, param2=unused 275 | DBG_IS_RUN_LOCKED, // param1=unused, param2=unused 276 | DBG_IS_BP_DISABLED, // param1=duint addr, param2=unused 277 | DBG_SET_AUTO_COMMENT_AT, // param1=duint addr, param2=const char* text 278 | DBG_DELETE_AUTO_COMMENT_RANGE, // param1=duint start, param2=duint end 279 | DBG_SET_AUTO_LABEL_AT, // param1=duint addr, param2=const char* text 280 | DBG_DELETE_AUTO_LABEL_RANGE, // param1=duint start, param2=duint end 281 | DBG_SET_AUTO_BOOKMARK_AT, // param1=duint addr, param2=const char* text 282 | DBG_DELETE_AUTO_BOOKMARK_RANGE, // param1=duint start, param2=duint end 283 | DBG_SET_AUTO_FUNCTION_AT, // param1=duint addr, param2=const char* text 284 | DBG_DELETE_AUTO_FUNCTION_RANGE, // param1=duint start, param2=duint end 285 | DBG_GET_STRING_AT, // param1=duint addr, param2=unused 286 | DBG_GET_FUNCTIONS, // param1=unused, param2=unused 287 | DBG_WIN_EVENT, // param1=MSG* message, param2=long* result 288 | DBG_WIN_EVENT_GLOBAL, // param1=MSG* message, param2=unused 289 | DBG_INITIALIZE_LOCKS, // param1=unused, param2=unused 290 | DBG_DEINITIALIZE_LOCKS, // param1=unused, param2=unused 291 | DBG_GET_TIME_WASTED_COUNTER, // param1=unused, param2=unused 292 | DBG_SYMBOL_ENUM_FROMCACHE, // param1=SYMBOLCBINFO* cbInfo, param2=unused 293 | DBG_DELETE_COMMENT_RANGE, // param1=duint start, param2=duint end 294 | DBG_DELETE_LABEL_RANGE, // param1=duint start, param2=duint end 295 | DBG_DELETE_BOOKMARK_RANGE, // param1=duint start, param2=duint end 296 | DBG_GET_XREF_COUNT_AT, // param1=duint addr, param2=unused 297 | DBG_GET_XREF_TYPE_AT, // param1=duint addr, param2=unused 298 | DBG_XREF_ADD, // param1=duint addr, param2=duint from 299 | DBG_XREF_DEL_ALL, // param1=duint addr, param2=unused 300 | DBG_XREF_GET, // param1=duint addr, param2=XREF_INFO* info 301 | DBG_GET_ENCODE_TYPE_BUFFER, // param1=duint addr, param2=unused 302 | DBG_ENCODE_TYPE_GET, // param1=duint addr, param2=duint size 303 | DBG_DELETE_ENCODE_TYPE_RANGE, // param1=duint start, param2=duint end 304 | DBG_ENCODE_SIZE_GET, // param1=duint addr, param2=duint codesize 305 | DBG_DELETE_ENCODE_TYPE_SEG, // param1=duint addr, param2=unused 306 | DBG_RELEASE_ENCODE_TYPE_BUFFER, // param1=void* buffer, param2=unused 307 | DBG_ARGUMENT_GET, // param1=FUNCTION* info, param2=unused 308 | DBG_ARGUMENT_OVERLAPS, // param1=FUNCTION* info, param2=unused 309 | DBG_ARGUMENT_ADD, // param1=FUNCTION* info, param2=unused 310 | DBG_ARGUMENT_DEL, // param1=FUNCTION* info, param2=unused 311 | DBG_GET_WATCH_LIST, // param1=ListOf(WATCHINFO), param2=unused 312 | DBG_SELCHANGED, // param1=hWindow, param2=VA 313 | DBG_GET_PROCESS_HANDLE, // param1=unused, param2=unused 314 | DBG_GET_THREAD_HANDLE, // param1=unused, param2=unused 315 | DBG_GET_PROCESS_ID, // param1=unused, param2=unused 316 | DBG_GET_THREAD_ID, // param1=unused, param2=unused 317 | DBG_GET_PEB_ADDRESS, // param1=DWORD ProcessId, param2=unused 318 | DBG_GET_TEB_ADDRESS, // param1=DWORD ThreadId, param2=unused 319 | DBG_ANALYZE_FUNCTION, // param1=BridgeCFGraphList* graph, param2=duint entry 320 | DBG_MENU_PREPARE, // param1=int hMenu, param2=unused 321 | DBG_GET_SYMBOL_INFO, // param1=void* symbol, param2=SYMBOLINFO* info 322 | DBG_GET_DEBUG_ENGINE, // param1=unused, param2-unused 323 | } DBGMSG; 324 | 325 | typedef enum 326 | { 327 | linecommand, 328 | linebranch, 329 | linelabel, 330 | linecomment, 331 | lineempty, 332 | } SCRIPTLINETYPE; 333 | 334 | typedef enum 335 | { 336 | scriptnobranch, 337 | scriptjmp, 338 | scriptjnejnz, 339 | scriptjejz, 340 | scriptjbjl, 341 | scriptjajg, 342 | scriptjbejle, 343 | scriptjaejge, 344 | scriptcall 345 | } SCRIPTBRANCHTYPE; 346 | 347 | typedef enum 348 | { 349 | instr_normal, 350 | instr_branch, 351 | instr_stack 352 | } DISASM_INSTRTYPE; 353 | 354 | typedef enum 355 | { 356 | arg_normal, 357 | arg_memory 358 | } DISASM_ARGTYPE; 359 | 360 | typedef enum 361 | { 362 | str_none, 363 | str_ascii, 364 | str_unicode 365 | } STRING_TYPE; 366 | 367 | typedef enum 368 | { 369 | _PriorityIdle = -15, 370 | _PriorityAboveNormal = 1, 371 | _PriorityBelowNormal = -1, 372 | _PriorityHighest = 2, 373 | _PriorityLowest = -2, 374 | _PriorityNormal = 0, 375 | _PriorityTimeCritical = 15, 376 | _PriorityUnknown = 0x7FFFFFFF 377 | } THREADPRIORITY; 378 | 379 | typedef enum 380 | { 381 | _Executive = 0, 382 | _FreePage = 1, 383 | _PageIn = 2, 384 | _PoolAllocation = 3, 385 | _DelayExecution = 4, 386 | _Suspended = 5, 387 | _UserRequest = 6, 388 | _WrExecutive = 7, 389 | _WrFreePage = 8, 390 | _WrPageIn = 9, 391 | _WrPoolAllocation = 10, 392 | _WrDelayExecution = 11, 393 | _WrSuspended = 12, 394 | _WrUserRequest = 13, 395 | _WrEventPair = 14, 396 | _WrQueue = 15, 397 | _WrLpcReceive = 16, 398 | _WrLpcReply = 17, 399 | _WrVirtualMemory = 18, 400 | _WrPageOut = 19, 401 | _WrRendezvous = 20, 402 | _Spare2 = 21, 403 | _Spare3 = 22, 404 | _Spare4 = 23, 405 | _Spare5 = 24, 406 | _WrCalloutStack = 25, 407 | _WrKernel = 26, 408 | _WrResource = 27, 409 | _WrPushLock = 28, 410 | _WrMutex = 29, 411 | _WrQuantumEnd = 30, 412 | _WrDispatchInt = 31, 413 | _WrPreempted = 32, 414 | _WrYieldExecution = 33, 415 | _WrFastMutex = 34, 416 | _WrGuardedMutex = 35, 417 | _WrRundown = 36, 418 | } THREADWAITREASON; 419 | 420 | typedef enum 421 | { 422 | size_byte = 1, 423 | size_word = 2, 424 | size_dword = 4, 425 | size_qword = 8, 426 | size_xmmword = 16, 427 | size_ymmword = 32 428 | } MEMORY_SIZE; 429 | 430 | typedef enum 431 | { 432 | enc_unknown, //must be 0 433 | enc_byte, //1 byte 434 | enc_word, //2 bytes 435 | enc_dword, //4 bytes 436 | enc_fword, //6 bytes 437 | enc_qword, //8 bytes 438 | enc_tbyte, //10 bytes 439 | enc_oword, //16 bytes 440 | enc_mmword, //8 bytes 441 | enc_xmmword, //16 bytes 442 | enc_ymmword, //32 bytes 443 | enc_zmmword, //64 bytes avx512 not supported 444 | enc_real4, //4 byte float 445 | enc_real8, //8 byte double 446 | enc_real10, //10 byte decimal 447 | enc_ascii, //ascii sequence 448 | enc_unicode, //unicode sequence 449 | enc_code, //start of code 450 | enc_junk, //junk code 451 | enc_middle //middle of data 452 | } ENCODETYPE; 453 | 454 | typedef enum 455 | { 456 | TYPE_UINT, // unsigned integer 457 | TYPE_INT, // signed integer 458 | TYPE_FLOAT,// single precision floating point value 459 | TYPE_ASCII, // ascii string 460 | TYPE_UNICODE, // unicode string 461 | TYPE_INVALID // invalid watch expression or data type 462 | } WATCHVARTYPE; 463 | 464 | typedef enum 465 | { 466 | MODE_DISABLED, // watchdog is disabled 467 | MODE_ISTRUE, // alert if expression is not 0 468 | MODE_ISFALSE, // alert if expression is 0 469 | MODE_CHANGED, // alert if expression is changed 470 | MODE_UNCHANGED // alert if expression is not changed 471 | } WATCHDOGMODE; 472 | 473 | typedef enum 474 | { 475 | hw_access, 476 | hw_write, 477 | hw_execute 478 | } BPHWTYPE; 479 | 480 | typedef enum 481 | { 482 | mem_access, 483 | mem_read, 484 | mem_write, 485 | mem_execute 486 | } BPMEMTYPE; 487 | 488 | typedef enum 489 | { 490 | dll_load = 1, 491 | dll_unload, 492 | dll_all 493 | } BPDLLTYPE; 494 | 495 | typedef enum 496 | { 497 | ex_firstchance = 1, 498 | ex_secondchance, 499 | ex_all 500 | } BPEXTYPE; 501 | 502 | typedef enum 503 | { 504 | hw_byte, 505 | hw_word, 506 | hw_dword, 507 | hw_qword 508 | } BPHWSIZE; 509 | 510 | typedef enum 511 | { 512 | sym_import, 513 | sym_export, 514 | sym_symbol 515 | } SYMBOLTYPE; 516 | 517 | typedef enum 518 | { 519 | mod_user, 520 | mod_system 521 | } MODULEPARTY; 522 | 523 | typedef enum 524 | { 525 | DebugEngineTitanEngine, 526 | DebugEngineGleeBug, 527 | DebugEngineStaticEngine, 528 | } DEBUG_ENGINE; 529 | 530 | //Debugger typedefs 531 | typedef MEMORY_SIZE VALUE_SIZE; 532 | 533 | typedef struct DBGFUNCTIONS_ DBGFUNCTIONS; 534 | 535 | typedef bool (*CBSYMBOLENUM)(const struct SYMBOLPTR_* symbol, void* user); 536 | 537 | //Debugger structs 538 | typedef struct 539 | { 540 | MEMORY_BASIC_INFORMATION mbi; 541 | char info[MAX_MODULE_SIZE]; 542 | } MEMPAGE; 543 | 544 | typedef struct 545 | { 546 | int count; 547 | MEMPAGE* page; 548 | } MEMMAP; 549 | 550 | typedef struct 551 | { 552 | BPXTYPE type; 553 | duint addr; 554 | bool enabled; 555 | bool singleshoot; 556 | bool active; 557 | char name[MAX_BREAKPOINT_SIZE]; 558 | char mod[MAX_MODULE_SIZE]; 559 | unsigned short slot; 560 | // extended part 561 | unsigned char typeEx; //BPHWTYPE/BPMEMTYPE/BPDLLTYPE/BPEXTYPE 562 | unsigned char hwSize; //BPHWSIZE 563 | unsigned int hitCount; 564 | bool fastResume; 565 | bool silent; 566 | char breakCondition[MAX_CONDITIONAL_EXPR_SIZE]; 567 | char logText[MAX_CONDITIONAL_TEXT_SIZE]; 568 | char logCondition[MAX_CONDITIONAL_EXPR_SIZE]; 569 | char commandText[MAX_CONDITIONAL_TEXT_SIZE]; 570 | char commandCondition[MAX_CONDITIONAL_EXPR_SIZE]; 571 | } BRIDGEBP; 572 | 573 | typedef struct 574 | { 575 | int count; 576 | BRIDGEBP* bp; 577 | } BPMAP; 578 | 579 | typedef struct 580 | { 581 | char WatchName[MAX_WATCH_NAME_SIZE]; 582 | char Expression[MAX_CONDITIONAL_EXPR_SIZE]; 583 | unsigned int window; 584 | unsigned int id; 585 | WATCHVARTYPE varType; 586 | WATCHDOGMODE watchdogMode; 587 | duint value; 588 | bool watchdogTriggered; 589 | } WATCHINFO; 590 | 591 | typedef struct 592 | { 593 | duint start; //OUT 594 | duint end; //OUT 595 | duint instrcount; //OUT 596 | } FUNCTION; 597 | 598 | typedef struct 599 | { 600 | int depth; //IN 601 | duint start; //OUT 602 | duint end; //OUT 603 | duint instrcount; //OUT 604 | } LOOP; 605 | 606 | typedef struct 607 | { 608 | int flags; //ADDRINFOFLAGS (IN) 609 | char module[MAX_MODULE_SIZE]; //module the address is in 610 | char label[MAX_LABEL_SIZE]; 611 | char comment[MAX_COMMENT_SIZE]; 612 | bool isbookmark; 613 | FUNCTION function; 614 | LOOP loop; 615 | FUNCTION args; 616 | } BRIDGE_ADDRINFO; 617 | 618 | typedef struct SYMBOLINFO_ 619 | { 620 | duint addr; 621 | char* decoratedSymbol; 622 | char* undecoratedSymbol; 623 | SYMBOLTYPE type; 624 | bool freeDecorated; 625 | bool freeUndecorated; 626 | DWORD ordinal; 627 | } SYMBOLINFO; 628 | 629 | typedef struct 630 | { 631 | duint base; 632 | char name[MAX_MODULE_SIZE]; 633 | } SYMBOLMODULEINFO; 634 | 635 | typedef struct 636 | { 637 | duint base; 638 | CBSYMBOLENUM cbSymbolEnum; 639 | void* user; 640 | } SYMBOLCBINFO; 641 | 642 | typedef struct 643 | { 644 | bool c; 645 | bool p; 646 | bool a; 647 | bool z; 648 | bool s; 649 | bool t; 650 | bool i; 651 | bool d; 652 | bool o; 653 | } FLAGS; 654 | 655 | typedef struct 656 | { 657 | bool FZ; 658 | bool PM; 659 | bool UM; 660 | bool OM; 661 | bool ZM; 662 | bool IM; 663 | bool DM; 664 | bool DAZ; 665 | bool PE; 666 | bool UE; 667 | bool OE; 668 | bool ZE; 669 | bool DE; 670 | bool IE; 671 | 672 | unsigned short RC; 673 | } MXCSRFIELDS; 674 | 675 | typedef struct 676 | { 677 | bool B; 678 | bool C3; 679 | bool C2; 680 | bool C1; 681 | bool C0; 682 | bool ES; 683 | bool SF; 684 | bool P; 685 | bool U; 686 | bool O; 687 | bool Z; 688 | bool D; 689 | bool I; 690 | 691 | unsigned short TOP; 692 | 693 | } X87STATUSWORDFIELDS; 694 | 695 | typedef struct 696 | { 697 | bool IC; 698 | bool IEM; 699 | bool PM; 700 | bool UM; 701 | bool OM; 702 | bool ZM; 703 | bool DM; 704 | bool IM; 705 | 706 | unsigned short RC; 707 | unsigned short PC; 708 | 709 | } X87CONTROLWORDFIELDS; 710 | 711 | typedef struct DECLSPEC_ALIGN(16) _XMMREGISTER 712 | { 713 | ULONGLONG Low; 714 | LONGLONG High; 715 | } XMMREGISTER; 716 | 717 | typedef struct 718 | { 719 | XMMREGISTER Low; //XMM/SSE part 720 | XMMREGISTER High; //AVX part 721 | } YMMREGISTER; 722 | 723 | typedef struct 724 | { 725 | BYTE data[10]; 726 | int st_value; 727 | int tag; 728 | } X87FPUREGISTER; 729 | 730 | typedef struct 731 | { 732 | WORD ControlWord; 733 | WORD StatusWord; 734 | WORD TagWord; 735 | DWORD ErrorOffset; 736 | DWORD ErrorSelector; 737 | DWORD DataOffset; 738 | DWORD DataSelector; 739 | DWORD Cr0NpxState; 740 | } X87FPU; 741 | 742 | typedef struct 743 | { 744 | ULONG_PTR cax; 745 | ULONG_PTR ccx; 746 | ULONG_PTR cdx; 747 | ULONG_PTR cbx; 748 | ULONG_PTR csp; 749 | ULONG_PTR cbp; 750 | ULONG_PTR csi; 751 | ULONG_PTR cdi; 752 | #ifdef _WIN64 753 | ULONG_PTR r8; 754 | ULONG_PTR r9; 755 | ULONG_PTR r10; 756 | ULONG_PTR r11; 757 | ULONG_PTR r12; 758 | ULONG_PTR r13; 759 | ULONG_PTR r14; 760 | ULONG_PTR r15; 761 | #endif //_WIN64 762 | ULONG_PTR cip; 763 | ULONG_PTR eflags; 764 | unsigned short gs; 765 | unsigned short fs; 766 | unsigned short es; 767 | unsigned short ds; 768 | unsigned short cs; 769 | unsigned short ss; 770 | ULONG_PTR dr0; 771 | ULONG_PTR dr1; 772 | ULONG_PTR dr2; 773 | ULONG_PTR dr3; 774 | ULONG_PTR dr6; 775 | ULONG_PTR dr7; 776 | BYTE RegisterArea[80]; 777 | X87FPU x87fpu; 778 | DWORD MxCsr; 779 | #ifdef _WIN64 780 | XMMREGISTER XmmRegisters[16]; 781 | YMMREGISTER YmmRegisters[16]; 782 | #else // x86 783 | XMMREGISTER XmmRegisters[8]; 784 | YMMREGISTER YmmRegisters[8]; 785 | #endif 786 | } REGISTERCONTEXT; 787 | 788 | typedef struct 789 | { 790 | DWORD code; 791 | char name[128]; 792 | } LASTERROR; 793 | 794 | typedef struct 795 | { 796 | DWORD code; 797 | char name[128]; 798 | } LASTSTATUS; 799 | 800 | typedef struct 801 | { 802 | REGISTERCONTEXT regcontext; 803 | FLAGS flags; 804 | X87FPUREGISTER x87FPURegisters[8]; 805 | unsigned long long mmx[8]; 806 | MXCSRFIELDS MxCsrFields; 807 | X87STATUSWORDFIELDS x87StatusWordFields; 808 | X87CONTROLWORDFIELDS x87ControlWordFields; 809 | LASTERROR lastError; 810 | LASTSTATUS lastStatus; 811 | } REGDUMP; 812 | 813 | typedef struct 814 | { 815 | DISASM_ARGTYPE type; //normal/memory 816 | SEGMENTREG segment; 817 | char mnemonic[64]; 818 | duint constant; //constant in the instruction (imm/disp) 819 | duint value; //equal to constant or equal to the register value 820 | duint memvalue; //memsize:[value] 821 | } DISASM_ARG; 822 | 823 | typedef struct 824 | { 825 | char instruction[64]; 826 | DISASM_INSTRTYPE type; 827 | int argcount; 828 | int instr_size; 829 | DISASM_ARG arg[3]; 830 | } DISASM_INSTR; 831 | 832 | typedef struct 833 | { 834 | char color[8]; //hex color-code 835 | char comment[MAX_COMMENT_SIZE]; 836 | } STACK_COMMENT; 837 | 838 | typedef struct 839 | { 840 | int ThreadNumber; 841 | HANDLE Handle; 842 | DWORD ThreadId; 843 | duint ThreadStartAddress; 844 | duint ThreadLocalBase; 845 | char threadName[MAX_THREAD_NAME_SIZE]; 846 | } THREADINFO; 847 | 848 | typedef struct 849 | { 850 | THREADINFO BasicInfo; 851 | duint ThreadCip; 852 | DWORD SuspendCount; 853 | THREADPRIORITY Priority; 854 | THREADWAITREASON WaitReason; 855 | DWORD LastError; 856 | FILETIME UserTime; 857 | FILETIME KernelTime; 858 | FILETIME CreationTime; 859 | ULONG64 Cycles; // Windows Vista or greater 860 | } THREADALLINFO; 861 | 862 | typedef struct 863 | { 864 | int count; 865 | THREADALLINFO* list; 866 | int CurrentThread; 867 | } THREADLIST; 868 | 869 | typedef struct 870 | { 871 | duint value; //displacement / addrvalue (rip-relative) 872 | MEMORY_SIZE size; //byte/word/dword/qword 873 | char mnemonic[MAX_MNEMONIC_SIZE]; 874 | } MEMORY_INFO; 875 | 876 | typedef struct 877 | { 878 | duint value; 879 | VALUE_SIZE size; 880 | } VALUE_INFO; 881 | 882 | //definitions for BASIC_INSTRUCTION_INFO.type 883 | #define TYPE_VALUE 1 884 | #define TYPE_MEMORY 2 885 | #define TYPE_ADDR 4 886 | 887 | typedef struct 888 | { 889 | DWORD type; //value|memory|addr 890 | VALUE_INFO value; //immediat 891 | MEMORY_INFO memory; 892 | duint addr; //addrvalue (jumps + calls) 893 | bool branch; //jumps/calls 894 | bool call; //instruction is a call 895 | int size; 896 | char instruction[MAX_MNEMONIC_SIZE * 4]; 897 | } BASIC_INSTRUCTION_INFO; 898 | 899 | typedef struct 900 | { 901 | SCRIPTBRANCHTYPE type; 902 | int dest; 903 | char branchlabel[256]; 904 | } SCRIPTBRANCH; 905 | 906 | typedef struct 907 | { 908 | duint addr; 909 | duint start; 910 | duint end; 911 | bool manual; 912 | int depth; 913 | } FUNCTION_LOOP_INFO; 914 | 915 | typedef struct 916 | { 917 | duint addr; 918 | XREFTYPE type; 919 | } XREF_RECORD; 920 | 921 | typedef struct 922 | { 923 | duint refcount; 924 | XREF_RECORD* references; 925 | } XREF_INFO; 926 | 927 | typedef struct SYMBOLPTR_ 928 | { 929 | duint modbase; 930 | const void* symbol; 931 | } SYMBOLPTR; 932 | 933 | //Debugger functions 934 | BRIDGE_IMPEXP const char* DbgInit(); 935 | BRIDGE_IMPEXP void DbgExit(); 936 | BRIDGE_IMPEXP bool DbgMemRead(duint va, void* dest, duint size); 937 | BRIDGE_IMPEXP bool DbgMemWrite(duint va, const void* src, duint size); 938 | BRIDGE_IMPEXP duint DbgMemGetPageSize(duint base); 939 | BRIDGE_IMPEXP duint DbgMemFindBaseAddr(duint addr, duint* size); 940 | 941 | /// 942 | /// Asynchronously execute a debugger command by adding it to the command queue. 943 | /// Note: the command may not have completed before this call returns. Use this 944 | /// function if you don't care when the command gets executed. 945 | /// 946 | /// Example: DbgCmdExec("ClearLog") 947 | /// 948 | /// The command to execute. 949 | /// True if the command was successfully submitted to the command queue. False if the submission failed. 950 | BRIDGE_IMPEXP bool DbgCmdExec(const char* cmd); 951 | 952 | /// 953 | /// Performs synchronous execution of a debugger command. This function call only 954 | /// returns after the command has completed. 955 | /// 956 | /// Example: DbgCmdExecDirect("loadlib advapi32.dll") 957 | /// 958 | /// The command to execute. 959 | /// True if the command executed successfully, False if there was a problem. 960 | BRIDGE_IMPEXP bool DbgCmdExecDirect(const char* cmd); 961 | BRIDGE_IMPEXP bool DbgMemMap(MEMMAP* memmap); 962 | BRIDGE_IMPEXP bool DbgIsValidExpression(const char* expression); 963 | BRIDGE_IMPEXP bool DbgIsDebugging(); 964 | BRIDGE_IMPEXP bool DbgIsJumpGoingToExecute(duint addr); 965 | BRIDGE_IMPEXP bool DbgGetLabelAt(duint addr, SEGMENTREG segment, char* text); 966 | BRIDGE_IMPEXP bool DbgSetLabelAt(duint addr, const char* text); 967 | BRIDGE_IMPEXP void DbgClearLabelRange(duint start, duint end); 968 | BRIDGE_IMPEXP bool DbgGetCommentAt(duint addr, char* text); 969 | BRIDGE_IMPEXP bool DbgSetCommentAt(duint addr, const char* text); 970 | BRIDGE_IMPEXP void DbgClearCommentRange(duint start, duint end); 971 | BRIDGE_IMPEXP bool DbgGetBookmarkAt(duint addr); 972 | BRIDGE_IMPEXP bool DbgSetBookmarkAt(duint addr, bool isbookmark); 973 | BRIDGE_IMPEXP void DbgClearBookmarkRange(duint start, duint end); 974 | BRIDGE_IMPEXP bool DbgGetModuleAt(duint addr, char* text); 975 | BRIDGE_IMPEXP BPXTYPE DbgGetBpxTypeAt(duint addr); 976 | BRIDGE_IMPEXP duint DbgValFromString(const char* string); 977 | BRIDGE_IMPEXP bool DbgGetRegDumpEx(REGDUMP* regdump, size_t size); 978 | BRIDGE_IMPEXP bool DbgValToString(const char* string, duint value); 979 | BRIDGE_IMPEXP bool DbgMemIsValidReadPtr(duint addr); 980 | BRIDGE_IMPEXP int DbgGetBpList(BPXTYPE type, BPMAP* list); 981 | BRIDGE_IMPEXP FUNCTYPE DbgGetFunctionTypeAt(duint addr); 982 | BRIDGE_IMPEXP LOOPTYPE DbgGetLoopTypeAt(duint addr, int depth); 983 | BRIDGE_IMPEXP duint DbgGetBranchDestination(duint addr); 984 | BRIDGE_IMPEXP void DbgScriptLoad(const char* filename); 985 | BRIDGE_IMPEXP void DbgScriptUnload(); 986 | BRIDGE_IMPEXP void DbgScriptRun(int destline); 987 | BRIDGE_IMPEXP void DbgScriptStep(); 988 | BRIDGE_IMPEXP bool DbgScriptBpToggle(int line); 989 | BRIDGE_IMPEXP bool DbgScriptBpGet(int line); 990 | BRIDGE_IMPEXP bool DbgScriptCmdExec(const char* command); 991 | BRIDGE_IMPEXP void DbgScriptAbort(); 992 | BRIDGE_IMPEXP SCRIPTLINETYPE DbgScriptGetLineType(int line); 993 | BRIDGE_IMPEXP void DbgScriptSetIp(int line); 994 | BRIDGE_IMPEXP bool DbgScriptGetBranchInfo(int line, SCRIPTBRANCH* info); 995 | BRIDGE_IMPEXP void DbgSymbolEnum(duint base, CBSYMBOLENUM cbSymbolEnum, void* user); 996 | BRIDGE_IMPEXP void DbgSymbolEnumFromCache(duint base, CBSYMBOLENUM cbSymbolEnum, void* user); 997 | BRIDGE_IMPEXP bool DbgAssembleAt(duint addr, const char* instruction); 998 | BRIDGE_IMPEXP duint DbgModBaseFromName(const char* name); 999 | BRIDGE_IMPEXP void DbgDisasmAt(duint addr, DISASM_INSTR* instr); 1000 | BRIDGE_IMPEXP bool DbgStackCommentGet(duint addr, STACK_COMMENT* comment); 1001 | BRIDGE_IMPEXP void DbgGetThreadList(THREADLIST* list); 1002 | BRIDGE_IMPEXP void DbgSettingsUpdated(); 1003 | BRIDGE_IMPEXP void DbgDisasmFastAt(duint addr, BASIC_INSTRUCTION_INFO* basicinfo); 1004 | BRIDGE_IMPEXP void DbgMenuEntryClicked(int hEntry); 1005 | BRIDGE_IMPEXP bool DbgFunctionGet(duint addr, duint* start, duint* end); 1006 | BRIDGE_IMPEXP bool DbgFunctionOverlaps(duint start, duint end); 1007 | BRIDGE_IMPEXP bool DbgFunctionAdd(duint start, duint end); 1008 | BRIDGE_IMPEXP bool DbgFunctionDel(duint addr); 1009 | BRIDGE_IMPEXP bool DbgArgumentGet(duint addr, duint* start, duint* end); 1010 | BRIDGE_IMPEXP bool DbgArgumentOverlaps(duint start, duint end); 1011 | BRIDGE_IMPEXP bool DbgArgumentAdd(duint start, duint end); 1012 | BRIDGE_IMPEXP bool DbgArgumentDel(duint addr); 1013 | BRIDGE_IMPEXP bool DbgLoopGet(int depth, duint addr, duint* start, duint* end); 1014 | BRIDGE_IMPEXP bool DbgLoopOverlaps(int depth, duint start, duint end); 1015 | BRIDGE_IMPEXP bool DbgLoopAdd(duint start, duint end); 1016 | BRIDGE_IMPEXP bool DbgLoopDel(int depth, duint addr); 1017 | BRIDGE_IMPEXP bool DbgXrefAdd(duint addr, duint from); 1018 | BRIDGE_IMPEXP bool DbgXrefDelAll(duint addr); 1019 | BRIDGE_IMPEXP bool DbgXrefGet(duint addr, XREF_INFO* info); 1020 | BRIDGE_IMPEXP size_t DbgGetXrefCountAt(duint addr); 1021 | BRIDGE_IMPEXP XREFTYPE DbgGetXrefTypeAt(duint addr); 1022 | BRIDGE_IMPEXP bool DbgIsRunLocked(); 1023 | BRIDGE_IMPEXP bool DbgIsBpDisabled(duint addr); 1024 | BRIDGE_IMPEXP bool DbgSetAutoCommentAt(duint addr, const char* text); 1025 | BRIDGE_IMPEXP void DbgClearAutoCommentRange(duint start, duint end); 1026 | BRIDGE_IMPEXP bool DbgSetAutoLabelAt(duint addr, const char* text); 1027 | BRIDGE_IMPEXP void DbgClearAutoLabelRange(duint start, duint end); 1028 | BRIDGE_IMPEXP bool DbgSetAutoBookmarkAt(duint addr); 1029 | BRIDGE_IMPEXP void DbgClearAutoBookmarkRange(duint start, duint end); 1030 | BRIDGE_IMPEXP bool DbgSetAutoFunctionAt(duint start, duint end); 1031 | BRIDGE_IMPEXP void DbgClearAutoFunctionRange(duint start, duint end); 1032 | BRIDGE_IMPEXP bool DbgGetStringAt(duint addr, char* text); 1033 | BRIDGE_IMPEXP const DBGFUNCTIONS* DbgFunctions(); 1034 | BRIDGE_IMPEXP bool DbgWinEvent(MSG* message, long* result); 1035 | BRIDGE_IMPEXP bool DbgWinEventGlobal(MSG* message); 1036 | BRIDGE_IMPEXP bool DbgIsRunning(); 1037 | BRIDGE_IMPEXP duint DbgGetTimeWastedCounter(); 1038 | BRIDGE_IMPEXP ARGTYPE DbgGetArgTypeAt(duint addr); 1039 | BRIDGE_IMPEXP void* DbgGetEncodeTypeBuffer(duint addr, duint* size); 1040 | BRIDGE_IMPEXP void DbgReleaseEncodeTypeBuffer(void* buffer); 1041 | BRIDGE_IMPEXP ENCODETYPE DbgGetEncodeTypeAt(duint addr, duint size); 1042 | BRIDGE_IMPEXP duint DbgGetEncodeSizeAt(duint addr, duint codesize); 1043 | BRIDGE_IMPEXP bool DbgSetEncodeType(duint addr, duint size, ENCODETYPE type); 1044 | BRIDGE_IMPEXP void DbgDelEncodeTypeRange(duint start, duint end); 1045 | BRIDGE_IMPEXP void DbgDelEncodeTypeSegment(duint start); 1046 | BRIDGE_IMPEXP bool DbgGetWatchList(ListOf(WATCHINFO) list); 1047 | BRIDGE_IMPEXP void DbgSelChanged(int hWindow, duint VA); 1048 | BRIDGE_IMPEXP HANDLE DbgGetProcessHandle(); 1049 | BRIDGE_IMPEXP HANDLE DbgGetThreadHandle(); 1050 | BRIDGE_IMPEXP DWORD DbgGetProcessId(); 1051 | BRIDGE_IMPEXP DWORD DbgGetThreadId(); 1052 | BRIDGE_IMPEXP duint DbgGetPebAddress(DWORD ProcessId); 1053 | BRIDGE_IMPEXP duint DbgGetTebAddress(DWORD ThreadId); 1054 | BRIDGE_IMPEXP bool DbgAnalyzeFunction(duint entry, BridgeCFGraphList* graph); 1055 | BRIDGE_IMPEXP duint DbgEval(const char* expression, bool* DEFAULT_PARAM(success, nullptr)); 1056 | BRIDGE_IMPEXP void DbgGetSymbolInfo(const SYMBOLPTR* symbolptr, SYMBOLINFO* info); 1057 | BRIDGE_IMPEXP DEBUG_ENGINE DbgGetDebugEngine(); 1058 | 1059 | //Gui defines 1060 | typedef enum 1061 | { 1062 | GUI_PLUGIN_MENU, 1063 | GUI_DISASM_MENU, 1064 | GUI_DUMP_MENU, 1065 | GUI_STACK_MENU, 1066 | GUI_GRAPH_MENU, 1067 | GUI_MEMMAP_MENU, 1068 | GUI_SYMMOD_MENU, 1069 | } GUIMENUTYPE; 1070 | 1071 | BRIDGE_IMPEXP void DbgMenuPrepare(GUIMENUTYPE hMenu); 1072 | 1073 | typedef enum 1074 | { 1075 | GUI_DISASSEMBLY, 1076 | GUI_DUMP, 1077 | GUI_STACK, 1078 | GUI_GRAPH, 1079 | GUI_MEMMAP, 1080 | GUI_SYMMOD, 1081 | } GUISELECTIONTYPE; 1082 | 1083 | #define GUI_MAX_LINE_SIZE 65536 1084 | #define GUI_MAX_DISASSEMBLY_SIZE 2048 1085 | 1086 | //Gui enums 1087 | typedef enum 1088 | { 1089 | GUI_DISASSEMBLE_AT, // param1=(duint)va, param2=(duint)cip 1090 | GUI_SET_DEBUG_STATE, // param1=(DBGSTATE)state, param2=unused 1091 | GUI_ADD_MSG_TO_LOG, // param1=(const char*)msg, param2=unused 1092 | GUI_CLEAR_LOG, // param1=unused, param2=unused 1093 | GUI_UPDATE_REGISTER_VIEW, // param1=unused, param2=unused 1094 | GUI_UPDATE_DISASSEMBLY_VIEW, // param1=unused, param2=unused 1095 | GUI_UPDATE_BREAKPOINTS_VIEW, // param1=unused, param2=unused 1096 | GUI_UPDATE_WINDOW_TITLE, // param1=(const char*)file, param2=unused 1097 | GUI_GET_WINDOW_HANDLE, // param1=unused, param2=unused 1098 | GUI_DUMP_AT, // param1=(duint)va param2=unused 1099 | GUI_SCRIPT_ADD, // param1=int count, param2=const char** lines 1100 | GUI_SCRIPT_CLEAR, // param1=unused, param2=unused 1101 | GUI_SCRIPT_SETIP, // param1=int line, param2=unused 1102 | GUI_SCRIPT_ERROR, // param1=int line, param2=const char* message 1103 | GUI_SCRIPT_SETTITLE, // param1=const char* title, param2=unused 1104 | GUI_SCRIPT_SETINFOLINE, // param1=int line, param2=const char* info 1105 | GUI_SCRIPT_MESSAGE, // param1=const char* message, param2=unused 1106 | GUI_SCRIPT_MSGYN, // param1=const char* message, param2=unused 1107 | GUI_SYMBOL_LOG_ADD, // param1(const char*)msg, param2=unused 1108 | GUI_SYMBOL_LOG_CLEAR, // param1=unused, param2=unused 1109 | GUI_SYMBOL_SET_PROGRESS, // param1=int percent param2=unused 1110 | GUI_SYMBOL_UPDATE_MODULE_LIST, // param1=int count, param2=SYMBOLMODULEINFO* modules 1111 | GUI_REF_ADDCOLUMN, // param1=int width, param2=(const char*)title 1112 | GUI_REF_SETROWCOUNT, // param1=int rows, param2=unused 1113 | GUI_REF_GETROWCOUNT, // param1=unused, param2=unused 1114 | GUI_REF_DELETEALLCOLUMNS, // param1=unused, param2=unused 1115 | GUI_REF_SETCELLCONTENT, // param1=(CELLINFO*)info, param2=unused 1116 | GUI_REF_GETCELLCONTENT, // param1=int row, param2=int col 1117 | GUI_REF_RELOADDATA, // param1=unused, param2=unused 1118 | GUI_REF_SETSINGLESELECTION, // param1=int index, param2=bool scroll 1119 | GUI_REF_SETPROGRESS, // param1=int progress, param2=unused 1120 | GUI_REF_SETCURRENTTASKPROGRESS, // param1=int progress, param2=const char* taskTitle 1121 | GUI_REF_SETSEARCHSTARTCOL, // param1=int col param2=unused 1122 | GUI_STACK_DUMP_AT, // param1=duint addr, param2=duint csp 1123 | GUI_UPDATE_DUMP_VIEW, // param1=unused, param2=unused 1124 | GUI_UPDATE_THREAD_VIEW, // param1=unused, param2=unused 1125 | GUI_ADD_RECENT_FILE, // param1=(const char*)file, param2=unused 1126 | GUI_SET_LAST_EXCEPTION, // param1=unsigned int code, param2=unused 1127 | GUI_GET_DISASSEMBLY, // param1=duint addr, param2=char* text 1128 | GUI_MENU_ADD, // param1=int hMenu, param2=const char* title 1129 | GUI_MENU_ADD_ENTRY, // param1=int hMenu, param2=const char* title 1130 | GUI_MENU_ADD_SEPARATOR, // param1=int hMenu, param2=unused 1131 | GUI_MENU_CLEAR, // param1=int hMenu, param2=unused 1132 | GUI_SELECTION_GET, // param1=GUISELECTIONTYPE, param2=SELECTIONDATA* selection 1133 | GUI_SELECTION_SET, // param1=GUISELECTIONTYPE, param2=const SELECTIONDATA* selection 1134 | GUI_GETLINE_WINDOW, // param1=const char* title, param2=char* text 1135 | GUI_AUTOCOMPLETE_ADDCMD, // param1=const char* cmd, param2=ununsed 1136 | GUI_AUTOCOMPLETE_DELCMD, // param1=const char* cmd, param2=ununsed 1137 | GUI_AUTOCOMPLETE_CLEARALL, // param1=unused, param2=unused 1138 | GUI_SCRIPT_ENABLEHIGHLIGHTING, // param1=bool enable, param2=unused 1139 | GUI_ADD_MSG_TO_STATUSBAR, // param1=const char* msg, param2=unused 1140 | GUI_UPDATE_SIDEBAR, // param1=unused, param2=unused 1141 | GUI_REPAINT_TABLE_VIEW, // param1=unused, param2=unused 1142 | GUI_UPDATE_PATCHES, // param1=unused, param2=unused 1143 | GUI_UPDATE_CALLSTACK, // param1=unused, param2=unused 1144 | GUI_UPDATE_SEHCHAIN, // param1=unused, param2=unused 1145 | GUI_SYMBOL_REFRESH_CURRENT, // param1=unused, param2=unused 1146 | GUI_UPDATE_MEMORY_VIEW, // param1=unused, param2=unused 1147 | GUI_REF_INITIALIZE, // param1=const char* name, param2=unused 1148 | GUI_LOAD_SOURCE_FILE, // param1=const char* path, param2=duint addr 1149 | GUI_MENU_SET_ICON, // param1=int hMenu, param2=ICONINFO* 1150 | GUI_MENU_SET_ENTRY_ICON, // param1=int hEntry, param2=ICONINFO* 1151 | GUI_SHOW_CPU, // param1=unused, param2=unused 1152 | GUI_ADD_QWIDGET_TAB, // param1=QWidget*, param2=unused 1153 | GUI_SHOW_QWIDGET_TAB, // param1=QWidget*, param2=unused 1154 | GUI_CLOSE_QWIDGET_TAB, // param1=QWidget*, param2=unused 1155 | GUI_EXECUTE_ON_GUI_THREAD, // param1=GUICALLBACKEX cb, param2=void* userdata 1156 | GUI_UPDATE_TIME_WASTED_COUNTER, // param1=unused, param2=unused 1157 | GUI_SET_GLOBAL_NOTES, // param1=const char* text, param2=unused 1158 | GUI_GET_GLOBAL_NOTES, // param1=char** text, param2=unused 1159 | GUI_SET_DEBUGGEE_NOTES, // param1=const char* text, param2=unused 1160 | GUI_GET_DEBUGGEE_NOTES, // param1=char** text, param2=unused 1161 | GUI_DUMP_AT_N, // param1=int index, param2=duint va 1162 | GUI_DISPLAY_WARNING, // param1=const char *text, param2=unused 1163 | GUI_REGISTER_SCRIPT_LANG, // param1=SCRIPTTYPEINFO* info, param2=unused 1164 | GUI_UNREGISTER_SCRIPT_LANG, // param1=int id, param2=unused 1165 | GUI_UPDATE_ARGUMENT_VIEW, // param1=unused, param2=unused 1166 | GUI_FOCUS_VIEW, // param1=int hWindow, param2=unused 1167 | GUI_UPDATE_WATCH_VIEW, // param1=unused, param2=unused 1168 | GUI_LOAD_GRAPH, // param1=BridgeCFGraphList* param2=unused 1169 | GUI_GRAPH_AT, // param1=duint addr param2=unused 1170 | GUI_UPDATE_GRAPH_VIEW, // param1=unused, param2=unused 1171 | GUI_SET_LOG_ENABLED, // param1=bool isEnabled param2=unused 1172 | GUI_ADD_FAVOURITE_TOOL, // param1=const char* name param2=const char* description 1173 | GUI_ADD_FAVOURITE_COMMAND, // param1=const char* command param2=const char* shortcut 1174 | GUI_SET_FAVOURITE_TOOL_SHORTCUT,// param1=const char* name param2=const char* shortcut 1175 | GUI_FOLD_DISASSEMBLY, // param1=duint startAddress param2=duint length 1176 | GUI_SELECT_IN_MEMORY_MAP, // param1=duint addr, param2=unused 1177 | GUI_GET_ACTIVE_VIEW, // param1=ACTIVEVIEW*, param2=unused 1178 | GUI_MENU_SET_ENTRY_CHECKED, // param1=int hEntry, param2=bool checked 1179 | GUI_ADD_INFO_LINE, // param1=const char* infoline, param2=unused 1180 | GUI_PROCESS_EVENTS, // param1=unused, param2=unused 1181 | GUI_TYPE_ADDNODE, // param1=void* parent, param2=TYPEDESCRIPTOR* type 1182 | GUI_TYPE_CLEAR, // param1=unused, param2=unused 1183 | GUI_UPDATE_TYPE_WIDGET, // param1=unused, param2=unused 1184 | GUI_CLOSE_APPLICATION, // param1=unused, param2=unused 1185 | GUI_MENU_SET_VISIBLE, // param1=int hMenu, param2=bool visible 1186 | GUI_MENU_SET_ENTRY_VISIBLE, // param1=int hEntry, param2=bool visible 1187 | GUI_MENU_SET_NAME, // param1=int hMenu, param2=const char* name 1188 | GUI_MENU_SET_ENTRY_NAME, // param1=int hEntry, param2=const char* name 1189 | GUI_FLUSH_LOG, // param1=unused, param2=unused 1190 | GUI_MENU_SET_ENTRY_HOTKEY, // param1=int hEntry, param2=const char* hack 1191 | GUI_REF_SEARCH_GETROWCOUNT, // param1=unused, param2=unused 1192 | GUI_REF_SEARCH_GETCELLCONTENT, // param1=int row, param2=int col 1193 | GUI_MENU_REMOVE, // param1=int hEntryMenu, param2=unused 1194 | GUI_REF_ADDCOMMAND, // param1=const char* title, param2=const char* command 1195 | GUI_OPEN_TRACE_FILE, // param1=const char* file name,param2=unused 1196 | GUI_UPDATE_TRACE_BROWSER, // param1=unused, param2=unused 1197 | GUI_INVALIDATE_SYMBOL_SOURCE, // param1=duint base, param2=unused 1198 | GUI_GET_CURRENT_GRAPH, // param1=BridgeCFGraphList*, param2=unused 1199 | GUI_SHOW_REF, // param1=unused, param2=unused 1200 | } GUIMSG; 1201 | 1202 | //GUI Typedefs 1203 | struct _TYPEDESCRIPTOR; 1204 | 1205 | typedef void (*GUICALLBACK)(); 1206 | typedef void (*GUICALLBACKEX)(void*); 1207 | typedef bool (*GUISCRIPTEXECUTE)(const char* text); 1208 | typedef void (*GUISCRIPTCOMPLETER)(const char* text, char** entries, int* entryCount); 1209 | typedef bool (*TYPETOSTRING)(const struct _TYPEDESCRIPTOR* type, char* dest, size_t* destCount); //don't change destCount for final failure 1210 | 1211 | //GUI structures 1212 | typedef struct 1213 | { 1214 | int row; 1215 | int col; 1216 | const char* str; 1217 | } CELLINFO; 1218 | 1219 | typedef struct 1220 | { 1221 | duint start; 1222 | duint end; 1223 | } SELECTIONDATA; 1224 | 1225 | typedef struct 1226 | { 1227 | const void* data; 1228 | duint size; 1229 | } ICONDATA; 1230 | 1231 | typedef struct 1232 | { 1233 | char name[64]; 1234 | int id; 1235 | GUISCRIPTEXECUTE execute; 1236 | GUISCRIPTCOMPLETER completeCommand; 1237 | } SCRIPTTYPEINFO; 1238 | 1239 | typedef struct 1240 | { 1241 | void* titleHwnd; 1242 | void* classHwnd; 1243 | char title[MAX_STRING_SIZE]; 1244 | char className[MAX_STRING_SIZE]; 1245 | } ACTIVEVIEW; 1246 | 1247 | typedef struct _TYPEDESCRIPTOR 1248 | { 1249 | bool expanded; //is the type node expanded? 1250 | bool reverse; //big endian? 1251 | const char* name; //type name (int b) 1252 | duint addr; //virtual address 1253 | duint offset; //offset to addr for the actual location 1254 | int id; //type id 1255 | int size; //sizeof(type) 1256 | TYPETOSTRING callback; //convert to string 1257 | void* userdata; //user data 1258 | } TYPEDESCRIPTOR; 1259 | 1260 | //GUI functions 1261 | //code page is utf8 1262 | BRIDGE_IMPEXP const char* GuiTranslateText(const char* Source); 1263 | BRIDGE_IMPEXP void GuiDisasmAt(duint addr, duint cip); 1264 | BRIDGE_IMPEXP void GuiSetDebugState(DBGSTATE state); 1265 | BRIDGE_IMPEXP void GuiSetDebugStateFast(DBGSTATE state); 1266 | BRIDGE_IMPEXP void GuiAddLogMessage(const char* msg); 1267 | BRIDGE_IMPEXP void GuiLogClear(); 1268 | BRIDGE_IMPEXP void GuiUpdateAllViews(); 1269 | BRIDGE_IMPEXP void GuiUpdateRegisterView(); 1270 | BRIDGE_IMPEXP void GuiUpdateDisassemblyView(); 1271 | BRIDGE_IMPEXP void GuiUpdateBreakpointsView(); 1272 | BRIDGE_IMPEXP void GuiUpdateWindowTitle(const char* filename); 1273 | BRIDGE_IMPEXP HWND GuiGetWindowHandle(); 1274 | BRIDGE_IMPEXP void GuiDumpAt(duint va); 1275 | BRIDGE_IMPEXP void GuiScriptAdd(int count, const char** lines); 1276 | BRIDGE_IMPEXP void GuiScriptClear(); 1277 | BRIDGE_IMPEXP void GuiScriptSetIp(int line); 1278 | BRIDGE_IMPEXP void GuiScriptError(int line, const char* message); 1279 | BRIDGE_IMPEXP void GuiScriptSetTitle(const char* title); 1280 | BRIDGE_IMPEXP void GuiScriptSetInfoLine(int line, const char* info); 1281 | BRIDGE_IMPEXP void GuiScriptMessage(const char* message); 1282 | BRIDGE_IMPEXP int GuiScriptMsgyn(const char* message); 1283 | BRIDGE_IMPEXP void GuiScriptEnableHighlighting(bool enable); 1284 | BRIDGE_IMPEXP void GuiSymbolLogAdd(const char* message); 1285 | BRIDGE_IMPEXP void GuiSymbolLogClear(); 1286 | BRIDGE_IMPEXP void GuiSymbolSetProgress(int percent); 1287 | BRIDGE_IMPEXP void GuiSymbolUpdateModuleList(int count, SYMBOLMODULEINFO* modules); 1288 | BRIDGE_IMPEXP void GuiSymbolRefreshCurrent(); 1289 | BRIDGE_IMPEXP void GuiReferenceAddColumn(int width, const char* title); 1290 | BRIDGE_IMPEXP void GuiReferenceSetRowCount(int count); 1291 | BRIDGE_IMPEXP int GuiReferenceGetRowCount(); 1292 | BRIDGE_IMPEXP int GuiReferenceSearchGetRowCount(); 1293 | BRIDGE_IMPEXP void GuiReferenceDeleteAllColumns(); 1294 | BRIDGE_IMPEXP void GuiReferenceInitialize(const char* name); 1295 | BRIDGE_IMPEXP void GuiReferenceSetCellContent(int row, int col, const char* str); 1296 | BRIDGE_IMPEXP char* GuiReferenceGetCellContent(int row, int col); 1297 | BRIDGE_IMPEXP char* GuiReferenceSearchGetCellContent(int row, int col); 1298 | BRIDGE_IMPEXP void GuiReferenceReloadData(); 1299 | BRIDGE_IMPEXP void GuiReferenceSetSingleSelection(int index, bool scroll); 1300 | BRIDGE_IMPEXP void GuiReferenceSetProgress(int progress); 1301 | BRIDGE_IMPEXP void GuiReferenceSetCurrentTaskProgress(int progress, const char* taskTitle); 1302 | BRIDGE_IMPEXP void GuiReferenceSetSearchStartCol(int col); 1303 | BRIDGE_IMPEXP void GuiStackDumpAt(duint addr, duint csp); 1304 | BRIDGE_IMPEXP void GuiUpdateDumpView(); 1305 | BRIDGE_IMPEXP void GuiUpdateWatchView(); 1306 | BRIDGE_IMPEXP void GuiUpdateThreadView(); 1307 | BRIDGE_IMPEXP void GuiUpdateMemoryView(); 1308 | BRIDGE_IMPEXP void GuiAddRecentFile(const char* file); 1309 | BRIDGE_IMPEXP void GuiSetLastException(unsigned int exception); 1310 | BRIDGE_IMPEXP bool GuiGetDisassembly(duint addr, char* text); 1311 | BRIDGE_IMPEXP int GuiMenuAdd(int hMenu, const char* title); 1312 | BRIDGE_IMPEXP int GuiMenuAddEntry(int hMenu, const char* title); 1313 | BRIDGE_IMPEXP void GuiMenuAddSeparator(int hMenu); 1314 | BRIDGE_IMPEXP void GuiMenuClear(int hMenu); 1315 | BRIDGE_IMPEXP void GuiMenuRemove(int hEntryMenu); 1316 | BRIDGE_IMPEXP bool GuiSelectionGet(GUISELECTIONTYPE hWindow, SELECTIONDATA* selection); 1317 | BRIDGE_IMPEXP bool GuiSelectionSet(GUISELECTIONTYPE hWindow, const SELECTIONDATA* selection); 1318 | BRIDGE_IMPEXP bool GuiGetLineWindow(const char* title, char* text); 1319 | BRIDGE_IMPEXP void GuiAutoCompleteAddCmd(const char* cmd); 1320 | BRIDGE_IMPEXP void GuiAutoCompleteDelCmd(const char* cmd); 1321 | BRIDGE_IMPEXP void GuiAutoCompleteClearAll(); 1322 | BRIDGE_IMPEXP void GuiAddStatusBarMessage(const char* msg); 1323 | BRIDGE_IMPEXP void GuiUpdateSideBar(); 1324 | BRIDGE_IMPEXP void GuiRepaintTableView(); 1325 | BRIDGE_IMPEXP void GuiUpdatePatches(); 1326 | BRIDGE_IMPEXP void GuiUpdateCallStack(); 1327 | BRIDGE_IMPEXP void GuiUpdateSEHChain(); 1328 | BRIDGE_IMPEXP void GuiLoadSourceFileEx(const char* path, duint addr); 1329 | BRIDGE_IMPEXP void GuiMenuSetIcon(int hMenu, const ICONDATA* icon); 1330 | BRIDGE_IMPEXP void GuiMenuSetEntryIcon(int hEntry, const ICONDATA* icon); 1331 | BRIDGE_IMPEXP void GuiMenuSetEntryChecked(int hEntry, bool checked); 1332 | BRIDGE_IMPEXP void GuiMenuSetVisible(int hMenu, bool visible); 1333 | BRIDGE_IMPEXP void GuiMenuSetEntryVisible(int hEntry, bool visible); 1334 | BRIDGE_IMPEXP void GuiMenuSetName(int hMenu, const char* name); 1335 | BRIDGE_IMPEXP void GuiMenuSetEntryName(int hEntry, const char* name); 1336 | BRIDGE_IMPEXP void GuiMenuSetEntryHotkey(int hEntry, const char* hack); 1337 | BRIDGE_IMPEXP void GuiShowCpu(); 1338 | BRIDGE_IMPEXP void GuiAddQWidgetTab(void* qWidget); 1339 | BRIDGE_IMPEXP void GuiShowQWidgetTab(void* qWidget); 1340 | BRIDGE_IMPEXP void GuiCloseQWidgetTab(void* qWidget); 1341 | BRIDGE_IMPEXP void GuiExecuteOnGuiThread(GUICALLBACK cbGuiThread); 1342 | BRIDGE_IMPEXP void GuiUpdateTimeWastedCounter(); 1343 | BRIDGE_IMPEXP void GuiSetGlobalNotes(const char* text); 1344 | BRIDGE_IMPEXP void GuiGetGlobalNotes(char** text); 1345 | BRIDGE_IMPEXP void GuiSetDebuggeeNotes(const char* text); 1346 | BRIDGE_IMPEXP void GuiGetDebuggeeNotes(char** text); 1347 | BRIDGE_IMPEXP void GuiDumpAtN(duint va, int index); 1348 | BRIDGE_IMPEXP void GuiDisplayWarning(const char* title, const char* text); 1349 | BRIDGE_IMPEXP void GuiRegisterScriptLanguage(SCRIPTTYPEINFO* info); 1350 | BRIDGE_IMPEXP void GuiUnregisterScriptLanguage(int id); 1351 | BRIDGE_IMPEXP void GuiUpdateArgumentWidget(); 1352 | BRIDGE_IMPEXP void GuiFocusView(int hWindow); 1353 | BRIDGE_IMPEXP bool GuiIsUpdateDisabled(); 1354 | BRIDGE_IMPEXP void GuiUpdateEnable(bool updateNow); 1355 | BRIDGE_IMPEXP void GuiUpdateDisable(); 1356 | BRIDGE_IMPEXP bool GuiLoadGraph(BridgeCFGraphList* graph, duint addr); 1357 | BRIDGE_IMPEXP duint GuiGraphAt(duint addr); 1358 | BRIDGE_IMPEXP void GuiUpdateGraphView(); 1359 | BRIDGE_IMPEXP void GuiDisableLog(); 1360 | BRIDGE_IMPEXP void GuiEnableLog(); 1361 | BRIDGE_IMPEXP void GuiAddFavouriteTool(const char* name, const char* description); 1362 | BRIDGE_IMPEXP void GuiAddFavouriteCommand(const char* name, const char* shortcut); 1363 | BRIDGE_IMPEXP void GuiSetFavouriteToolShortcut(const char* name, const char* shortcut); 1364 | BRIDGE_IMPEXP void GuiFoldDisassembly(duint startAddress, duint length); 1365 | BRIDGE_IMPEXP void GuiSelectInMemoryMap(duint addr); 1366 | BRIDGE_IMPEXP void GuiGetActiveView(ACTIVEVIEW* activeView); 1367 | BRIDGE_IMPEXP void GuiAddInfoLine(const char* infoLine); 1368 | BRIDGE_IMPEXP void GuiProcessEvents(); 1369 | BRIDGE_IMPEXP void* GuiTypeAddNode(void* parent, const TYPEDESCRIPTOR* type); 1370 | BRIDGE_IMPEXP bool GuiTypeClear(); 1371 | BRIDGE_IMPEXP void GuiUpdateTypeWidget(); 1372 | BRIDGE_IMPEXP void GuiCloseApplication(); 1373 | BRIDGE_IMPEXP void GuiFlushLog(); 1374 | BRIDGE_IMPEXP void GuiReferenceAddCommand(const char* title, const char* command); 1375 | BRIDGE_IMPEXP void GuiUpdateTraceBrowser(); 1376 | BRIDGE_IMPEXP void GuiOpenTraceFile(const char* fileName); 1377 | BRIDGE_IMPEXP void GuiInvalidateSymbolSource(duint base); 1378 | BRIDGE_IMPEXP void GuiExecuteOnGuiThreadEx(GUICALLBACKEX cbGuiThread, void* userdata); 1379 | BRIDGE_IMPEXP void GuiGetCurrentGraph(BridgeCFGraphList* graphList); 1380 | BRIDGE_IMPEXP void GuiShowReferences(); 1381 | 1382 | #ifdef __cplusplus 1383 | } 1384 | #endif 1385 | 1386 | #pragma pack(pop) 1387 | 1388 | #endif // _BRIDGEMAIN_H_ 1389 | -------------------------------------------------------------------------------- /x128dbg/pluginsdk/dbghelp/dbghelp_x64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/dbghelp/dbghelp_x64.a -------------------------------------------------------------------------------- /x128dbg/pluginsdk/dbghelp/dbghelp_x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/dbghelp/dbghelp_x64.lib -------------------------------------------------------------------------------- /x128dbg/pluginsdk/dbghelp/dbghelp_x86.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/dbghelp/dbghelp_x86.a -------------------------------------------------------------------------------- /x128dbg/pluginsdk/dbghelp/dbghelp_x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/dbghelp/dbghelp_x86.lib -------------------------------------------------------------------------------- /x128dbg/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 | -------------------------------------------------------------------------------- /x128dbg/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 | -------------------------------------------------------------------------------- /x128dbg/pluginsdk/jansson/jansson_x64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/jansson/jansson_x64.a -------------------------------------------------------------------------------- /x128dbg/pluginsdk/jansson/jansson_x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/jansson/jansson_x64.lib -------------------------------------------------------------------------------- /x128dbg/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 | -------------------------------------------------------------------------------- /x128dbg/pluginsdk/jansson/jansson_x86.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/jansson/jansson_x86.a -------------------------------------------------------------------------------- /x128dbg/pluginsdk/jansson/jansson_x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/jansson/jansson_x86.lib -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/pluginsdk/lz4/lz4_x64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/lz4/lz4_x64.a -------------------------------------------------------------------------------- /x128dbg/pluginsdk/lz4/lz4_x64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/lz4/lz4_x64.lib -------------------------------------------------------------------------------- /x128dbg/pluginsdk/lz4/lz4_x86.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/lz4/lz4_x86.a -------------------------------------------------------------------------------- /x128dbg/pluginsdk/lz4/lz4_x86.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/lz4/lz4_x86.lib -------------------------------------------------------------------------------- /x128dbg/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 -------------------------------------------------------------------------------- /x128dbg/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 | -------------------------------------------------------------------------------- /x128dbg/pluginsdk/x32bridge.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/x32bridge.lib -------------------------------------------------------------------------------- /x128dbg/pluginsdk/x32dbg.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/x32dbg.lib -------------------------------------------------------------------------------- /x128dbg/pluginsdk/x64bridge.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/x64bridge.lib -------------------------------------------------------------------------------- /x128dbg/pluginsdk/x64dbg.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Titvt/x128dbg/b0321305ba4eb4a650c5c29024ec60c6b5325c9c/x128dbg/pluginsdk/x64dbg.lib -------------------------------------------------------------------------------- /x128dbg/x128dbg.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 | 16.0 23 | Win32Proj 24 | {88e355ea-c75d-4162-ac6f-a39e3e8784de} 25 | x128dbg 26 | 10.0 27 | 28 | 29 | 30 | Application 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | DynamicLibrary 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | Application 44 | true 45 | v142 46 | Unicode 47 | 48 | 49 | DynamicLibrary 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | 76 | 77 | false 78 | .dp32 79 | 80 | 81 | true 82 | 83 | 84 | false 85 | .dp64 86 | 87 | 88 | 89 | Level3 90 | true 91 | WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) 92 | true 93 | 94 | 95 | Console 96 | true 97 | 98 | 99 | 100 | 101 | Level3 102 | true 103 | true 104 | true 105 | WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 106 | true 107 | 108 | 109 | Console 110 | true 111 | true 112 | true 113 | 114 | 115 | 116 | 117 | Level3 118 | true 119 | _DEBUG;_CONSOLE;%(PreprocessorDefinitions) 120 | true 121 | 122 | 123 | Console 124 | true 125 | 126 | 127 | 128 | 129 | Level3 130 | true 131 | true 132 | true 133 | NDEBUG;_CONSOLE;%(PreprocessorDefinitions) 134 | true 135 | 136 | 137 | Console 138 | true 139 | true 140 | true 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 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | -------------------------------------------------------------------------------- /x128dbg/x128dbg.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;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 | {8c49831f-cabc-487f-b767-f18116d48c7b} 18 | 19 | 20 | {24c20ece-ca39-4ebb-99e0-73a211e8cfdf} 21 | 22 | 23 | {305e986c-ff9f-4d0c-8319-e43806de5e45} 24 | 25 | 26 | {0525afcb-0ab0-4a23-aa52-1a629070f156} 27 | 28 | 29 | {95fef8e9-e0d1-45bb-9c30-1ad295a19943} 30 | 31 | 32 | {a02efdf2-0ba5-4c50-8403-0b6802b52a70} 33 | 34 | 35 | {820c06ec-314a-47c4-a8cf-0a0bb41aaae3} 36 | 37 | 38 | {c8f31077-18ad-4256-aca6-f4e859dcad60} 39 | 40 | 41 | 42 | 43 | 源文件 44 | 45 | 46 | 源文件 47 | 48 | 49 | 50 | 51 | 头文件 52 | 53 | 54 | 头文件 55 | 56 | 57 | 头文件\pluginsdk 58 | 59 | 60 | 头文件\pluginsdk 61 | 62 | 63 | 头文件\pluginsdk 64 | 65 | 66 | 头文件\pluginsdk 67 | 68 | 69 | 头文件\pluginsdk 70 | 71 | 72 | 头文件\pluginsdk 73 | 74 | 75 | 头文件\pluginsdk 76 | 77 | 78 | 头文件\pluginsdk 79 | 80 | 81 | 头文件\pluginsdk 82 | 83 | 84 | 头文件\pluginsdk 85 | 86 | 87 | 头文件\pluginsdk 88 | 89 | 90 | 头文件\pluginsdk 91 | 92 | 93 | 头文件\pluginsdk 94 | 95 | 96 | 头文件\pluginsdk 97 | 98 | 99 | 头文件\pluginsdk 100 | 101 | 102 | 头文件\pluginsdk 103 | 104 | 105 | 头文件\pluginsdk 106 | 107 | 108 | 头文件\pluginsdk 109 | 110 | 111 | 头文件\pluginsdk 112 | 113 | 114 | 头文件\pluginsdk 115 | 116 | 117 | 头文件\pluginsdk 118 | 119 | 120 | 头文件\pluginsdk 121 | 122 | 123 | 头文件\pluginsdk 124 | 125 | 126 | 头文件\pluginsdk\dbghelp 127 | 128 | 129 | 头文件\pluginsdk\DeviceNameResolver 130 | 131 | 132 | 头文件\pluginsdk\jansson 133 | 134 | 135 | 头文件\pluginsdk\jansson 136 | 137 | 138 | 头文件\pluginsdk\jansson 139 | 140 | 141 | 头文件\pluginsdk\lz4 142 | 143 | 144 | 头文件\pluginsdk\lz4 145 | 146 | 147 | 头文件\pluginsdk\lz4 148 | 149 | 150 | 头文件\pluginsdk\XEDParse 151 | 152 | 153 | 头文件\pluginsdk\TitanEngine 154 | 155 | 156 | 157 | 158 | 头文件\pluginsdk 159 | 160 | 161 | 头文件\pluginsdk 162 | 163 | 164 | 头文件\pluginsdk 165 | 166 | 167 | 头文件\pluginsdk 168 | 169 | 170 | 头文件\pluginsdk\dbghelp 171 | 172 | 173 | 头文件\pluginsdk\dbghelp 174 | 175 | 176 | 头文件\pluginsdk\dbghelp 177 | 178 | 179 | 头文件\pluginsdk\dbghelp 180 | 181 | 182 | 头文件\pluginsdk\DeviceNameResolver 183 | 184 | 185 | 头文件\pluginsdk\DeviceNameResolver 186 | 187 | 188 | 头文件\pluginsdk\DeviceNameResolver 189 | 190 | 191 | 头文件\pluginsdk\DeviceNameResolver 192 | 193 | 194 | 头文件\pluginsdk\jansson 195 | 196 | 197 | 头文件\pluginsdk\jansson 198 | 199 | 200 | 头文件\pluginsdk\jansson 201 | 202 | 203 | 头文件\pluginsdk\jansson 204 | 205 | 206 | 头文件\pluginsdk\lz4 207 | 208 | 209 | 头文件\pluginsdk\lz4 210 | 211 | 212 | 头文件\pluginsdk\lz4 213 | 214 | 215 | 头文件\pluginsdk\lz4 216 | 217 | 218 | 头文件\pluginsdk\XEDParse 219 | 220 | 221 | 头文件\pluginsdk\XEDParse 222 | 223 | 224 | 头文件\pluginsdk\XEDParse 225 | 226 | 227 | 头文件\pluginsdk\XEDParse 228 | 229 | 230 | 头文件\pluginsdk\TitanEngine 231 | 232 | 233 | 头文件\pluginsdk\TitanEngine 234 | 235 | 236 | 头文件\pluginsdk\TitanEngine 237 | 238 | 239 | 头文件\pluginsdk\TitanEngine 240 | 241 | 242 | 243 | 244 | picture 245 | 246 | 247 | picture 248 | 249 | 250 | picture 251 | 252 | 253 | 254 | 255 | 256 | --------------------------------------------------------------------------------