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

Function getDirectCallTarget

agent/pdf.ts:86–102  ·  view source on GitHub ↗
(instruction: Instruction)

Source from the content-addressed store, hash-verified

84}
85
86function getDirectCallTarget(instruction: Instruction): NativePointer | null {
87 const mnemonic = instruction.mnemonic.toLowerCase();
88 if (!isDirectCallMnemonic(mnemonic)) {
89 return null;
90 }
91
92 const match = instruction.toString().match(/(?:#)?(0x[0-9a-fA-F]+)/);
93 if (match === null) {
94 return null;
95 }
96
97 try {
98 return ptr(match[1]);
99 } catch (_error) {
100 return null;
101 }
102}
103
104function isDirectCallMnemonic(mnemonic: string): boolean {
105 return mnemonic === "bl" || mnemonic === "call";

Callers 1

logInstructionFunction · 0.85

Calls 1

isDirectCallMnemonicFunction · 0.85

Tested by

no test coverage detected