vasie commited on
Commit
de93233
·
1 Parent(s): c930535

Add per-sample metrics + dataset-viewer card

Browse files

metrics/*.jsonl: one row per sample (path, source, in/out bytes, kept%,
opaque in→out, and the input/output code), sharded under 10MB so the HF
Dataset Viewer renders a browsable in→out table without LFS. README card
points the viewer at metrics/*.jsonl and embeds the aggregate scoreboard.

README.md CHANGED
@@ -1,3 +1,93 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ pretty_name: devirt-corpus
4
+ tags:
5
+ - code
6
+ - javascript
7
+ - deobfuscation
8
+ - obfuscation
9
+ size_categories:
10
+ - 1K<n<10K
11
+ configs:
12
+ - config_name: default
13
+ data_files:
14
+ - split: train
15
+ path: metrics/*.jsonl
16
  ---
17
+
18
+ # devirt-corpus
19
+
20
+ A corpus of obfuscated JavaScript with **per-sample deobfuscation metrics** for
21
+ the [`devirt-core`](https://github.com/devirt-dev/devirt-core) engine. Every
22
+ sample is run through the deobfuscator; the input (obfuscated) bytes, the output
23
+ (deobfuscated) bytes, and readability scores are published in `metrics.jsonl`.
24
+
25
+ 👉 **Use the Dataset Viewer above** to browse all 9,514 samples — filter by
26
+ `source`, sort by `kept_pct`/`opaque_out`, and read each sample's `input` next
27
+ to its `output`.
28
+
29
+ ## What's measured
30
+
31
+ | column | meaning |
32
+ |---|---|
33
+ | `path` | sample path in this repo |
34
+ | `source` | technique / origin (e.g. `generated/strings_rc4`, `real/tranco`) |
35
+ | `in_bytes` / `out_bytes` | obfuscated input vs. deobfuscated output size |
36
+ | `kept_pct` | `out_bytes / in_bytes` — lower means more dead weight removed (on real *minified* input this exceeds 100% because the engine reformats/expands it; readability, not size, is the win there) |
37
+ | `opaque_in` → `opaque_out` | % of identifiers that look machine-generated (hex `_0x…` or 1–2 chars) before vs. after — **the headline readability metric** |
38
+ | `input` / `output` | the actual obfuscated and deobfuscated source |
39
+
40
+ ## Scoreboard
41
+
42
+ Aggregate over the whole corpus, by source. Generated with
43
+ `cargo run --release --bin report -- --markdown` in `devirt-core`.
44
+
45
+ | source | files | in bytes | out bytes | kept% | opaque% in→out |
46
+ |---|--:|--:|--:|--:|--:|
47
+ | `generated/cf_dead` | 500 | 754109 | 61635 | 8% | 51.6% → 3.9% |
48
+ | `generated/controlflow` | 500 | 762150 | 63133 | 8% | 51.5% → 4.2% |
49
+ | `generated/controlflow_half` | 500 | 705909 | 63089 | 8% | 51.3% → 4.2% |
50
+ | `generated/deadcode` | 500 | 637045 | 61819 | 9% | 50.9% → 4.0% |
51
+ | `generated/minimal` | 500 | 638935 | 60273 | 9% | 50.9% → 3.7% |
52
+ | `generated/names_hex` | 500 | 642247 | 64967 | 10% | 52.6% → 11.3% |
53
+ | `generated/names_mangled` | 500 | 406652 | 58959 | 14% | 52.7% → 11.8% |
54
+ | `generated/numbers` | 500 | 838299 | 61909 | 7% | 39.3% → 4.0% |
55
+ | `generated/objectkeys` | 500 | 641608 | 61241 | 9% | 51.0% → 4.0% |
56
+ | `generated/sa_cf` | 500 | 2019731 | 61280 | 3% | 60.0% → 3.7% |
57
+ | `generated/sa_numbers` | 500 | 1519510 | 61188 | 4% | 44.3% → 3.7% |
58
+ | `generated/splitstrings` | 500 | 646336 | 60023 | 9% | 51.0% → 3.7% |
59
+ | `generated/strings_b64` | 500 | 1164235 | 61346 | 5% | 58.2% → 3.7% |
60
+ | `generated/strings_indexshift` | 500 | 1894140 | 61255 | 3% | 60.8% → 3.7% |
61
+ | `generated/strings_none` | 500 | 647016 | 59997 | 9% | 50.9% → 3.7% |
62
+ | `generated/strings_rc4` | 500 | 1876836 | 61506 | 3% | 60.4% → 3.7% |
63
+ | `generated/strings_rotate` | 500 | 1164235 | 61346 | 5% | 58.2% → 3.7% |
64
+ | `generated/strings_wrappers` | 500 | 2098975 | 61665 | 2% | 61.0% → 3.6% |
65
+ | `generated/strong` | 500 | 2604260 | 108691 | 4% | 48.4% → 3.7% |
66
+ | `real/tranco` | 14 | 601126 | 982004 | 163% | 49.6% → 7.4% |
67
+ | **TOTAL** | **9514** | **22263354** | **2197326** | **9%** | **52.9% → 4.6%** |
68
+
69
+ **Headline:** across 9,514 samples the engine cuts machine-generated identifiers
70
+ from **52.9% to 4.6%**. The `names_hex` / `names_mangled` rows (~11%) are the
71
+ honest weak spot — pure identifier renaming can't be reversed to semantic names.
72
+
73
+ ## Layout
74
+
75
+ - `generated/<profile>/<seed>.js` — 500 deterministic seeds × 19
76
+ [javascript-obfuscator](https://github.com/javascript-obfuscator/javascript-obfuscator)
77
+ profiles.
78
+ - `real/<source>/…` — real-world scripts (crawled top sites; npm bundles; HTTP
79
+ Archive), filtered + deduped.
80
+ - `seeds/` — the plain source programs the generated set is built from.
81
+ - `metrics/*.jsonl` — the per-sample table above; powers the Dataset Viewer
82
+ (sharded to stay under HF's 10 MB-per-file limit).
83
+
84
+ Regenerate the scores from scratch:
85
+
86
+ ```sh
87
+ git clone https://github.com/devirt-dev/devirt-core && cd devirt-core
88
+ scripts/pull-corpus.sh
89
+ cargo run --release --bin report -- --json samples/metrics.jsonl --markdown
90
+ # shard for HF (>10 MB files need LFS otherwise):
91
+ mkdir -p samples/metrics && split -C 9000000 -d --additional-suffix=.jsonl \
92
+ samples/metrics.jsonl samples/metrics/part- && rm samples/metrics.jsonl
93
+ ```
metrics/part-00.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
metrics/part-01.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
metrics/part-02.jsonl ADDED
The diff for this file is too large to render. See raw diff