| 6 | std::vector<VMHandler> vmHandlers; |
| 7 | |
| 8 | bool compileInstructionToVirtualInstructions(Instruction* instruction) |
| 9 | { |
| 10 | switch (instruction->getInstructionInfo().mnemonic) |
| 11 | { |
| 12 | case ZYDIS_MNEMONIC_PUSH: return x86PushHandler(instruction); |
| 13 | case ZYDIS_MNEMONIC_POP: return x86PopHandler(instruction); |
| 14 | case ZYDIS_MNEMONIC_MOV: return x86MovHandler(instruction); |
| 15 | case ZYDIS_MNEMONIC_LEA: return x86LeaHandler(instruction); |
| 16 | case ZYDIS_MNEMONIC_RET: return x86RetHandler(instruction); |
| 17 | case ZYDIS_MNEMONIC_CMP: return x86CmpHandler(instruction); |
| 18 | case ZYDIS_MNEMONIC_TEST: return x86TestHandler(instruction); |
| 19 | case ZYDIS_MNEMONIC_JMP: return x86JmpHandler(instruction); |
| 20 | case ZYDIS_MNEMONIC_JNZ: return x86JneHandler(instruction); |
| 21 | case ZYDIS_MNEMONIC_NOP: return 1; |
| 22 | |
| 23 | case ZYDIS_MNEMONIC_ADD: |
| 24 | case ZYDIS_MNEMONIC_SUB: |
| 25 | case ZYDIS_MNEMONIC_XOR: |
| 26 | case ZYDIS_MNEMONIC_AND: |
| 27 | case ZYDIS_MNEMONIC_OR: |
| 28 | case ZYDIS_MNEMONIC_SHL: |
| 29 | return x86ArithmeticHandler(instruction, instruction->getInstructionInfo().mnemonic, true); |
| 30 | } |
| 31 | return 0; |
| 32 | } |
| 33 | |
| 34 | bool x86PushHandler(Instruction* instruction) |
| 35 | { |
no test coverage detected