Пример #1
0
static void
test_strict_invalid(void *dc)
{
    instr_t instr;
    byte *pc;
    const byte buf[] = { 0xf2, 0x0f, 0xd8, 0xe9 }; /* psubusb w/ invalid prefix */

    instr_init(dc, &instr);

    /* The instr should be valid by default and invalid if decode_strict */
    pc = decode(dc, (byte *)buf, &instr);
    ASSERT(pc != NULL);

    disassemble_set_syntax(DR_DISASM_STRICT_INVALID);
    instr_reset(dc, &instr);
    pc = decode(dc, (byte *)buf, &instr);
    ASSERT(pc == NULL);

    instr_free(dc, &instr);
}
Пример #2
0
void Shade::init_disassembler()
{
    disassemble_set_syntax(DR_DISASM_INTEL);

    code_log.open("code_log.txt");
}