Expand description
Reads Unity Il2Cpp games, to generate .NET proxy assemblies with hao.
Work in progress: metadata v29 with ELF game binaries.
Game is the entry point. It finds a game’s global-metadata.dat and
GameAssembly, and gives types, fields and methods by name with their types
resolved:
use hao_il2cpp::Game;
let game = Game::open("path/to/game")?;
let string = game.find_type("System.String").unwrap();
for method in string.methods() {
println!("{}", method); // `static string Concat(string str0, string str1)`
}
game.write_assemblies("out")?;Underneath, Metadata reads global-metadata.dat, Binary reads the
Il2CppType table from the game binary, and generate() builds the
declaration assemblies.
Re-exports§
pub use binary::Binary;pub use game::FieldView;pub use game::Game;pub use game::MethodView;pub use game::ParameterView;pub use game::TypeView;pub use generate::generate;pub use generate::GeneratedAssembly;pub use metadata::Metadata;
Modules§
- binary
- The game binary (
GameAssembly): the registration tables and theIl2CppTypetable that metadata type indices refer to. - game
- A high level view of an Il2Cpp game: types, fields and methods by name, with their types already resolved.
- generate
- Generates declaration assemblies (“dummy DLLs”) from Il2Cpp metadata: every type, field, method signature, property and event, with stub method bodies.
- metadata
global-metadata.dat: names and the shape of every type, method and field.
Structs§
- ElfImage
- A loaded ELF image (e.g. a
.so). Pointers are resolved through the relocation table, since ELF stores relative relocations rather than absolute addresses. - PeImage
- A loaded PE image (e.g. a
.dll). Pointers stored in a PE hold absolute virtual addresses at the preferred image base, so no relocation step is needed: the on-disk values and the addresses computed here share that base.
Enums§
- AnyImage
- A PE or ELF image, as detected by
AnyImage::load. - Error
Traits§
- Loaded
Image - Reads a loaded binary by virtual address, as it will be after relocation.