A cross-platform utility designed to automatically parse dump.cs generated by Il2CppDumper for Unity games and produce a C++ header file (.h) containing offset variables for fields and methods.
Supports both Windows and macOS.
- Place your
dump.csfile (exported from Il2CppDumper) in the following directory:
dump/dump.cs
- Create a
config.json(orconfig.jsonc) file:
{
"file_path": "dump/dump.cs",
"output_file": "DarkOffsets.h",
"offset_type": "VA",
"obfuscate": true,
"avoid_dup": true
}file_path: Path to yourdump.csfile.output_file: Name of the output.hheader file containing the generated offsets.offset_type: The offset representation type to extract:"RVA"– Relative Virtual Address"Offset"– Raw Offset"VA"– Virtual Address (Recommended)
obfuscate: If set totrue, wraps offset strings inENCRYPTOFFSET("..."). Iffalse, outputs raw hex values.avoid_dup: If set totrue, prefixes variable names as_class_fieldand_class_methodto prevent variable naming conflicts.
- Create a
function.json(orfunction.jsonc) file:
{
"UnityEngine": {
"Camera": {
"fields": ["onPreCull"],
"methods": [
{ "name": "get_main", "args": 0 }
]
}
}
}- Structure:
{ "Namespace": { "Class": { "fields": [...], "methods": [...] }}} fields: List of field names to extract.methods: Array of method objects specifyingname(method name) andargs(number of parameters).
Double-click the executable file:
Tool.exeDouble-click the .command file corresponding to your system architecture:
- Apple Silicon (M-Series Chips):
tool_arm64.command - Intel (x86_64 Chips):
tool_x86_64.command
(Note: If blocked by macOS Gatekeeper on the first run, open Terminal and grant permissions using: chmod +x tool_*.command && xattr -d com.apple.quarantine tool_*.command)
The tool will generate a C++ header file (e.g., DarkOffsets.h based on your config):
uint64_t _class_field = ENCRYPTOFFSET("0x123");
uint64_t _class_method = ENCRYPTOFFSET("0x12345678");