From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:GDScript binary tokens" |
|---|
| claim | "Identifier strings in compiled GDScript are obfuscated by XOR with 0xB6 per byte: Godot 4 (tokenizer buffer, read at the cited commit) stores each as UTF-32 code units (all four bytes of each unit XORed) after a u32 length in code units, Godot 3 style bytecode (gdsdecomp reads every bytecode version below its GDScript 2.0 version value with this path) as bytes, the stored length including a NUL terminator, after a u32 length. In Godot 4 the content after the 12-byte header may be zstd compressed." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:GDScript binary tokens" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "parsing identifier table" |
|---|
| effect | "byte ^ 0xB6" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "Godot 4 reader XOR 0xb6 on UTF-32 units." |
|---|
| repo | "https://github.com/godotengine/godot" |
|---|
| commit | "81ab961f91066a63bcbf3ec340962bb1a1ada558" |
|---|
| path | "modules/gdscript/gdscript_tokenizer_buffer.cpp" |
|---|
| lines | "165-185" |
|---|
|
| type | "source" |
|---|
| detail | "Godot 3 path: cs[j] = b[j] ^ 0xb6, data from byte 24, counts at 8/12/16/20." |
|---|
| repo | "https://github.com/GDRETools/gdsdecomp" |
|---|
| commit | "e2780fcc73ab14083967d3945e513d1f6af1dbd0" |
|---|
| path | "bytecode/bytecode_base.cpp" |
|---|
| lines | "318-350" |
|---|
|
| type | "source" |
|---|
| detail | "get_script_state dispatches on bytecode_version >= GDSCRIPT_2_0_VERSION; the else branch get_ids_consts_tokens (identifiers from byte 24, length in bytes, last byte overwritten with 0) has no 12-13 restriction. gdscript_tokenizer_buffer.cpp decompresses with zstd when the decompressed size field is non-zero." |
|---|
| repo | "https://github.com/GDRETools/gdsdecomp" |
|---|
| commit | "e2780fcc73ab14083967d3945e513d1f6af1dbd0" |
|---|
| path | "bytecode/bytecode_base.cpp" |
|---|
| lines | "299-350" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Identifier XOR 0xB6" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T21:57:23.807Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T07:02:23.875Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read godot gdscript_tokenizer_buffer.cpp at 81ab961 lines 140-200 (12-byte header, zstd when decompressed size non-zero, UTF-32 units XOR 0xb6) and gdsdecomp bytecode_base.cpp at e2780fc lines 295-350 (get_script_state dispatch on >= GDSCRIPT_2_0_VERSION; else-branch byte XOR 0xb6, last byte overwritten with 0, data from byte 24). Matches." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T04:14:02.948Z" |
|---|
| summary | "Dropped the unsupported 'bytecode 12-13' range: the gdsdecomp function cited serves every bytecode version below the GDScript 2.0 value. Read get_script_state and get_ids_consts_tokens whole." |
|---|
| changed | |
|---|
|
|
|---|