๐๏ธ Installation
Obfuz Unity Package Manager URL installation addresses:
๐๏ธ Configuration
Obfuz provides extremely rich configuration options and flexible obfuscation rule configuration files to support various complex requirements of commercial game projects.
๐๏ธ Editor Menu
|Menu|Description|
๐๏ธ Assemblies
Assembly Types
๐๏ธ Encryption
Encryption is the core mechanism of Obfuz. Most Obfuscation Passes are related to encryption for the following reasons:
๐๏ธ Method Body Obfuscation
Method body obfuscation is actually called code obfuscation. Some Obfuscation Passes for method body obfuscation in Obfuz have unified rules, so they are introduced separately in this document.
๐๏ธ Obfuscation Pass
Obfuz supports multiple obfuscation algorithms. During obfuscation, each obfuscation algorithm is executed sequentially in a specific order, ultimately outputting the obfuscated assemblies. Since these obfuscation algorithms are executed in passes, we call them Obfuscation Passes.
๐๏ธ Obfuz CustomAttributes
Obfuz provides various CustomAttributes for conveniently configuring obfuscation rules directly in code. Currently supported CustomAttributes include:
๐๏ธ Obfuscation Instincts
The Obfuz.ObfuscationInstincts class provides special functions to obtain obfuscation-related metadata information.
๐๏ธ Symbol Obfuscation
Symbols refer to metadata with names in assemblies. Symbol obfuscation replaces the names of these symbols with obfuscated names while fixing all metadata that references these symbols to ensure reference correctness.
๐๏ธ Constant Encryption
Encrypting constants that appear in code can effectively protect code security.
๐๏ธ Remove Const Fields
Const constant fields are meaningful mostly only in source code. When compiled to dll, access to constant fields is inlined, meaning the compiled code does not reference const fields.
๐๏ธ Field Encryption
Encrypting field values can effectively prevent malicious attackers from using memory modification techniques to protect code security.
๐๏ธ Eval Stack Obfuscation
Randomly obfuscate the execution stack during virtual machine runtime to increase reverse engineering difficulty.
๐๏ธ Expression Obfuscation
Obfuscate expressions appearing in code to increase reverse engineering difficulty.
๐๏ธ Function Call Obfuscation
Function call obfuscation disguises how functions (static, member, or virtual) are called in code. After decompilation, it's impossible to directly know which function is being executed, effectively protecting code security.
๐๏ธ Control Flow Obfuscation
Control flow obfuscation can obfuscate the direction of code control flow, making it difficult to analyze the actual execution flow of code.
๐๏ธ Code Watermark
Obfuz injects special metadata and specific instruction sequences into obfuscated assembly metadata to form identifiable watermark features.
๐๏ธ Garbage Code Generation
Garbage code generation can reduce binary code similarity between apps and other apps, used to counter app store similarity reviews.
๐๏ธ Obfuscation During Build Process
Obfuz automatically performs obfuscation during Unity's build process.
๐๏ธ Run Obfuscation Standalone
Sometimes it's necessary to run obfuscation outside of the build pipeline. For example, when using HybridCLR hot updates, you want to obfuscate the hot update code before releasing it.
๐๏ธ Incremental Obfuscation and Hot Update
Obfuz supports incremental obfuscation, with most Obfuscation Passes striving to maintain obfuscation stability.
๐๏ธ Serialization
Symbol Obfuscation modifies the names of various metadata. Unity's built-in serialization mechanisms like MonoBehaviour, ScriptableObject, and JsonUtility heavily depend on metadata name information,
๐๏ธ Reflection
Symbol Obfuscation modifies the names of various metadata. This causes reflection lookups for types, functions, fields, etc. by name to fail.
๐๏ธ Impact on Assembly Size
Since obfuscation modifies dll code, the assembly size will change after obfuscation. Generally speaking, except for Symbol Obfus which reduces assembly size, all other obfuscation passes will increase assembly size, but each pass has different impacts.
๐๏ธ HybridCLR
2 items
๐๏ธ xLua
1 item
๐๏ธ Deobfuscate Stack Trace
After obfuscation, the function stack in logs output from code uses obfuscated names, which creates significant obstacles for tracking issues. Manually restoring the original stack by comparing the symbol mapping file (see Symbol Obfuscation documentation) that records the mapping relationship between original functions and obfuscated functions is very tedious. Obfuz provides the DeobfuscateStackTrace tool to automate the restoration of obfuscated stacks.