Package-level declarations

Types

Link copied to clipboard

Self-attach + bootstrap-bridge injection, isolated from any class that references a bridge type.

Link copied to clipboard
internal object LineTable

Which method owns a source line, read from the class file's LineNumberTable — the descriptor a StackTraceElement does not carry, and the only thing that separates same-named obf overloads.

Link copied to clipboard
internal object Patch

Runtime method patching: weaves a ByteBuddy Advice into a method named at runtime. Used only by execute_code scripts, via Patches.

Link copied to clipboard
class PatchDecision(val replaces: Boolean, val value: Any?)

What a writable patch's callback answers with. Built only by Patches.proceed / Patches.returns, so a script never names this type.

Link copied to clipboard
internal object PatchDiagnostics

How a failed or ambiguous patch target is described back to the caller.

Link copied to clipboard
The blueprint whose @OnMethodEnter body ByteBuddy copies (inlines) into the head of every entry-patched method.
Link copied to clipboard
Game-side entry-patch callback.
Link copied to clipboard
object Patches

Cross-eval patch registry, the lifecycle layer over Patch. An execute_code snippet is stateless per call, so live patches are kept in a game-loader static map — a later eval can handle, remove or removeAll them.

Link copied to clipboard
The blueprint whose @OnMethodExit body ByteBuddy copies (inlines) into every exit of an exit-patched method.
Link copied to clipboard
Game-side exit-patch callback.
Link copied to clipboard
class PatchHandle(val key: String, val slot: Int, val handler: Patch.CountingHandler, val unweave: Unweave, val woven: Map<Any, List<Woven>>, val seen: AtomicBoolean, val listener: Patch.WeaveListener)

One live patch: its id, what it wove, and how it has behaved since. Returned by Patches.onEnter / Patches.onExit and read back later by Patches.handle.

Link copied to clipboard
Head-side decision: rewrite arguments, or skip the body and return a substitute.
Link copied to clipboard
Game-side head-side decision callback, SAM-converted from a Kotlin lambda: Patches.intercept("...", "...") { key, self, args -> ... }.
Link copied to clipboard
Marks the advice parameter ByteBuddy binds to the patch key, inlined as a constant via Advice.withCustomMapping().bind(...) — so the woven value is byte-identical to the value the handler was registered under.
Link copied to clipboard
Return-side decision: replace the return value.
Link copied to clipboard
Game-side return-side decision callback, SAM-converted from a Kotlin lambda: Patches.modify("...", "...") { key, self, args, returned, thrown -> ... }.
Link copied to clipboard
Marks the advice parameter ByteBuddy binds to the patch's registry slot, inlined as a constant beside PatchKey — so dispatch is an array index rather than a lookup on the key.
Link copied to clipboard
internal object PatchTargets

Which methods an install call names, and the matcher that reaches them. Split from Patch because it answers a different question: Patch decides what to weave INTO a method, this decides WHICH method.

Link copied to clipboard

Warms the patch engine on a background thread at init, so the first script calling Patches doesn't pay the self-attach and ByteBuddy's class loading on a tick thread — seconds of it where no flag permits a direct self-attach and ByteBuddy falls back to spawning a second JVM to attach on its behalf.

Link copied to clipboard
The one call the batch unweave cannot make from Kotlin without paying for it: retransformClasses is varargs, and Kotlin's spread reallocates the array in front of every such call.
Link copied to clipboard
internal object Signatures

Name and signature normalization, shared by patch resolution (Patch) and by the diagnostics it throws.

Link copied to clipboard
internal class Unweave(val transformer: ResettableClassFileTransformer, val inst: Instrumentation, val className: String)

Everything undoing an install takes, the way Patch.Weave is everything applying one takes.

Link copied to clipboard
internal class Woven(val params: List<String>, val label: String)

One woven method: the label PatchHandle.targets shows, and the runtime parameter types it was rendered from — kept structured so Patches.removeEnter can filter through Signatures.matches, the comparison that picked the target, instead of reading the label back apart.

Functions

Link copied to clipboard
private fun checked(rt: Class<*>, v: Any?): Any?

v if a slot of type rt can hold it, else a throw — which the caller's own catch turns into a recorded failure, so a bad value and a throwing callback share one failure path.

Link copied to clipboard
private fun wrapperOf(rt: Class<*>): Class<*>

rt's wrapper if it is primitive, else rt itself. MethodType.methodType(rt).wrap() answers the same, but interns a MethodType per call on a path that runs per fire — and it puts MethodType on that path, where patching it would take every writable patch with it. === and not ==, so no Object.equals joins it there either; javaObjectType reads like a getter but the compiler folds it to an LDC.