Add xor_eax_imm32(0x35) instruction

This commit is contained in:
tuz358
2018-03-06 11:25:32 +09:00
parent 071f2794fa
commit 812a585e9a
2 changed files with 9 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ public:
void sub_eax_imm32(); // 0x2d
void xor_rm32_r32(); // 0x31
void xor_r32_rm32(); // 0x33
void xor_eax_imm32(); // 0x35
void inc_eax(); // 0x40
void inc_ecx(); // 0x41
void inc_edx(); // 0x42

View File

@@ -34,6 +34,7 @@ void Instructions::init_instructions(){
this->instructions[0x2d] = &Instructions::sub_eax_imm32;
this->instructions[0x31] = &Instructions::xor_rm32_r32;
this->instructions[0x33] = &Instructions::xor_r32_rm32;
this->instructions[0x35] = &Instructions::xor_eax_imm32;
this->instructions[0x40] = &Instructions::inc_eax;
this->instructions[0x41] = &Instructions::inc_ecx;
this->instructions[0x42] = &Instructions::inc_edx;
@@ -632,6 +633,13 @@ void Instructions::xor_r32_rm32(){
}
}
void Instructions::xor_eax_imm32(){
this->eip++;
uint32_t imm32 = memory.read_uint32(this->eip);
imm32 = swap_endian32(imm32);
this->registers[0] ^= imm32;
}
void Instructions::inc_eax(){
//printf("inc_eax called.\n");
this->registers[0]++;