MCPcopy Create free account
hub / github.com/connorjaydunn/BinaryShield / compileInstructionToVirtualInstructions

Function compileInstructionToVirtualInstructions

src/vm.cpp:8–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

Calls 11

x86PushHandlerFunction · 0.85
x86PopHandlerFunction · 0.85
x86MovHandlerFunction · 0.85
x86LeaHandlerFunction · 0.85
x86RetHandlerFunction · 0.85
x86CmpHandlerFunction · 0.85
x86TestHandlerFunction · 0.85
x86JmpHandlerFunction · 0.85
x86JneHandlerFunction · 0.85
x86ArithmeticHandlerFunction · 0.85
getInstructionInfoMethod · 0.80

Tested by

no test coverage detected