rust-deobf 0.1.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.
Files changed (68) hide show
  1. rust_deobf-0.1.0/CHANGELOG.md +111 -0
  2. rust_deobf-0.1.0/CLA.md +48 -0
  3. rust_deobf-0.1.0/LICENSE +201 -0
  4. rust_deobf-0.1.0/LICENSING.md +46 -0
  5. rust_deobf-0.1.0/MANIFEST.in +7 -0
  6. rust_deobf-0.1.0/PKG-INFO +976 -0
  7. rust_deobf-0.1.0/README.md +927 -0
  8. rust_deobf-0.1.0/pyproject.toml +70 -0
  9. rust_deobf-0.1.0/rust_deobf.egg-info/PKG-INFO +976 -0
  10. rust_deobf-0.1.0/rust_deobf.egg-info/SOURCES.txt +66 -0
  11. rust_deobf-0.1.0/rust_deobf.egg-info/dependency_links.txt +1 -0
  12. rust_deobf-0.1.0/rust_deobf.egg-info/entry_points.txt +2 -0
  13. rust_deobf-0.1.0/rust_deobf.egg-info/requires.txt +21 -0
  14. rust_deobf-0.1.0/rust_deobf.egg-info/top_level.txt +1 -0
  15. rust_deobf-0.1.0/scripts/__init__.py +190 -0
  16. rust_deobf-0.1.0/scripts/__main__.py +9 -0
  17. rust_deobf-0.1.0/scripts/_version.py +10 -0
  18. rust_deobf-0.1.0/scripts/bench_emu.py +902 -0
  19. rust_deobf-0.1.0/scripts/cli.py +792 -0
  20. rust_deobf-0.1.0/scripts/data/libfunc_sigs.json +1391 -0
  21. rust_deobf-0.1.0/scripts/data/libfunc_sigs_std.json.gz +0 -0
  22. rust_deobf-0.1.0/scripts/data/runtime_sigs.json +234 -0
  23. rust_deobf-0.1.0/scripts/data/rust_versions.json +474 -0
  24. rust_deobf-0.1.0/scripts/decompiler_bridge.py +1771 -0
  25. rust_deobf-0.1.0/scripts/decompiler_selfcheck.py +260 -0
  26. rust_deobf-0.1.0/scripts/decompress.py +1153 -0
  27. rust_deobf-0.1.0/scripts/detect_vm.py +175 -0
  28. rust_deobf-0.1.0/scripts/disasm.py +193 -0
  29. rust_deobf-0.1.0/scripts/dump_unpacked.py +369 -0
  30. rust_deobf-0.1.0/scripts/emu_backend.py +273 -0
  31. rust_deobf-0.1.0/scripts/export_rules.py +618 -0
  32. rust_deobf-0.1.0/scripts/floss_export.py +186 -0
  33. rust_deobf-0.1.0/scripts/gen_runtime_sigs.py +257 -0
  34. rust_deobf-0.1.0/scripts/gen_sigdb.py +1912 -0
  35. rust_deobf-0.1.0/scripts/ghidra_annotate.py +591 -0
  36. rust_deobf-0.1.0/scripts/ghidra_dump_annotations.py +23 -0
  37. rust_deobf-0.1.0/scripts/llm_triage.py +285 -0
  38. rust_deobf-0.1.0/scripts/mcp_server.py +610 -0
  39. rust_deobf-0.1.0/scripts/recover.py +514 -0
  40. rust_deobf-0.1.0/scripts/recover_antianalysis.py +431 -0
  41. rust_deobf-0.1.0/scripts/recover_apihash.py +254 -0
  42. rust_deobf-0.1.0/scripts/recover_arm64.py +344 -0
  43. rust_deobf-0.1.0/scripts/recover_artifacts.py +335 -0
  44. rust_deobf-0.1.0/scripts/recover_async.py +3132 -0
  45. rust_deobf-0.1.0/scripts/recover_behavior.py +167 -0
  46. rust_deobf-0.1.0/scripts/recover_blobs.py +649 -0
  47. rust_deobf-0.1.0/scripts/recover_callsite.py +659 -0
  48. rust_deobf-0.1.0/scripts/recover_cfg.py +558 -0
  49. rust_deobf-0.1.0/scripts/recover_cryptify.py +199 -0
  50. rust_deobf-0.1.0/scripts/recover_crypto.py +305 -0
  51. rust_deobf-0.1.0/scripts/recover_dynamic.py +271 -0
  52. rust_deobf-0.1.0/scripts/recover_embedded.py +336 -0
  53. rust_deobf-0.1.0/scripts/recover_emulate.py +3834 -0
  54. rust_deobf-0.1.0/scripts/recover_enums.py +403 -0
  55. rust_deobf-0.1.0/scripts/recover_go.py +390 -0
  56. rust_deobf-0.1.0/scripts/recover_idioms.py +3458 -0
  57. rust_deobf-0.1.0/scripts/recover_imports.py +311 -0
  58. rust_deobf-0.1.0/scripts/recover_lang.py +254 -0
  59. rust_deobf-0.1.0/scripts/recover_libfuncs.py +1118 -0
  60. rust_deobf-0.1.0/scripts/recover_rust_meta.py +507 -0
  61. rust_deobf-0.1.0/scripts/recover_rust_strings.py +713 -0
  62. rust_deobf-0.1.0/scripts/recover_stackstrings.py +341 -0
  63. rust_deobf-0.1.0/scripts/recover_types.py +427 -0
  64. rust_deobf-0.1.0/scripts/soc_triage.py +387 -0
  65. rust_deobf-0.1.0/scripts/unpack.py +219 -0
  66. rust_deobf-0.1.0/scripts/unpack_emulate.py +922 -0
  67. rust_deobf-0.1.0/setup.cfg +4 -0
  68. rust_deobf-0.1.0/setup.py +68 -0
