Available on crate feature
hao only.Expand description
Rewrite a managed assembly’s IL with hao before the runtime JITs it.
The Godot/CoreCLR modding path: a native mod intercepts the game assembly’s
load (see intercept_assembly) and hands CoreCLR a hao-rewritten copy. The
rewrite (patch_call) adds a [DllImport]-style P/Invoke to a function the
mod exports and calls it from a lifecycle method — so the method the engine
already runs each frame on the main thread now also calls back into Rust. No
injected assembly, no C#; pure LD_PRELOAD + hao.
Functions§
- arm_
interception Unix and x86-64 - Installs the open/openat hooks so registered targets are intercepted.
Called automatically after
coreclr_initializereturns — the CLR is loaded but managed assemblies haven’t been opened yet. - intercept_
assembly Unix and x86-64 - Serves a rewritten copy of
basename(matched by file name) whenever the runtime opens it.patchreceives the original bytes and returns the replacement (seepatch_call). Call it from a mod’s entry point, before the runtime loads the assembly. - patch_
call - Rewrites
assemblysotype_name::method_namebegins by calling the native functionsymbol, exported fromlibrary(resolved as a[DllImport]). Returns the patched assembly bytes.