@efffrida/il2cpp-bridge
Effect integration for frida-il2cpp-bridge, for use inside frida agents that instrument Unity il2cpp applications.
FridaIl2cppBridge.il2cppPerformEffectruns an effect insideIl2Cpp.perform, so the caller thread is attached to the il2cpp domain while it executes.AssemblyandClasslook up assemblies, classes, fields, methods, and nested classes as effects. The plain variants (assembly,class,field, ...) treat a missing member as a defect, thetry*variants fail with aNoSuchElementErrorinstead, and the*Cachedvariants memoize lookups in aCachesized by theCacheCapacityreference (100 by default). Cache keys compare il2cpp objects by their native handle.Equivalencecompares images, classes, fields, and methods by their native handle.ExtensionsprovidesDictionaryandListwrappers overSystem.Collections.Generic.DictionaryandSystem.Collections.Generic.Listobjects.
Example usage
import "@efffrida/polyfills";
import * as Effect from "effect/Effect";
import { Assembly, Class, Extensions, FridaIl2cppBridge } from "@efffrida/il2cpp-bridge";
import { FridaRuntime } from "@efffrida/platform";
Effect.gen(function* () {
const csharp = yield* Assembly.assembly("Assembly-CSharp");
const player = yield* Class.tryClass(csharp.image, "Player");
const allPlayers = yield* Class.tryField<Il2Cpp.Object>(player, "s_AllPlayers");
const players = Extensions.List.lift(allPlayers.value);
yield* Effect.logInfo(`There are ${players.length} players`);
}).pipe(FridaIl2cppBridge.il2cppPerformEffect, FridaRuntime.runMain);