Skip to content

Commit

Permalink
Now checking flags, instr length, and PC.
Browse files Browse the repository at this point in the history
  • Loading branch information
edeiana committed Mar 20, 2024
1 parent 46bacdb commit 9c96008
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions suite/tests/api/ir_x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,22 @@ instr_synthetic_matches_real(instr_t *instr_real, instr_t *instr_synthetic)
sizeof(used_dst_reg_map_real)) != 0)
return false;

uint eflags_instr_real = instr_get_arith_flags(instr_real, DR_QUERY_DEFAULT);
uint eflags_instr_synthetic =
instr_get_arith_flags(instr_synthetic, DR_QUERY_DEFAULT);
uint eflags_real = 0x0;
if (eflags_instr_real & EFLAGS_WRITE_ARITH)
eflags_real |= 0x1;
if (eflags_instr_real & EFLAGS_READ_ARITH)
eflags_real |= 0x2;
uint eflags_synthetic = 0x0;
if (eflags_instr_synthetic & EFLAGS_WRITE_ARITH)
eflags_synthetic |= 0x1;
if (eflags_instr_synthetic & EFLAGS_READ_ARITH)
eflags_synthetic |= 0x2;
if (eflags_real != eflags_synthetic)
return false;

return true;
}

Expand Down

0 comments on commit 9c96008

Please sign in to comment.