Skip to main content

Module game

Module game 

Source
Expand description

A high level view of an Il2Cpp game: types, fields and methods by name, with their types already resolved.

Game owns the parsed metadata and binary; TypeView, FieldView, MethodView and ParameterView are cheap borrowed views into it.

use hao_il2cpp::Game;

let game = Game::open("path/to/game")?;
let player = game.find_type("PlayerController").expect("no such type");
println!("{} : {:?}", player.full_name(), player.base_type_name());
for field in player.fields() {
    println!("    {field}"); // `float speed`, `static int count = 3`
}
if let Some(update) = player.find_method("Update") {
    println!("Update is at {:#x?}", update.code_address());
}

Structsยง

FieldView
A field of a TypeView. Its Display is C#-like: static int count = 3.
Game
A Unity Il2Cpp game: its metadata and the type table from its binary.
MethodView
A method of a TypeView. Its Display is a C#-like signature: static string Concat(string str0, string str1).
ParameterView
A parameter of a MethodView.
TypeView
A type definition in a Game, from Game::types or Game::find_type.