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

Function x86PushHandler

src/vm.cpp:34–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32 }
33
34 bool x86PushHandler(Instruction* instruction)
35 {
36 std::vector<ZydisDecodedOperand> operandInfo = instruction->getOperandInfo();
37
38 switch (operandInfo[0].type)
39 {
40 case ZYDIS_OPERAND_TYPE_REGISTER:
41 {
42 emitPushRegister(instruction, operandInfo[0].reg.value, operandInfo[0].size);
43 return 1;
44 }
45 case ZYDIS_OPERAND_TYPE_IMMEDIATE:
46 {
47 emitPushImmediate(instruction, operandInfo[0].imm.value.s, operandInfo[0].size);
48 return 1;
49 }
50 case ZYDIS_OPERAND_TYPE_MEMORY:
51 {
52 calculateEffectiveAddress(instruction, operandInfo[0].mem);
53 emitRead(instruction, operandInfo[0].size);
54 return 1;
55 }
56 case ZYDIS_OPERAND_TYPE_POINTER: return 0;
57 case ZYDIS_OPERAND_TYPE_UNUSED: return 0;
58 }
59
60 return 0;
61 }
62
63 bool x86PopHandler(Instruction* instruction)
64 {

Calls 5

emitPushRegisterFunction · 0.85
emitPushImmediateFunction · 0.85
emitReadFunction · 0.85
getOperandInfoMethod · 0.80

Tested by

no test coverage detected