superghidra 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of superghidra might be problematic. Click here for more details.

Files changed (93) hide show
  1. superghidra-0.2.0/LICENSE +201 -0
  2. superghidra-0.2.0/PKG-INFO +202 -0
  3. superghidra-0.2.0/README.md +153 -0
  4. superghidra-0.2.0/apk_jni_cross_referencer.py +15 -0
  5. superghidra-0.2.0/arm_thumb_decode.py +15 -0
  6. superghidra-0.2.0/binary_diff_engine.py +15 -0
  7. superghidra-0.2.0/binary_loader.py +15 -0
  8. superghidra-0.2.0/colab_cloud_orchestrator.py +15 -0
  9. superghidra-0.2.0/cross_platform_headless_harness.py +15 -0
  10. superghidra-0.2.0/dependency_cache_dag.py +15 -0
  11. superghidra-0.2.0/dwarf_pdb_preindexer.py +15 -0
  12. superghidra-0.2.0/emulator_memory_sidecar.py +15 -0
  13. superghidra-0.2.0/evidence_ledger.py +15 -0
  14. superghidra-0.2.0/ghidra_extension_packager.py +15 -0
  15. superghidra-0.2.0/ghidra_oracle.py +15 -0
  16. superghidra-0.2.0/gpu_adrp_scanner.py +15 -0
  17. superghidra-0.2.0/gpu_function_seeder.py +15 -0
  18. superghidra-0.2.0/headless_analyzer_tuner.py +15 -0
  19. superghidra-0.2.0/ida_flirt_bridge.py +15 -0
  20. superghidra-0.2.0/ida_til_importer.py +15 -0
  21. superghidra-0.2.0/live_binary_tools.py +15 -0
  22. superghidra-0.2.0/mfc_archive.py +15 -0
  23. superghidra-0.2.0/msvc_class_recovery.py +15 -0
  24. superghidra-0.2.0/native_decompiler_pgo_builder.py +15 -0
  25. superghidra-0.2.0/neural_decompiler_pipeline.py +15 -0
  26. superghidra-0.2.0/pcode_lifter_bridge.py +15 -0
  27. superghidra-0.2.0/pyproject.toml +128 -0
  28. superghidra-0.2.0/resource_governor.py +15 -0
  29. superghidra-0.2.0/semantic_delta_log.py +15 -0
  30. superghidra-0.2.0/serialize_trace.py +15 -0
  31. superghidra-0.2.0/setup.cfg +4 -0
  32. superghidra-0.2.0/shm_decompiler_bridge.py +15 -0
  33. superghidra-0.2.0/smt_pcode_verifier.py +15 -0
  34. superghidra-0.2.0/storage_compression_prototype.py +15 -0
  35. superghidra-0.2.0/struct_shift_migrator.py +15 -0
  36. superghidra-0.2.0/superghidra/__init__.py +279 -0
  37. superghidra-0.2.0/superghidra/__main__.py +232 -0
  38. superghidra-0.2.0/superghidra/acceleration/__init__.py +29 -0
  39. superghidra-0.2.0/superghidra/acceleration/gpu_adrp_scanner.py +689 -0
  40. superghidra-0.2.0/superghidra/acceleration/gpu_function_seeder.py +925 -0
  41. superghidra-0.2.0/superghidra/core/__init__.py +112 -0
  42. superghidra-0.2.0/superghidra/core/compilable_filter.py +397 -0
  43. superghidra-0.2.0/superghidra/core/cross_platform_headless_harness.py +161 -0
  44. superghidra-0.2.0/superghidra/core/dependency_cache_dag.py +773 -0
  45. superghidra-0.2.0/superghidra/core/evidence_ledger.py +8 -0
  46. superghidra-0.2.0/superghidra/core/ghidra_oracle.py +2858 -0
  47. superghidra-0.2.0/superghidra/core/headless_analyzer_tuner.py +510 -0
  48. superghidra-0.2.0/superghidra/core/live_binary_tools.py +947 -0
  49. superghidra-0.2.0/superghidra/core/mitigation_roadmap_engine.py +788 -0
  50. superghidra-0.2.0/superghidra/core/native_compiler.py +223 -0
  51. superghidra-0.2.0/superghidra/core/native_decompiler_pgo_builder.py +539 -0
  52. superghidra-0.2.0/superghidra/core/parity_engine.py +2323 -0
  53. superghidra-0.2.0/superghidra/core/resource_governor.py +515 -0
  54. superghidra-0.2.0/superghidra/core/shm_decompiler_bridge.py +1177 -0
  55. superghidra-0.2.0/superghidra/diff/__init__.py +80 -0
  56. superghidra-0.2.0/superghidra/diff/benchmark_and_nextgen_engine.py +1278 -0
  57. superghidra-0.2.0/superghidra/diff/binary_diff_engine.py +1712 -0
  58. superghidra-0.2.0/superghidra/diff/evidence_ledger.py +943 -0
  59. superghidra-0.2.0/superghidra/diff/phase1_phase2_roadmap_engine.py +527 -0
  60. superghidra-0.2.0/superghidra/diff/semantic_delta_log.py +1067 -0
  61. superghidra-0.2.0/superghidra/diff/struct_shift_migrator.py +1393 -0
  62. superghidra-0.2.0/superghidra/formats/__init__.py +72 -0
  63. superghidra-0.2.0/superghidra/formats/binary_loader.py +908 -0
  64. superghidra-0.2.0/superghidra/formats/dwarf_pdb_preindexer.py +2127 -0
  65. superghidra-0.2.0/superghidra/formats/ida_flirt_bridge.py +356 -0
  66. superghidra-0.2.0/superghidra/formats/ida_til_importer.py +347 -0
  67. superghidra-0.2.0/superghidra/formats/mfc_archive.py +817 -0
  68. superghidra-0.2.0/superghidra/formats/msvc_class_recovery.py +631 -0
  69. superghidra-0.2.0/superghidra/formats/serialize_trace.py +1622 -0
  70. superghidra-0.2.0/superghidra/formats/synthetic_symbol_exporter.py +1293 -0
  71. superghidra-0.2.0/superghidra/integrations/__init__.py +74 -0
  72. superghidra-0.2.0/superghidra/integrations/apk_jni_cross_referencer.py +1158 -0
  73. superghidra-0.2.0/superghidra/integrations/colab_cloud_orchestrator.py +736 -0
  74. superghidra-0.2.0/superghidra/integrations/d_lift_verifier.py +1096 -0
  75. superghidra-0.2.0/superghidra/integrations/emulator_memory_sidecar.py +1276 -0
  76. superghidra-0.2.0/superghidra/integrations/neural_decompiler_pipeline.py +705 -0
  77. superghidra-0.2.0/superghidra/lifters/__init__.py +68 -0
  78. superghidra-0.2.0/superghidra/lifters/arm_thumb_decode.py +1203 -0
  79. superghidra-0.2.0/superghidra/lifters/egraph_mlir_pipeline.py +1596 -0
  80. superghidra-0.2.0/superghidra/lifters/pcode_lifter_bridge.py +2356 -0
  81. superghidra-0.2.0/superghidra/lifters/smt_pcode_verifier.py +2262 -0
  82. superghidra-0.2.0/superghidra/lifters/x86_decode.py +533 -0
  83. superghidra-0.2.0/superghidra/storage/__init__.py +28 -0
  84. superghidra-0.2.0/superghidra/storage/ghidra_extension_packager.py +373 -0
  85. superghidra-0.2.0/superghidra/storage/storage_compression_prototype.py +808 -0
  86. superghidra-0.2.0/superghidra.egg-info/PKG-INFO +202 -0
  87. superghidra-0.2.0/superghidra.egg-info/SOURCES.txt +91 -0
  88. superghidra-0.2.0/superghidra.egg-info/dependency_links.txt +1 -0
  89. superghidra-0.2.0/superghidra.egg-info/entry_points.txt +2 -0
  90. superghidra-0.2.0/superghidra.egg-info/requires.txt +25 -0
  91. superghidra-0.2.0/superghidra.egg-info/top_level.txt +33 -0
  92. superghidra-0.2.0/synthetic_symbol_exporter.py +15 -0
  93. superghidra-0.2.0/x86_decode.py +15 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 SuperGhidra Contributors
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,202 @@
1
+ Metadata-Version: 2.4
2
+ Name: superghidra
3
+ Version: 0.2.0
4
+ Summary: SuperGhidra: High-Performance Ghidra Architecture & GPU Acceleration Suite
5
+ Author: yuatemycat
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/yuatemycat/SuperGhidra
8
+ Project-URL: Repository, https://github.com/yuatemycat/SuperGhidra
9
+ Project-URL: Documentation, https://github.com/yuatemycat/SuperGhidra/tree/master/docs
10
+ Project-URL: Issue Tracker, https://github.com/yuatemycat/SuperGhidra/issues
11
+ Keywords: ghidra,reverse-engineering,decompiler,gpu-acceleration,vulkan,directx12,z3,smt,pcode,arm64,x86-64,disassembler,binary-analysis,mcp
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Information Technology
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Operating System :: Microsoft :: Windows
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Operating System :: MacOS
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: Security
24
+ Classifier: Topic :: Software Development :: Compilers
25
+ Classifier: Topic :: Software Development :: Disassemblers
26
+ Requires-Python: >=3.10
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: numpy
30
+ Provides-Extra: smt
31
+ Requires-Dist: z3-solver; extra == "smt"
32
+ Provides-Extra: gpu
33
+ Requires-Dist: wgpu; extra == "gpu"
34
+ Provides-Extra: storage
35
+ Requires-Dist: lz4; extra == "storage"
36
+ Requires-Dist: zstandard; extra == "storage"
37
+ Provides-Extra: frida
38
+ Requires-Dist: frida; extra == "frida"
39
+ Provides-Extra: ghidra
40
+ Requires-Dist: pyghidra; extra == "ghidra"
41
+ Provides-Extra: all
42
+ Requires-Dist: z3-solver; extra == "all"
43
+ Requires-Dist: wgpu; extra == "all"
44
+ Requires-Dist: lz4; extra == "all"
45
+ Requires-Dist: zstandard; extra == "all"
46
+ Requires-Dist: frida; extra == "all"
47
+ Requires-Dist: pyghidra; extra == "all"
48
+ Dynamic: license-file
49
+
50
+ # SuperGhidra
51
+
52
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
53
+ [![Python 3.10+](https://img.shields.io/badge/Python-3.10+-3776AB.svg)](https://www.python.org/)
54
+ [![CI](https://github.com/yuatemycat/SuperGhidra/actions/workflows/ci.yml/badge.svg)](https://github.com/yuatemycat/SuperGhidra/actions/workflows/ci.yml)
55
+
56
+ Python tools that make Ghidra faster to script against, plus a few analyses it doesn't do out of the box: MFC/C++ class recovery, `Serialize()` layout tracing, cross-version function matching, and a Z3 equivalence checker for P-code.
57
+
58
+ ## Why
59
+
60
+ Ghidra's analysis is excellent, but driving it from scripts is slow. Each headless run pays 5–15 seconds of JVM startup. A project lock stops a second process from reading. Bulk jobs such as sweeping a 20 MB ARM64 `.text` section or matching 45,000 functions between two builds run on a single CPU thread.
61
+
62
+ SuperGhidra keeps one read-only Ghidra project loaded in a background daemon and caches its answers. Bulk work moves into plain Python, NumPy or GPU compute shaders. Much of the format and class-recovery work doesn't need Ghidra at all.
63
+
64
+ ## What's inside
65
+
66
+ | Package | What it does |
67
+ | :--- | :--- |
68
+ | `core` | Daemon on `127.0.0.1:5073` with a SQLite cache. Renames and comments go to a JSON overlay, never into the `.rep`. Also includes a resource governor (`eco` / `balanced` / `turbo` / `auto`) and shared-memory IPC. |
69
+ | `formats` | ELF / PE / Mach-O loader, MSVC RTTI and MFC `CRuntimeClass` recovery, `Serialize()` tracing, a CArchive decoder, and DWARF 5 / Breakpad / map export. None of these need Ghidra. |
70
+ | `lifters` | ARM64 → P-code lifter (integer subset), x86 and ARM/Thumb decoders, and a Z3 checker that proves two snippets equivalent or answers `UNKNOWN`. |
71
+ | `diff` | Matches functions across versions with CFG feature vectors, then finds struct fields whose offsets moved and rewrites the accesses. |
72
+ | `acceleration` | WGPU shaders that scan ARM64 for `ADRP+ADD/LDR` pairs and function prologues, with a SIMD CPU fallback. |
73
+ | `storage` | LZ4 / Zstd codec for Ghidra's 16 KB buffer pages, plus a standalone Java `BufferFile` codec. |
74
+ | `integrations` | APK ↔ JNI cross-referencer, Android emulator memory reader with a device allow-list, and an LLM naming pipeline. |
75
+
76
+ Each package has its own README under [`superghidra/`](superghidra/).
77
+
78
+ ## Results so far
79
+
80
+ - **MFC class recovery:** 52 of 52 serializable classes in `mfc140u.dll` are linked to their `Serialize()`. The same holds for 118 of 118 in SOLIDWORKS' `swdocumentmgr.dll`.
81
+ - **`Serialize()` tracing:** 115 classes in `swdocumentmgr.dll` are traced in about 2 seconds. 83 of them have matching load and store paths.
82
+ - **CArchive decoding:** the layouts recovered from that DLL alone decode the model history in a real SOLIDWORKS part file: feature names, IDs, timestamps and configurations. The file uses a newer format than the DLL, so the end of the stream is still undecoded.
83
+ - **x86 decoder:** instruction lengths match Capstone on about 6.7M instructions of Windows code, including AVX-512.
84
+ - **Storage:** pages shrink by 79% with LZ4 and by 86% with Zstd. These figures come from synthetic Ghidra-like pages, not real projects.
85
+ - **Throughput:** function seeding runs at 12M instructions/s on WGPU and 50M/s with SIMD. A shared-memory round trip takes about 5 µs.
86
+
87
+ All numbers come from one Windows development machine. The full reports are in [`docs/benchmarks/`](docs/benchmarks/).
88
+
89
+ ## Quick start
90
+
91
+ ```bash
92
+ git clone https://github.com/yuatemycat/SuperGhidra
93
+ cd SuperGhidra
94
+ pip install -e ".[all]" # or pick extras: smt, gpu, storage, ghidra, frida
95
+ python -m pytest -q
96
+ ```
97
+
98
+ **Unified CLI:**
99
+
100
+ SuperGhidra ships with an integrated standalone command-line executable `superghidra`:
101
+
102
+ ```bash
103
+ # Display version and hardware acceleration telemetry
104
+ superghidra version
105
+
106
+ # Staged P-code decompiler (MBA simplification, opaque branch pruning, goto-free C)
107
+ superghidra decompile target.dll --rva 0x140001000 --arch x86_64 -o decompiled.c
108
+
109
+ # Import IDA Pro .til type library and dump schema catalog
110
+ superghidra til-import mssdk64.til -o catalog.json
111
+
112
+ # Match binary bytes against IDA FLIRT signature database
113
+ superghidra flirt-match vc32rtf.sig target.exe --rva 0x1000
114
+
115
+ # Recover MSVC / MFC C++ class hierarchies, RTTI structures, and virtual call tables
116
+ superghidra rtti-recover app.dll -o classes.json
117
+
118
+ # Filter raw decompiler output into clean, compilable C
119
+ superghidra filter raw_decompile.c -o clean.c
120
+ ```
121
+
122
+ **Inspect a Windows binary (no Ghidra needed):**
123
+
124
+ ```bash
125
+ python -m superghidra.formats.binary_loader app.dll # sections, imports, exports
126
+ python -m superghidra.formats.msvc_class_recovery app.dll # RTTI + MFC classes
127
+ python -m superghidra.formats.serialize_trace app.dll CMyDoc # Serialize() field layout
128
+ ```
129
+
130
+ **From Python:**
131
+
132
+ ```python
133
+ from superghidra.formats.binary_loader import load_binary
134
+ from superghidra.formats.msvc_class_recovery import recover_classes
135
+ import superghidra as sg
136
+
137
+ img = load_binary("app.dll")
138
+ print(img.format, img.arch, len(img.sections))
139
+
140
+ report = recover_classes("app.dll")
141
+ print(len(report.mfc_classes), "MFC classes")
142
+
143
+ # Lift one ARM64 instruction and check it against itself with Z3
144
+ ops = sg.ARM64PcodeLifter().lift_instruction(0x1000, 0x91008041) # add x1, x2, #0x20
145
+ print(sg.SMTPcodeVerifier().verify_equivalence(ops, ops).equivalent)
146
+ ```
147
+
148
+ **Query a Ghidra project through the daemon** (needs JDK 21, Ghidra 11+ and `pyghidra`):
149
+
150
+ ```bash
151
+ export GHIDRA_INSTALL_DIR=/path/to/ghidra
152
+ python ghidra_oracle.py --project-dir ~/re/proj --project-name game --program-name libgame.so status
153
+ python ghidra_oracle.py decompile 0x00CF2D84 # first call boots Ghidra, later calls hit the cache
154
+ python ghidra_oracle.py rename 0x00CF2D84 World_tick
155
+ python ghidra_oracle.py mode eco # throttle CPU use
156
+ python ghidra_oracle.py stop
157
+ ```
158
+
159
+ Run `python ghidra_oracle.py --help` to list every command.
160
+
161
+ **Configuration** is read from environment variables, and nothing is tied to a particular machine:
162
+
163
+ | Variable | Used for |
164
+ | :--- | :--- |
165
+ | `GHIDRA_INSTALL_DIR`, `JAVA_HOME` | Ghidra and JDK locations (daemon, headless runs, Java codec build) |
166
+ | `SUPERGHIDRA_PROJECTS` | Default projects for the daemon: `dir,name[,program]` entries joined by `;` |
167
+ | `SUPERGHIDRA_MSVC_ROOT` | Portable MSVC folder, used when gcc/clang aren't on `PATH` |
168
+ | `SUPERGHIDRA_TEST_ARM64_ELF`, `SUPERGHIDRA_TEST_SWDM`, `SUPERGHIDRA_TEST_SW_ROOT` | Optional real binaries / a SOLIDWORKS install for the integration tests. Those tests skip when unset. |
169
+
170
+ ## MCP
171
+
172
+ Most modules are also exposed as MCP tools through a [pyghidra-mcp](https://github.com/clearbluejar/pyghidra-mcp) fork, including `recover_cpp_classes`, `trace_serialize`, `decode_carchive`, `diff_binaries`, `verify_smt_equivalence` and `gpu_adrp_scan`. This lets an AI agent drive them directly.
173
+
174
+ ## Known limitations
175
+
176
+ - The Java codec doesn't compress Ghidra projects transparently. Ghidra has no hook for replacing its buffer file, so you have to call the codec explicitly.
177
+ - PDB export is experimental, and MSVC/LLVM tools may not load the output. Use DWARF export instead.
178
+ - The SMT checker is sound but incomplete. Floats, calls, unhandled ops and long loops return `UNKNOWN`.
179
+ - The ARM64 lifter covers integer instructions only. Atomics lift as `UNIMPLEMENTED`.
180
+ - The LLM naming stage needs a real endpoint. Without one, it falls back to neutral names such as `sub_<addr>`, labelled `heuristic-fallback`.
181
+
182
+ More detail is in [PLAN.md](PLAN.md).
183
+
184
+ ## Repository layout
185
+
186
+ ```
187
+ superghidra/ the package, split into the seven areas above
188
+ tests/ pytest suites, one folder per area
189
+ docs/ benchmark reports and design notes
190
+ ghidra_extension_skeleton/ Java BufferFile codec
191
+ *.py thin shims so `import binary_loader` etc. keep working for older callers
192
+ ```
193
+
194
+ If you're an AI agent, start with [AGENTS.md](AGENTS.md).
195
+
196
+ ## Contributing
197
+
198
+ Issues and PRs are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for the test workflow and the safety rules: read-only projects, verified symbol commits and the emulator allow-list. Report security issues as described in [SECURITY.md](SECURITY.md).
199
+
200
+ ## License
201
+
202
+ [Apache 2.0](LICENSE) © 2026 yuatemycat and contributors.
@@ -0,0 +1,153 @@
1
+ # SuperGhidra
2
+
3
+ [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)
4
+ [![Python 3.10+](https://img.shields.io/badge/Python-3.10+-3776AB.svg)](https://www.python.org/)
5
+ [![CI](https://github.com/yuatemycat/SuperGhidra/actions/workflows/ci.yml/badge.svg)](https://github.com/yuatemycat/SuperGhidra/actions/workflows/ci.yml)
6
+
7
+ Python tools that make Ghidra faster to script against, plus a few analyses it doesn't do out of the box: MFC/C++ class recovery, `Serialize()` layout tracing, cross-version function matching, and a Z3 equivalence checker for P-code.
8
+
9
+ ## Why
10
+
11
+ Ghidra's analysis is excellent, but driving it from scripts is slow. Each headless run pays 5–15 seconds of JVM startup. A project lock stops a second process from reading. Bulk jobs such as sweeping a 20 MB ARM64 `.text` section or matching 45,000 functions between two builds run on a single CPU thread.
12
+
13
+ SuperGhidra keeps one read-only Ghidra project loaded in a background daemon and caches its answers. Bulk work moves into plain Python, NumPy or GPU compute shaders. Much of the format and class-recovery work doesn't need Ghidra at all.
14
+
15
+ ## What's inside
16
+
17
+ | Package | What it does |
18
+ | :--- | :--- |
19
+ | `core` | Daemon on `127.0.0.1:5073` with a SQLite cache. Renames and comments go to a JSON overlay, never into the `.rep`. Also includes a resource governor (`eco` / `balanced` / `turbo` / `auto`) and shared-memory IPC. |
20
+ | `formats` | ELF / PE / Mach-O loader, MSVC RTTI and MFC `CRuntimeClass` recovery, `Serialize()` tracing, a CArchive decoder, and DWARF 5 / Breakpad / map export. None of these need Ghidra. |
21
+ | `lifters` | ARM64 → P-code lifter (integer subset), x86 and ARM/Thumb decoders, and a Z3 checker that proves two snippets equivalent or answers `UNKNOWN`. |
22
+ | `diff` | Matches functions across versions with CFG feature vectors, then finds struct fields whose offsets moved and rewrites the accesses. |
23
+ | `acceleration` | WGPU shaders that scan ARM64 for `ADRP+ADD/LDR` pairs and function prologues, with a SIMD CPU fallback. |
24
+ | `storage` | LZ4 / Zstd codec for Ghidra's 16 KB buffer pages, plus a standalone Java `BufferFile` codec. |
25
+ | `integrations` | APK ↔ JNI cross-referencer, Android emulator memory reader with a device allow-list, and an LLM naming pipeline. |
26
+
27
+ Each package has its own README under [`superghidra/`](superghidra/).
28
+
29
+ ## Results so far
30
+
31
+ - **MFC class recovery:** 52 of 52 serializable classes in `mfc140u.dll` are linked to their `Serialize()`. The same holds for 118 of 118 in SOLIDWORKS' `swdocumentmgr.dll`.
32
+ - **`Serialize()` tracing:** 115 classes in `swdocumentmgr.dll` are traced in about 2 seconds. 83 of them have matching load and store paths.
33
+ - **CArchive decoding:** the layouts recovered from that DLL alone decode the model history in a real SOLIDWORKS part file: feature names, IDs, timestamps and configurations. The file uses a newer format than the DLL, so the end of the stream is still undecoded.
34
+ - **x86 decoder:** instruction lengths match Capstone on about 6.7M instructions of Windows code, including AVX-512.
35
+ - **Storage:** pages shrink by 79% with LZ4 and by 86% with Zstd. These figures come from synthetic Ghidra-like pages, not real projects.
36
+ - **Throughput:** function seeding runs at 12M instructions/s on WGPU and 50M/s with SIMD. A shared-memory round trip takes about 5 µs.
37
+
38
+ All numbers come from one Windows development machine. The full reports are in [`docs/benchmarks/`](docs/benchmarks/).
39
+
40
+ ## Quick start
41
+
42
+ ```bash
43
+ git clone https://github.com/yuatemycat/SuperGhidra
44
+ cd SuperGhidra
45
+ pip install -e ".[all]" # or pick extras: smt, gpu, storage, ghidra, frida
46
+ python -m pytest -q
47
+ ```
48
+
49
+ **Unified CLI:**
50
+
51
+ SuperGhidra ships with an integrated standalone command-line executable `superghidra`:
52
+
53
+ ```bash
54
+ # Display version and hardware acceleration telemetry
55
+ superghidra version
56
+
57
+ # Staged P-code decompiler (MBA simplification, opaque branch pruning, goto-free C)
58
+ superghidra decompile target.dll --rva 0x140001000 --arch x86_64 -o decompiled.c
59
+
60
+ # Import IDA Pro .til type library and dump schema catalog
61
+ superghidra til-import mssdk64.til -o catalog.json
62
+
63
+ # Match binary bytes against IDA FLIRT signature database
64
+ superghidra flirt-match vc32rtf.sig target.exe --rva 0x1000
65
+
66
+ # Recover MSVC / MFC C++ class hierarchies, RTTI structures, and virtual call tables
67
+ superghidra rtti-recover app.dll -o classes.json
68
+
69
+ # Filter raw decompiler output into clean, compilable C
70
+ superghidra filter raw_decompile.c -o clean.c
71
+ ```
72
+
73
+ **Inspect a Windows binary (no Ghidra needed):**
74
+
75
+ ```bash
76
+ python -m superghidra.formats.binary_loader app.dll # sections, imports, exports
77
+ python -m superghidra.formats.msvc_class_recovery app.dll # RTTI + MFC classes
78
+ python -m superghidra.formats.serialize_trace app.dll CMyDoc # Serialize() field layout
79
+ ```
80
+
81
+ **From Python:**
82
+
83
+ ```python
84
+ from superghidra.formats.binary_loader import load_binary
85
+ from superghidra.formats.msvc_class_recovery import recover_classes
86
+ import superghidra as sg
87
+
88
+ img = load_binary("app.dll")
89
+ print(img.format, img.arch, len(img.sections))
90
+
91
+ report = recover_classes("app.dll")
92
+ print(len(report.mfc_classes), "MFC classes")
93
+
94
+ # Lift one ARM64 instruction and check it against itself with Z3
95
+ ops = sg.ARM64PcodeLifter().lift_instruction(0x1000, 0x91008041) # add x1, x2, #0x20
96
+ print(sg.SMTPcodeVerifier().verify_equivalence(ops, ops).equivalent)
97
+ ```
98
+
99
+ **Query a Ghidra project through the daemon** (needs JDK 21, Ghidra 11+ and `pyghidra`):
100
+
101
+ ```bash
102
+ export GHIDRA_INSTALL_DIR=/path/to/ghidra
103
+ python ghidra_oracle.py --project-dir ~/re/proj --project-name game --program-name libgame.so status
104
+ python ghidra_oracle.py decompile 0x00CF2D84 # first call boots Ghidra, later calls hit the cache
105
+ python ghidra_oracle.py rename 0x00CF2D84 World_tick
106
+ python ghidra_oracle.py mode eco # throttle CPU use
107
+ python ghidra_oracle.py stop
108
+ ```
109
+
110
+ Run `python ghidra_oracle.py --help` to list every command.
111
+
112
+ **Configuration** is read from environment variables, and nothing is tied to a particular machine:
113
+
114
+ | Variable | Used for |
115
+ | :--- | :--- |
116
+ | `GHIDRA_INSTALL_DIR`, `JAVA_HOME` | Ghidra and JDK locations (daemon, headless runs, Java codec build) |
117
+ | `SUPERGHIDRA_PROJECTS` | Default projects for the daemon: `dir,name[,program]` entries joined by `;` |
118
+ | `SUPERGHIDRA_MSVC_ROOT` | Portable MSVC folder, used when gcc/clang aren't on `PATH` |
119
+ | `SUPERGHIDRA_TEST_ARM64_ELF`, `SUPERGHIDRA_TEST_SWDM`, `SUPERGHIDRA_TEST_SW_ROOT` | Optional real binaries / a SOLIDWORKS install for the integration tests. Those tests skip when unset. |
120
+
121
+ ## MCP
122
+
123
+ Most modules are also exposed as MCP tools through a [pyghidra-mcp](https://github.com/clearbluejar/pyghidra-mcp) fork, including `recover_cpp_classes`, `trace_serialize`, `decode_carchive`, `diff_binaries`, `verify_smt_equivalence` and `gpu_adrp_scan`. This lets an AI agent drive them directly.
124
+
125
+ ## Known limitations
126
+
127
+ - The Java codec doesn't compress Ghidra projects transparently. Ghidra has no hook for replacing its buffer file, so you have to call the codec explicitly.
128
+ - PDB export is experimental, and MSVC/LLVM tools may not load the output. Use DWARF export instead.
129
+ - The SMT checker is sound but incomplete. Floats, calls, unhandled ops and long loops return `UNKNOWN`.
130
+ - The ARM64 lifter covers integer instructions only. Atomics lift as `UNIMPLEMENTED`.
131
+ - The LLM naming stage needs a real endpoint. Without one, it falls back to neutral names such as `sub_<addr>`, labelled `heuristic-fallback`.
132
+
133
+ More detail is in [PLAN.md](PLAN.md).
134
+
135
+ ## Repository layout
136
+
137
+ ```
138
+ superghidra/ the package, split into the seven areas above
139
+ tests/ pytest suites, one folder per area
140
+ docs/ benchmark reports and design notes
141
+ ghidra_extension_skeleton/ Java BufferFile codec
142
+ *.py thin shims so `import binary_loader` etc. keep working for older callers
143
+ ```
144
+
145
+ If you're an AI agent, start with [AGENTS.md](AGENTS.md).
146
+
147
+ ## Contributing
148
+
149
+ Issues and PRs are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for the test workflow and the safety rules: read-only projects, verified symbol commits and the emulator allow-list. Report security issues as described in [SECURITY.md](SECURITY.md).
150
+
151
+ ## License
152
+
153
+ [Apache 2.0](LICENSE) © 2026 yuatemycat and contributors.
@@ -0,0 +1,15 @@
1
+ """Backward-compatibility shim for `apk_jni_cross_referencer`.
2
+
3
+ Canonical location: `superghidra.integrations.apk_jni_cross_referencer`.
4
+ """
5
+ from __future__ import annotations
6
+
7
+ import sys as _sys
8
+ from superghidra.integrations import apk_jni_cross_referencer as _mod
9
+ from superghidra.integrations.apk_jni_cross_referencer import * # noqa: F401,F403
10
+
11
+ if __name__ == "__main__":
12
+ import runpy as _runpy
13
+ _runpy.run_module("superghidra.integrations.apk_jni_cross_referencer", run_name="__main__", alter_sys=True)
14
+ else:
15
+ _sys.modules[__name__] = _mod
@@ -0,0 +1,15 @@
1
+ """Backward-compatibility shim for `arm_thumb_decode`.
2
+
3
+ Canonical location: `superghidra.lifters.arm_thumb_decode`.
4
+ """
5
+ from __future__ import annotations
6
+
7
+ import sys as _sys
8
+ from superghidra.lifters import arm_thumb_decode as _mod
9
+ from superghidra.lifters.arm_thumb_decode import * # noqa: F401,F403
10
+
11
+ if __name__ == "__main__":
12
+ import runpy as _runpy
13
+ _runpy.run_module("superghidra.lifters.arm_thumb_decode", run_name="__main__", alter_sys=True)
14
+ else:
15
+ _sys.modules[__name__] = _mod
@@ -0,0 +1,15 @@
1
+ """Backward-compatibility shim for `binary_diff_engine`.
2
+
3
+ Canonical location: `superghidra.diff.binary_diff_engine`.
4
+ """
5
+ from __future__ import annotations
6
+
7
+ import sys as _sys
8
+ from superghidra.diff import binary_diff_engine as _mod
9
+ from superghidra.diff.binary_diff_engine import * # noqa: F401,F403
10
+
11
+ if __name__ == "__main__":
12
+ import runpy as _runpy
13
+ _runpy.run_module("superghidra.diff.binary_diff_engine", run_name="__main__", alter_sys=True)
14
+ else:
15
+ _sys.modules[__name__] = _mod
@@ -0,0 +1,15 @@
1
+ """Backward-compatibility shim for `binary_loader`.
2
+
3
+ Canonical location: `superghidra.formats.binary_loader`.
4
+ """
5
+ from __future__ import annotations
6
+
7
+ import sys as _sys
8
+ from superghidra.formats import binary_loader as _mod
9
+ from superghidra.formats.binary_loader import * # noqa: F401,F403
10
+
11
+ if __name__ == "__main__":
12
+ import runpy as _runpy
13
+ _runpy.run_module("superghidra.formats.binary_loader", run_name="__main__", alter_sys=True)
14
+ else:
15
+ _sys.modules[__name__] = _mod
@@ -0,0 +1,15 @@
1
+ """Backward-compatibility shim for `colab_cloud_orchestrator`.
2
+
3
+ Canonical location: `superghidra.integrations.colab_cloud_orchestrator`.
4
+ """
5
+ from __future__ import annotations
6
+
7
+ import sys as _sys
8
+ from superghidra.integrations import colab_cloud_orchestrator as _mod
9
+ from superghidra.integrations.colab_cloud_orchestrator import * # noqa: F401,F403
10
+
11
+ if __name__ == "__main__":
12
+ import runpy as _runpy
13
+ _runpy.run_module("superghidra.integrations.colab_cloud_orchestrator", run_name="__main__", alter_sys=True)
14
+ else:
15
+ _sys.modules[__name__] = _mod
@@ -0,0 +1,15 @@
1
+ """Backward-compatibility shim for `cross_platform_headless_harness`.
2
+
3
+ Canonical location: `superghidra.core.cross_platform_headless_harness`.
4
+ """
5
+ from __future__ import annotations
6
+
7
+ import sys as _sys
8
+ from superghidra.core import cross_platform_headless_harness as _mod
9
+ from superghidra.core.cross_platform_headless_harness import * # noqa: F401,F403
10
+
11
+ if __name__ == "__main__":
12
+ import runpy as _runpy
13
+ _runpy.run_module("superghidra.core.cross_platform_headless_harness", run_name="__main__", alter_sys=True)
14
+ else:
15
+ _sys.modules[__name__] = _mod