Add push_imm32(0x68) instruction

This commit is contained in:
tuz358
2018-03-06 15:09:35 +09:00
parent b460334d25
commit 0491cbd3e0
2 changed files with 10 additions and 0 deletions

View File

@@ -76,6 +76,7 @@ public:
void pop_ebp(); // 0x5d
void pop_esi(); // 0x5e
void pop_edi(); // 0x5f
void push_imm32(); // 0x68
void jne_imm8(); // 0x75
void opcode_83(); // 0x83
void mov_rm32_r32(); // 0x89

View File

@@ -70,6 +70,7 @@ void Instructions::init_instructions(){
this->instructions[0x5d] = &Instructions::pop_ebp;
this->instructions[0x5e] = &Instructions::pop_esi;
this->instructions[0x5f] = &Instructions::pop_edi;
this->instructions[0x68] = &Instructions::push_imm32;
this->instructions[0x75] = &Instructions::jne_imm8;
this->instructions[0x83] = &Instructions::opcode_83;
this->instructions[0x89] = &Instructions::mov_rm32_r32;
@@ -888,6 +889,14 @@ void Instructions::pop_edi(){
this->registers[4] += 4;
}
void Instructions::push_imm32(){
//printf("push_imm32 called.\n");
uint32_t imm32 = memory.read_uint32(this->eip);
imm32 = swap_endian32(imm32);
this->registers[4] -= 4; // esp -= 4
memory.write_uint32(this->registers[4], imm32);
}
void Instructions::jne_imm8(){
//printf("jne_imm8 called.\n");