MCPcopy Create free account
hub / github.com/axhlzy/FridaDebugger / addMethod

Function addMethod

agent/il2cpp-symbols.ts:352–389  ·  view source on GitHub ↗
(method: Il2Cpp.Method)

Source from the content-addressed store, hash-verified

350}
351
352function addMethod(method: Il2Cpp.Method): void {
353 const module = getIl2CppModule();
354 if (module === null) {
355 return;
356 }
357
358 let start: NativePointer;
359 try {
360 start = method.virtualAddress;
361 } catch (_error) {
362 return;
363 }
364
365 if (start.isNull() || !contains(module, start)) {
366 return;
367 }
368
369 if (lastEnumeratedStart !== null && lastEnumeratedStart.compare(start) > 0) {
370 monotonic = false;
371 if (!orderWarningPrinted) {
372 console.log("\x1b[33m[il2cpp] method address order is not monotonic; resolver will finish indexing before range matches\x1b[0m");
373 orderWarningPrinted = true;
374 }
375 }
376 lastEnumeratedStart = start;
377
378 const id = start.toString();
379 const existing = entriesByAddress.get(id);
380 if (existing !== undefined) {
381 existing.methods.push(method);
382 return;
383 }
384
385 const entry: MethodEntry = { start, methods: [method] };
386 entries.push(entry);
387 entriesByAddress.set(id, entry);
388 entriesSorted = false;
389}
390
391function sortEntries(): void {
392 if (entriesSorted) {

Callers 1

addClassMethodsFunction · 0.85

Calls 2

getIl2CppModuleFunction · 0.85
containsFunction · 0.85

Tested by

no test coverage detected