Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!



   123

Windows Grey Dev - Memory

by Jumpy22 - 07 July, 2025 - 04:26 AM
This post is by a banned member (Jumpy22) - Unhide
Jumpy22  
Godlike
1.306
Posts
282
Threads
6 Years of service
#1
Virtual Memory & Paging
Windows uses virtual memory addresses that map to physical memory (RAM) or disk storage. Memory is divided into 4KB "pages" to optimize resource usage and allow multiple processes to share physical addresses safely.
 
[Image: virtual-memory.png]
 
Page States
Pages in a process's virtual address space exist in three states:
  • Free: Not accessible, available for allocation
  • Reserved: Reserved for future use but not accessible
  • Committed: Allocated from RAM/paging files and accessible
 
Memory Protection
Key protection constants include:
  • PAGE_NOACCESS: No access allowed
  • PAGE_READONLY: Read-only access
  • PAGE_EXECUTE_READWRITE: Read/write/execute (major red flag!)
 
Built-in Protections
  • DEP (Data Execution Prevention): Prevents code execution in read-only regions
  • ASLR (Address Space Layout Randomization): Randomizes memory layout to prevent exploitation
 
Memory Allocation in C
Code:
PVOID pAddress = malloc(100);                           // Method 1
PVOID pAddress = HeapAlloc(GetProcessHeap(), 0, 100);   // Method 2
PVOID pAddress = LocalAlloc(LPTR, 100);                 // Method 3
 
Writing to Memory
Code:
PVOID pAddress = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 100);
CHAR* cString = "Hello World";
memcpy(pAddress, cString, strlen(cString));
 
Memory Cleanup
Always free allocated memory to prevent leaks:
  • malloc() → free()
  • HeapAlloc() → HeapFree()
  • LocalAlloc() → LocalFree()
 
Architecture Differences
  • x86: 4GB memory space (0xFFFFFFFF)
  • x64: 128TB memory space (0xFFFFFFFFFFFFFFFF)
 
If theres anything I forgot please put it in the comments
[Image: WEbU7oOt.png]

My Contact Info:
@crashoutadmin (Telegram)
._.fishi (Discord)
This post is by a banned member (Interstellar) - Unhide
4.373
Posts
1.271
Threads
#2
Cool

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)