mirror of
https://github.com/BepInEx/Dobby.git
synced 2026-11-13 20:06:11 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1321565296 | ||
|
|
b684bf0d62 | ||
|
|
37d5a4076c | ||
|
|
9206fee94d |
@@ -447,11 +447,30 @@ static void x86_insn_decode_opcode(x86_insn_reader_t *rd, x86_insn_decode_t *ins
|
||||
} else {
|
||||
insn_spec = x86_opcode_map_one_byte[opcode];
|
||||
}
|
||||
DLOG(0, "[x86 decode] spec: %p", &x86_opcode_map_one_byte[opcode]);
|
||||
DLOG(0, "[x86 decode] spec; opcode: %x; name: %s; flags: %d", opcode, insn_spec.name, insn_spec.flags);
|
||||
|
||||
// check sse group
|
||||
if (X86_INSN_FLAG_GET_GROUP(insn_spec.flags) > X86_INSN_SSE_GROUP_START) {
|
||||
UNIMPLEMENTED();
|
||||
int group_ndx = X86_INSN_FLAG_GET_SSE_GROUP(insn_spec.flags);
|
||||
|
||||
x86_insn_modrm_t modrm;
|
||||
modrm.byte = peek_byte(rd);
|
||||
int insn_ndx = modrm.reg;
|
||||
|
||||
x86_insn_spec_t *group_insn = NULL;
|
||||
group_insn = &x86_insn_sse_groups_repz[group_ndx].insns[insn_ndx];
|
||||
|
||||
insn_spec.name = group_insn->name;
|
||||
insn_spec.flags = group_insn->flags;
|
||||
|
||||
for (int i = 0; i < sizeof(insn_spec.operands) / sizeof(x86_insn_operand_spec_t); i++) {
|
||||
x86_insn_operand_spec_t group_op = group_insn->operands[i];
|
||||
if (group_op.data[0] != '_' && group_op.data[1] != '_') {
|
||||
insn_spec.operands[i] = group_insn->operands[i];
|
||||
}
|
||||
}
|
||||
DLOG(0, "[x86 sse decode] modrm_group_spec; group: %d, ins: %d, byte: %x; name: %s; flags: %d", group_ndx, insn_ndx,
|
||||
modrm.byte, insn_spec.name, insn_spec.flags);
|
||||
}
|
||||
|
||||
if (X86_INSN_FLAG_GET_GROUP(insn_spec.flags) > X86_INSN_GROUP_START &&
|
||||
@@ -471,6 +490,15 @@ static void x86_insn_decode_opcode(x86_insn_reader_t *rd, x86_insn_decode_t *ins
|
||||
// update the insn spec
|
||||
insn_spec.name = group_insn->name;
|
||||
insn_spec.flags = group_insn->flags;
|
||||
for (int i = 0; i < sizeof(insn_spec.operands) / sizeof(x86_insn_operand_spec_t); i++) {
|
||||
x86_insn_operand_spec_t group_op = group_insn->operands[i];
|
||||
if (group_op.data[0] != '_' && group_op.data[1] != '_') {
|
||||
insn_spec.operands[i] = group_insn->operands[i];
|
||||
}
|
||||
}
|
||||
DLOG(0, "[x86 decode] modrm_group_spec; group: %d, ins: %d, byte: %x; name: %s; flags: %d", group_ndx, insn_ndx, modrm.byte,
|
||||
insn_spec.name,
|
||||
insn_spec.flags);
|
||||
}
|
||||
|
||||
insn->primary_opcode = opcode;
|
||||
@@ -561,10 +589,10 @@ void x86_insn_decode(x86_insn_decode_t *insn, uint8_t *buffer, x86_options_t *co
|
||||
x86_insn_decode_immediate(&rd, insn, conf);
|
||||
}
|
||||
|
||||
#if 1
|
||||
DLOG(0, "[x86 insn] %s, %p", insn->insn_spec.name, &insn->insn_spec);
|
||||
#endif
|
||||
|
||||
// set insn length
|
||||
insn->length = rd.buffer_cursor - rd.buffer;
|
||||
|
||||
#if 1
|
||||
DLOG(0, "[x86 insn] opcode: %s, spec: %p, size: %d", insn->insn_spec.name, &insn->insn_spec, insn->length);
|
||||
#endif
|
||||
}
|
||||
Reference in new issue
Block a user