| 251 | } |
| 252 | |
| 253 | void PE::redirectFunctionToVmTramp(Function function, DWORD vmTrampRva) |
| 254 | { |
| 255 | std::vector<BYTE> relToVmTrapBytes = convertToByteVector<DWORD>(vmTrampRva - (function.getStartRva() + 5)); |
| 256 | |
| 257 | // replace first bytes of instruction with a redirection to the vm trampoline jump |
| 258 | bytes[rvaToFileOffset(function.getStartRva())] = 0xE9; |
| 259 | std::copy(relToVmTrapBytes.begin(), relToVmTrapBytes.end(), bytes.begin() + rvaToFileOffset(function.getStartRva() + 1)); |
| 260 | } |
| 261 | |
| 262 | void PE::removeOriginalFunctionBytes(Function function) |
| 263 | { |
nothing calls this directly
no test coverage detected