Skip to content

Commit 3e0bd97

Browse files
committed
Wire up parsex86InstrumentationPointer for x86_64
1 parent 4659a6d commit 3e0bd97

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

lib/android.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,32 @@ function tryDetectInstrumentationPointer (api) {
800800
}
801801

802802
function parsex86InstrumentationPointer (insn) {
803-
return null;
803+
if (insn.mnemonic !== 'mov') {
804+
return null;
805+
}
806+
807+
const ops = insn.operands;
808+
809+
const dst = ops[0];
810+
if (dst.value !== 'rax') {
811+
return null;
812+
}
813+
814+
const src = ops[1];
815+
if (src.type !== 'mem') {
816+
return null;
817+
}
818+
819+
const mem = src.value;
820+
if (mem.base !== 'rdi') {
821+
return null;
822+
}
823+
824+
const offset = mem.disp;
825+
if (offset < 0x100 || offset > 0x400) {
826+
return null;
827+
}
828+
return offset;
804829
}
805830

806831
function parseArmInstrumentationPointer (insn) {

0 commit comments

Comments
 (0)