mirror of
https://github.com/mandiant/capa.git
synced 2026-02-04 11:07:53 -08:00
insn: better detect offset/numbers
This commit is contained in:
@@ -218,7 +218,7 @@ def extract_insn_offset_features(f, bb, insn):
|
||||
yield Offset(op_off), insn.ea
|
||||
yield OperandOffset(i, op_off), insn.ea
|
||||
|
||||
if i == 1 and op.type == idaapi.o_phrase:
|
||||
if insn.itype == idaapi.NN_lea and i == 1 and op.type == idaapi.o_displ:
|
||||
# for pattern like:
|
||||
#
|
||||
# lea eax, [ebx + 1]
|
||||
|
||||
@@ -576,7 +576,7 @@ def extract_op_offset_features(f, bb, insn, i, oper):
|
||||
yield Offset(v), insn.va
|
||||
yield OperandOffset(i, v), insn.va
|
||||
|
||||
if i == 1 and not f.vw.probeMemory(v, 1, envi.memory.MM_READ):
|
||||
if insn.mnem == "lea" and i == 1 and not f.vw.probeMemory(v, 1, envi.memory.MM_READ):
|
||||
# for pattern like:
|
||||
#
|
||||
# lea eax, [ebx + 1]
|
||||
|
||||
Reference in New Issue
Block a user