| 10 | VirtualInstruction::VirtualInstruction(DWORD vmHandlerRva) : vmHandlerRva(vmHandlerRva) {}; |
| 11 | |
| 12 | std::vector<BYTE> VirtualInstruction::getBytes() |
| 13 | { |
| 14 | std::vector<BYTE> bytes; |
| 15 | |
| 16 | // convert vmHandlerRva into a BYTE vector |
| 17 | std::vector<BYTE> vmHandlerRvaBytes = convertToByteVector<DWORD>(vmHandlerRva); |
| 18 | bytes.insert(bytes.end(), vmHandlerRvaBytes.begin(), vmHandlerRvaBytes.end()); |
| 19 | |
| 20 | // if operand exists, convert it into a BYTE vector |
| 21 | if (hasOperand) |
| 22 | { |
| 23 | std::vector<BYTE> operandBytes; |
| 24 | |
| 25 | switch (operandSize) |
| 26 | { |
| 27 | case 8: operandBytes = convertToByteVector<long long>(operand); break; |
| 28 | case 4: operandBytes = convertToByteVector<DWORD>(operand); break; |
| 29 | case 2: operandBytes = convertToByteVector<WORD>(operand); break; |
| 30 | case 1: operandBytes = convertToByteVector<BYTE>(operand); break; |
| 31 | } |
| 32 | |
| 33 | bytes.insert(bytes.end(), operandBytes.begin(), operandBytes.end()); |
| 34 | } |
| 35 | |
| 36 | return bytes; |
| 37 | } |
| 38 | |
| 39 | void VirtualInstruction::setOperand(long long operand) { this->operand = operand; } |
nothing calls this directly
no outgoing calls
no test coverage detected