Questions tagged [virtualalloc]
64 questions
2
votes
1 answer
Can I (ab)use VirtualAlloc for every vector-like container in a game?
Imagine I'm making a game
I know it's going to run on a 64-bit system, on a 64-bit OS
the memory budget for the game is fixed 2 (or 4) Gibibytes
Would that mean that out of 64 bits of Virtual Address Space for the process, I would get 32bits left…

JBeurer
- 1,707
- 3
- 19
- 38
2
votes
1 answer
Error in running byte array in C# using VirtualAlloc and GetDelegateForFunctionPointer
I have a Windows form program created in c#, which is just a form and a single button. What I want to achieve here execute a hard-coded byte array, using VirtualAlloc and a delegate. This hard coded byte array pertains to the bytes of wrar.exe…

jaysonpryde
- 2,733
- 11
- 44
- 61
2
votes
1 answer
C++ get the base address of a allocated section
Since I was not clear before I will rewrite my question.
I need to get the absolute base address of a section of memory that was allocated with VirtualAllocEx().
For example, if I allocate 0x20000 bytes and get the address 0x5000000.
I need a method…

John
- 5,942
- 3
- 42
- 79
2
votes
1 answer
How could VirtualAlloc fail (no mem) despite plenty of phys memory on WinMobile?
I am routinely seeing VirtualAlloc calls to reserve memory fail. I'm requesting 2MB so that the allocations do not count against my per process virtual memory and instead use system shared memory. At the time of failure, the system reports having…

glutz78
- 83
- 1
- 4
2
votes
2 answers
VirtualAlloc in c# to allocate large memory
I'm trying to adapt a vendor's c# example code for interfacing with a PCI-Express device. The code basically allocates a large buffer as an int array, and then pins it via the fixed keyword before handing it off to hardware to be filled with data. …

user1850479
- 225
- 2
- 12
2
votes
1 answer
How does the operating system determine which region to allocate when lpAddress is null in VirtualAlloc
When the lpAddress parameter to a VirtualAlloc function call is null, how does the OS determine which virtual address space region to allocate?

user101847
- 81
- 1
- 5
2
votes
2 answers
VirtualAlloc address
I worte the code below
void * ptr1 = VirtualAlloc((void*)0x70000000, 32*1024*1024, MEM_RESERVE, PAGE_READWRITE);
void * ptr2 = VirtualAlloc((void*)0x80000000, 4*1024*1024, MEM_RESERVE, PAGE_READWRITE);
But VirtualAlloc fails and the value of…

devMiyax
- 65
- 1
- 8
1
vote
1 answer
VirtualAlloc at 0x000'00000000
When passing 0x000'00000000 (NULL) as the first parameter of VirtualAlloc the system determines where to allocate the region, or if the function fails, the return value is NULL (0x000'00000000).
For a 64-bit process on 64-bit Windows, the virtual…

err69
- 317
- 1
- 7
1
vote
0 answers
How to load a DLL on disk into remote process via Golang?
I am new to programming and have decided to pickup Golang. One project I am working on is injecting a DLL on disk into a remote process via CreateRemoteThread. The intent of the program is to have it spawn a sacrificial process, notepad.exe, and…

pittsec
- 23
- 3
1
vote
1 answer
Pandoc error while converting .md to .docx file
While attempting to convert .md to docx file using command line:
pandoc CustomerChurn_predict.md -s -o churn.docx
I got following error:
pandoc: getMBlocks: VirtualAlloc MEM_COMMIT failed: The paging file is too small for this operation to…

Sinchana
- 11
- 3
1
vote
1 answer
Enforce VirtualAlloc address less than 32-bits on 64-bit machine
I need to allocate a certain space in memory, and I have been using VirtualAlloc for this.
However, I have increasingly noticed that VirtualAlloc returns an address that exceeds 32 bits, though always less than 33 bits.
The consequence is that when…

Nulinspiratie
- 171
- 5
1
vote
3 answers
How to allocate a region of memories which similar VirtualAlloc?
I was looking for a method of allocating memories on Linux which similar VirtualAlloc on Windows. Requirements are:
Size of memories block to allocate is 2^16.
Address of memories block is larger than 0x0000ffff
Address of memories block must have…

Giang
- 51
- 5
1
vote
3 answers
what about CopyMemory copy more bytes than VirtualAlloc allocated
please look this code , in my machine , it do not raise error , but I do not understand why can I copy more bytes than VirtualAlloc allocated,is this operation safe ?
PBYTE pNewBuffer = (PBYTE) VirtualAlloc(NULL,3,MEM_COMMIT,PAGE_READWRITE);
…

yangl
- 337
- 1
- 3
- 18
1
vote
2 answers
Question about memory page protection
Here's another question I met when reading < Windows via C/C++ 5th Edition >. First, let's see some quotation.
LPVOID WINAPI VirtualAlloc(
__in_opt LPVOID lpAddress,
__in SIZE_T dwSize,
__in DWORD fdwAllocationType,
__in …

smwikipedia
- 61,609
- 92
- 309
- 482
1
vote
0 answers
Pydbg dump memory from VirtualAlloc
I am using the following code taken from:
http://securityxploded.com/automation-reversing-scripting.php#Pydbg
# Author: Amit Malik
import sys
import pefile
import struct
from pydbg import *
from pydbg.defines import *
def…

myperfectname
- 11
- 2