I'd much rather do syscalls directly instead of calling wrappers which are most of the time hooked by Anti-Cheats. If you look at the exported Nt_____ functions on ntdll.dll it should be pretty obvious what you should do.
Example: Instead of calling VirtualAlloc(Ex) you can do this and call it instead:
Code:__declspec( naked ) NTSTATUS NtAllocateVirtualMemory( HANDLE ProcessHandle, PVOID *BaseAddress, ULONG ZeroBits, PULONG AllocationSize, ULONG AllocationType, ULONG Protect ) { __asm { MOV EAX, 0x17; CALL fs : [0xC0]; RETN 0x18; } } //somewhere... if( NT_ERROR( NtAllocateVirtualMemory( GetCurrentProcess(), &m_pBuffer, NULL, &dwSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE ) ) ) { throw Exceptions::MemoryAllocationException( "Unable to alocate memory for the image" ); }