(instruction: Instruction)
| 84 | } |
| 85 | |
| 86 | function 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 | |
| 104 | function isDirectCallMnemonic(mnemonic: string): boolean { |
| 105 | return mnemonic === "bl" || mnemonic === "call"; |
no test coverage detected