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§
- intercept_
assembly - 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.