TODO: Figure out including this in the error handlers
| 140 | |
| 141 | // TODO: Figure out including this in the error handlers |
| 142 | LPVOID w_VirtualAllocEx(HANDLE hTargetPid, SIZE_T szSizeOfChunk, DWORD dwAllocationType, DWORD dwProtect) |
| 143 | { |
| 144 | const auto AllocatedMemory = VirtualAllocEx(hTargetPid, nullptr , szSizeOfChunk, dwAllocationType, dwProtect); |
| 145 | if (AllocatedMemory == NULL) |
| 146 | { |
| 147 | throw std::runtime_error(GetLastErrorString("VirtualAllocEx", GetLastError())); |
| 148 | } |
| 149 | return AllocatedMemory; |
| 150 | } |
| 151 | |
| 152 | // TODO: Add check for lpNumberOfBytesWritten |
| 153 | void w_WriteProcessMemory(HANDLE hTargetPid, LPVOID AllocatedMemory, LPVOID pBuffer, SIZE_T szSizeOfBuffer) |
no test coverage detected