@@ -0,0 +1,111 @@
1
+ # Changelog
2
+
3
+ All notable changes to rust-deobf are recorded here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
5
+ [Semantic Versioning](https://semver.org/) (pre-1.0: a minor bump may change a tool's `--json`
6
+ shape or CLI flags; a patch bump never does). The `rust-deobf` and `rust-deobf-premium`
7
+ distributions always share one version.
8
+
9
+ ## [Unreleased]
10
+
11
+ ## [0.1.0rc2] - 2026-11-11
12
+
13
+ Second release candidate. 0.1.0rc1 published nothing: its installed-wheel test failed on Windows +
14
+ Python 3.10 (release run 42976295297), so neither distribution reached PyPI.
15
+
16
+ ### Fixed
17
+ - **Installed std signature layer.** The wheel did not ship `data/libfunc_sigs_std.json.gz`
18
+ (package-data matched `data/*.json` only) and `recover_libfuncs` looked for it under
19
+ `site-packages/scripts/`; an installed rust-deobf therefore loaded no prebuilt-std signatures
20
+ (0 instead of 4989). Both fixed; `rust-deobf doctor` checks the file.
21
+ - **Library mode put `site-packages/scripts` first on `sys.path`.** `gen_sigdb` and every premium
22
+ module inserted `<parent of the package>/scripts` -- the clone's `scripts/`, but a foreign
23
+ directory once installed. Had another distribution installed a top-level `scripts` package, its
24
+ modules (`recover`, ...) would have shadowed the host program's. Clone-only paths are now added
25
+ only in a checkout.
26
+ - The installed-wheel test compared `sys.path` entries with `==`; Windows Python 3.10 spells a
27
+ venv's site-packages `lib` while the resolved package path is `Lib`. It now compares normalised
28
+ paths, and also fails if importing the modules adds any other `sys.path` entry.
29
+ - **capstone / unicorn are always installed.** Their `platform_machine != "ARM64"` marker (meant for
30
+ native ARM64 Python, which has no wheels) also matched x64 Python 3.14 on Windows-on-ARM --
31
+ `platform_machine` is the host CPU there -- so pip left both out of the recommended setup.
32
+ Native ARM64 Python now fails at `pip install` instead (README: use x64 Python).
33
+ - **Emulation: an AEAD's last block with its scratch neighbours** is no longer reported as a string
34
+ (`:gUnmetry-offa` next to `...telemetry-off`; obfuse_aes on AArch64).
35
+
36
+ ### Changed
37
+ - **The benchmark gate is deterministic.** Four benchmark crates draw fresh keys per build, and the
38
+ per-push verdict followed the key (VALIDATION §77). `bench_src/*/Cargo.lock` is committed, obfuse
39
+ / obfuse_aes / obfuse_xor are built with a fixed `seed=` per literal, and muddy (unseedable) runs
40
+ in the weekly schedule only. Earlier one-build recall/precision figures are single samples.
41
+
42
+ ## [0.1.0rc1] - 2026-11-11
43
+
44
+ Release candidate for 0.1.0: the first end-to-end run of the release pipeline -- build, the
45
+ installed-wheel tests on four operating systems, and Trusted Publishing to PyPI for both
46
+ distributions. The content is the 0.1.0 section below.
47
+
48
+ ## [0.1.0] - 2026-11-11
49
+
50
+ First packaged release on PyPI (`pip install rust-deobf` / `pipx install rust-deobf`; premium
51
+ modules via `pip install "rust-deobf[premium]"`). Everything below was developed in the open
52
+ before packaging and is summarised by theme.
53
+
54
+ ### Added
55
+ - **Packaging and the `rust-deobf` command.** One console command dispatching to every tool
56
+ (`rust-deobf recover|triage|unpack|metadata|imports|cfg|...`), plus `rust-deobf list`,
57
+ `rust-deobf doctor` (Python, dependency, platform and optional-tool checks) and
58
+ `rust-deobf --version`; `python -m rust_deobf` works too. The Apache-2.0 core ships as
59
+ `rust-deobf`; the premium modules ship separately as `rust-deobf-premium`
60
+ (`pip install "rust-deobf[premium]"`). Extras: `dynamic` (Frida), `rules` (yara-python,
61
+ flare-capa), `dev`. Release pipeline on `v*` tags with installed-wheel smoke tests on Linux,
62
+ Windows and macOS, PyPI Trusted Publishing and a GitHub Release. The clone-and-run workflow
63
+ (`python3 scripts/<tool>.py`) is unchanged.
64
+ - **String recovery.** Unified front end `recover.py` (static call-site dataflow for x86-64 and
65
+ AArch64, stack strings, Rust `&str` literal splitting, `cryptify`, hash-obfuscated API imports)
66
+ with isolated engines, exit codes, batch/JSONL mode and a FLOSS-compatible export.
67
+ - **Emulation.** Unicorn engine with a real loader (ELF/PE/Mach-O, TLS, chained fixups), a C
68
+ runtime, path exploration and global-constructor replay; hard resource caps found by fuzzing
69
+ the analyzer itself (`fuzz_recover.py`).
70
+ - **Metadata and structure.** Rust toolchain/crate/panic-site recovery that survives `strip`;
71
+ library-function identification by byte signature with call-graph propagation; trait-object and
72
+ C++ (Itanium) vtables/RTTI; enum discriminant/niche layout (DWARF names when present); Go pclntab
73
+ names; resolved call graph + coverage; per-function behavior and source-language maps;
74
+ crypto-constant identification; anti-analysis inventory and build provenance.
75
+ - **Triage and integration.** One-screen SOC triage card with calibrated signal, LLM-assisted
76
+ triage over the deterministic facts, capa + YARA rule export, an MCP server (stdio), headless
77
+ Ghidra annotation, a uniform `--json` output contract across result-producing tools.
78
+ - **Deobfuscation tiers (premium, AGPL-3.0-or-later OR commercial).** Control-flow-flattening
79
+ detection and de-flattening (x86-64 + AArch64), provable MBA/expression simplification with Z3,
80
+ opaque-predicate detection with a sound per-flag model, static and emulation-based VM
81
+ devirtualization (randomized opcodes, encrypted operands, relooper structuring), and
82
+ optimization reversal (jump-table un-switching, unrolled loops).
83
+ - **Unpacking.** Static unpacking by emulation to the original entry point (UPX and UPX-like,
84
+ PE/ELF, x86-64/x86/AArch64, staged packers) with import-table reconstruction; embedded-artifact
85
+ carving and keyless blob triage; an opt-in dynamic (Frida) dump cross-validated against the
86
+ static result. Nothing executes a sample by default.
87
+ - **Cross-platform.** Verified on x86-64 Linux, ARM64 Kali and Windows x64 (x64 Python on
88
+ Windows-on-ARM); test fixtures build for the host architecture.
89
+
90
+ - **October 2026 round (VALIDATION.md §62–§70).** Keyless LZ4 / aPLib / BriefLZ / LZNT1
91
+ decompression in blob triage (`decompress.py`); async `Future::poll` state machines
92
+ (`recover_async.py`, rustc 1.70–1.99, ELF/PE/Mach-O, x86-64/AArch64/i386); per-binary
93
+ library-signature DBs for the binary's own rustc, target and crates (`gen_sigdb.py`) plus a
94
+ bundled std layer for AArch64 and PE; Rust idioms in stripped binaries -- format strings with
95
+ their traits, panic/safety checks with `file:line:col`, drops, enum-like returns
96
+ (`recover_idioms.py`, annotated in Ghidra); a bridge pushing all of it into a running GhidraMCP or
97
+ ida-pro-mcp (`decompiler_bridge.py`, `decompiler_selfcheck.py`); 32-bit PE emulation; the 2026
98
+ obfuscation crates obfuse and obfany in the benchmark; ~1.4–1.6x faster emulation and 2.5–3.7x
99
+ faster devirtualisation with identical output.
100
+
101
+ ### Fixed
102
+ - A full bug-review round across the toolkit (emulator `.bss`/TLS/strlen edge cases, embedded and
103
+ blob carving bounds, import binding past junk bytes and on ARM64, YARA/capa output that always
104
+ compiles, MCP JSON-RPC edge cases, Go pclntab layouts, enum/crypto/lang/antianalysis false
105
+ positives, sound opaque-predicate lifting, ARM64 loop decoding in `opt_reverse`, batch `--json`
106
+ that survives one failing target), plus Windows and AArch64 portability fixes.
107
+
108
+ [Unreleased]: https://github.com/VAHPEM/rust-deobf/compare/v0.1.0...HEAD
109
+ [0.1.0rc2]: https://github.com/VAHPEM/rust-deobf/releases/tag/v0.1.0rc2
110
+ [0.1.0rc1]: https://github.com/VAHPEM/rust-deobf/releases/tag/v0.1.0rc1
111
+ [0.1.0]: https://github.com/VAHPEM/rust-deobf/releases/tag/v0.1.0
@@ -0,0 +1,48 @@
1
+ # Contributor License Agreement (CLA)
2
+
3
+ This project uses an open-core model (see [`LICENSING.md`](LICENSING.md)). To keep the premium
4
+ modules dual-licensable (AGPL-3.0-or-later **or** commercial), the author must retain the full set
5
+ of rights in all contributed premium code. This CLA records that.
6
+
7
+ > **Status: draft.** This is a starting point, not legal advice. Before relying on it commercially,
8
+ > have it reviewed by an IP lawyer, and consider a standard instrument (for example the Apache
9
+ > Individual CLA, or a DCO for the core).
10
+
11
+ ## 1. Scope
12
+
13
+ - Contributions to the **core** (everything outside `premium/`, licensed Apache-2.0) are accepted
14
+ **inbound = outbound**: you license your contribution under Apache-2.0. A Developer Certificate of
15
+ Origin (`Signed-off-by:`) sign-off is sufficient.
16
+ - Contributions to **`premium/`** (dual-licensed) require agreeing to the terms below.
17
+
18
+ ## 2. Copyright license
19
+
20
+ You grant the author (Ve / VAHPEM) a perpetual, worldwide, non-exclusive, royalty-free, irrevocable
21
+ copyright license to reproduce, prepare derivative works of, publicly display, sublicense, and
22
+ distribute your contribution and such derivative works, **including the right to license your
23
+ contribution under both the AGPL-3.0-or-later and separate commercial terms.**
24
+
25
+ You retain all other rights, title, and interest in your contribution, and may use it elsewhere.
26
+
27
+ ## 3. Patent license
28
+
29
+ You grant the author and recipients a perpetual, worldwide, non-exclusive, royalty-free, irrevocable
30
+ patent license to make, use, sell, and otherwise transfer your contribution, for patent claims you
31
+ can license that are necessarily infringed by your contribution alone or in combination with the
32
+ project.
33
+
34
+ ## 4. Your representations
35
+
36
+ - The contribution is your original work, or you have the right to submit it under this CLA.
37
+ - The contribution does not knowingly violate any third party's rights.
38
+ - If your employer has rights to work you create, you have permission to contribute, or your
39
+ employer has waived such rights for contributions to this project.
40
+
41
+ ## 5. No warranty
42
+
43
+ The contribution is provided "as is", without warranty of any kind.
44
+
45
+ ---
46
+
47
+ To agree: add a `Signed-off-by: Name <email>` line to your commits (DCO) for core, and for premium
48
+ contributions state in your pull request that you agree to this CLA.
@@ -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 Ve Pham (VAHPEM)
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,46 @@
1
+ # Licensing
2
+
3
+ rust-deobf uses an **open-core** model. There are two tiers, with different licenses.
4
+
5
+ ## Core — Apache License 2.0
6
+
7
+ Everything in the repository **except** the `premium/` directory is licensed under the
8
+ Apache License 2.0 (see [`LICENSE`](LICENSE)). This is a permissive, OSI-approved license:
9
+ you may use it, including in closed-source and commercial products, with attribution and
10
+ subject to Apache 2.0's patent terms. The core is, and will stay, free.
11
+
12
+ This covers detection (including VM / anti-emulation detection), string and
13
+ metadata recovery, artifact/IOC extraction, and the SOC triage pipeline — the
14
+ capabilities that make the free tool useful on its own.
15
+
16
+ ## Premium modules — AGPL-3.0-or-later OR Commercial
17
+
18
+ Modules under the `premium/` directory are **dual-licensed**:
19
+
20
+ > Licensed under the GNU Affero General Public License v3.0 **or later**
21
+ > (AGPL-3.0-or-later), **OR** under a separate commercial license.
22
+ > Contact the author for commercial licensing.
23
+
24
+ - **AGPL-3.0-or-later** — free for open-source, research, and personal use. Note the AGPL's
25
+ network clause: if you run a modified version of a premium module as a network service,
26
+ you must offer that service's users the corresponding source. See [`premium/LICENSE`](premium/LICENSE).
27
+ - **Commercial license** — for using a premium module in a closed-source product or a hosted
28
+ service without the AGPL's source-disclosure obligations. Contact
29
+ **Ve (VAHPEM) &lt;ve0912084386@gmail.com&gt;**.
30
+
31
+ Each file under `premium/` carries an `SPDX-License-Identifier` header stating its license.
32
+ The per-file SPDX header is authoritative; GitHub's repository-level license badge reflects the
33
+ Apache-2.0 core only and does **not** relicense the premium modules.
34
+
35
+ ## Why two tiers
36
+
37
+ The core is a public good and a *produit d'appel* — it builds reputation and adoption. The
38
+ premium modules are the high-effort capabilities whose value the author chooses to protect and,
39
+ optionally, monetize. Keeping the copyright wholly with the author (see [`CLA.md`](CLA.md)) is
40
+ what makes the dual license possible.
41
+
42
+ ## Contributing
43
+
44
+ Contributions to **core** are accepted under Apache-2.0 inbound=outbound. Contributions to
45
+ **premium/** require signing the [Contributor License Agreement](CLA.md) so the dual-license can
46
+ be maintained. See [`CLA.md`](CLA.md).
@@ -0,0 +1,7 @@
1
+ # sdist of the core (rust-deobf). The package modules, scripts/data/*.json, pyproject.toml,
2
+ # setup.py, README.md and LICENSE are added by setuptools; premium/, tests/, bench_src/, build/,
3
+ # gallery/ and assets/ are deliberately NOT in the core sdist (premium/ is its own distribution).
4
+ include CHANGELOG.md LICENSING.md CLA.md
5
+ prune premium
6
+ prune tests
7
+ prune build