Machinegun is an advanced version of Metasploit's railgun.
Machinegun is capable of reliably running arbitrary Windows API functions on a remote computer and getting the results to the attacker's machine.
For now, you will need Visual Studio 2022 but in the future, it will be with CMake and cross-compiled with Mingw.
#include "Machinegun.hpp"
MachineGunResult result;
PVOID allocatedAddress = NULL;
PVOID args[MAX_ARGS];
result = SetArgs(4, args, NULL, 0x1000, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
if (result == SUCCESS) {
result = MachineGun(4, &allocatedAddress, L"kernel32.dll", "VirtualAlloc", args);
if (result == SUCCESS) {
std::cout << "Allocated address: " << std::hex << allocatedAddress << std::endl;
}
}