Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8992583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:59:21+00:00 2026-06-15T22:59:21+00:00

Recently I’ve put together a C# class that can read and write bytes in

  • 0

Recently I’ve put together a C# class that can read and write bytes in another processes memory using API calls etc. as I’m sure you’ve all seen before.

My question however relates to how I can efficiently scan the memory of another process? I know the basic method of testing each group of 4 bytes until you reach Int32.MaxValue, but I’ve found it is (as you may imagine) incredibly time and resource consuming.

From what I’ve read, there is a way to determine the allocated addresses of a process by doing a “HeapWalk”. Can anyone provide me with some code examples and/or information about this and what would be the best way of going about it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T22:59:22+00:00Added an answer on June 15, 2026 at 10:59 pm

    What you are looking for is the list of memory regions, which is basically a list of pair of memory address / region size.

    What you must do is :

    • get a handle to the target process using it’s process ID (PID) using OpenProcess
    • call the VirtualQueryEx function until you reach the end of the memory space (i.e. while the result of the method is greater than 0)
    • close the process handle you opened

    Start VirtualQueryEx with lpAddress as 0x0. This will return a MEMORY_BASIC_INFORMATION structure that contains both BaseAddress and RegionSize properties (this represents a memory space you can read). Then increment the lpAdress parameter with the RegionSize value, so next call of VirtualQueryEx will return the next region…etc.

    Google OpenProcess, CloseHandle, VirtualQueryEx and MEMORY_BASIC_INFORMATION so you can find the different P/Invoke declarations to use, so you can call those Win32 functions from C#.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently, I was writing a class in which I discovered that I could reduce
Recently I have done an assignment, on overloading basic functionalists(+,-,conjugate...) of complex class using
Recently I'm doing some work on RTMP streaming, that is using Flowplayer to integrate
recently I created a java class Custom Layout Manager , which I want to
Recently, I try to build WebKit with VS2012. That cost me a lot of
Recently, I had the need for a function that I could use to guarantee
Recently I am making a server-client program using multithread concept. For some reason, I
Recently I've created one android application using eclipse and ran it using android virtual
Recently our WPF/Entity Framework 4.0 application has become unstable after we began using backgroundworkers
Recently, I've started experimenting with Mercurial, due to the fact that it always attracted

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.