| 93 | } |
| 94 | |
| 95 | DWORD Function::getBytecodeIndex(int instructionIndex) |
| 96 | { |
| 97 | DWORD bytecodeIndex = 0; |
| 98 | |
| 99 | /* |
| 100 | the following is a hacky solution to the fact instruction[0] will have "non-real" instructions |
| 101 | to deal with the vm context. A better solution will be required in order to support x86 call. |
| 102 | Perhaps we should implement a second vector of type VirtualInstruction that will store these |
| 103 | "injected" instructions. |
| 104 | */ |
| 105 | if (instructionIndex == 0) |
| 106 | { |
| 107 | // length of "injected" virtual instructions (VM::popVmContext()) |
| 108 | bytecodeIndex = 0x55; |
| 109 | } |
| 110 | |
| 111 | // calculate the bytecode index of instructionIndex via summing all previous instruction bytecode sizes |
| 112 | for (int i = 0; i < instructionIndex; i++) |
| 113 | bytecodeIndex += instructions[i].getVirtualInstructionBytes().size(); |
| 114 | |
| 115 | return bytecodeIndex; |
| 116 | } |
| 117 | |
| 118 | std::vector<BYTE> Function::getVirtualInstructionBytes() |
| 119 | { |
nothing calls this directly
no test coverage detected