Files
GaCy-GO/tools/resolve_captured_method_handles.js
2026-10-28 18:54:43 +07:00

18 lines
1.0 KiB
JavaScript

// Exact named-method records from a caller-selected current-process capture.
// Offset +8 was verified against two independently known exception-bound
// AdventurePhase entrypoints. No assembly enumeration, native calls or writes.
const methods = globalThis.GAC_CAPTURED_METHOD_HANDLES;
if (!Array.isArray(methods) || methods.length < 1 || methods.length > 256)
throw Error('Bounded current-process method handle list required');
const module = Process.getModuleByName('GameAssembly.dll');
for (const item of methods) {
if (typeof item.name !== 'string' || !/^0x[0-9a-f]+$/i.test(item.handle))
throw Error('Invalid exact method record');
try {
const address = ptr(item.handle).add(8).readPointer();
if (address.compare(module.base) < 0 || address.compare(module.base.add(module.size)) >= 0)
throw Error('Method pointer is outside selected GameAssembly');
send({name:item.name, handle:item.handle, rva:address.sub(module.base).toString()});
} catch (error) { send({name:item.name, error:String(error)}); }
}