MCPcopy Create free account
hub / github.com/SafeBreach-Labs/PoolParty / w_VirtualAllocEx

Function w_VirtualAllocEx

PoolParty/WinApi.cpp:142–150  ·  view source on GitHub ↗

TODO: Figure out including this in the error handlers

Source from the content-addressed store, hash-verified

140
141// TODO: Figure out including this in the error handlers
142LPVOID 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
153void w_WriteProcessMemory(HANDLE hTargetPid, LPVOID AllocatedMemory, LPVOID pBuffer, SIZE_T szSizeOfBuffer)

Callers 2

SetupExecutionMethod · 0.85

Calls 1

GetLastErrorStringFunction · 0.85

Tested by

no test coverage detected