Expand description
§cleat — Android IL2CPP game modding toolkit
Safe Rust bindings over IL2CPP. Read fields, call methods, install inline hooks — the unsafe stays inside the library.
§Quick example
ⓘ
use cleat::prelude::*;
#[cleat::main]
fn my_mod() -> cleat::Result<()> {
cleat::set_app_data("/data/data/com.example.game/files");
let player = Il2CppClass::find("Player")?;
let max_hp: i32 = player.static_field_value("maxHealth")?;
Ok(())
}
#[cleat::hook("Assembly-CSharp", "Player", "TakeDamage")]
fn god_mode(this: &Il2CppObject, damage: i32) -> cleat::Result<()> {
// Nullify incoming damage.
god_mode::original(this, 0);
Ok(())
}§Features
- Field access — read and write static/instance fields.
- Method calls — parameterised and generic methods supported.
- Inline hooks —
#[cleat::hook]wraps ShadowHook, no manual trampoline code. - Custom value types —
#[cleat::value_type]derives FFI-safe read/write for your#[repr(C)]structs.
§Setup
[lib]
crate-type = ["cdylib"]
[dependencies]
cleat = "0.1"cargo ndk -t arm64-v8a -o ./target/jniLibs build --release§Requirements
- Rust nightly (edition 2024)
- Android NDK r26+
- cargo-ndk ≥ 3.0
- libshadowhook.so (runtime, bundled in the APK)
Modules§
- prelude
- cleat prelude — imports all commonly used types in one line.
Structs§
- Hook
Guard - Desktop stub — allows
cargo checkon non-Android platforms. Hooks are no-ops and will fail gracefully at runtime. - Il2Cpp
Array - Wrapper around a managed
T[]array. - Il2Cpp
Class - A handle to an IL2CPP class (type metadata, not an instance).
- Il2Cpp
List - Direct memory mapping of .NET’s
List<T>. - Il2Cpp
Object - A handle to a live managed object on the IL2CPP heap.
- Il2Cpp
String - A managed
System.String— cheap to copy (it’s just a pointer). - Method
Info - Handle to an IL2CPP method.
Enums§
- Error
- All the ways a cleat operation can fail.
Traits§
- Args
- Converts a tuple of arguments into an array of FFI raw pointers.
- Il2Cpp
Value Type - Marks a type that can be shuttled across the IL2CPP FFI boundary.
Functions§
- app_
data - Get the app data directory that was set with
set_app_data. - init
- Desktop stub — init is a no-op outside Android.
- invoke_
icall_ ⚠0 - Safety
- invoke_
icall_ ⚠1 - Safety
- invoke_
icall_ ⚠2 - Safety
- invoke_
icall_ ⚠3 - Safety
- resolve_
icall - Resolve an IL2CPP internal call (iCall) by its fully qualified name.
- set_
app_ data - Tell cleat where your app’s private files live.
Type Aliases§
- Quaternion
- Result
- The standard result alias used everywhere in cleat.
- Vector2
- Vector3
- Vector4
Attribute Macros§
- hook
- Injects an inline hook for the given method.
- main
- Wraps your function in the Android entry point.
- value_
type - Derives
Il2CppValueTypefor a#[repr(C)]struct.