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 8884215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:00:49+00:00 2026-06-14T21:00:49+00:00

So I’m reading the memory of another program for the purpose of reverse engineering.

  • 0

So I’m reading the memory of another program for the purpose of reverse engineering. I’m using a function from kernel32.dll.

The function looks like this:

ReadProcessMemory(Handle, new IntPtr(Address), buffer, BytesToRead, out ptrBytesRead);

I’m using it to read memory bit by bit, like so:

    public static int ReadInt32(IntPtr Handle, long Address)
    {
        return BitConverter.ToInt32(ReadBytes(Handle, Address, 4), 0);
    }

Then calling ReadInt32 using a programs handle and the address I’m looking to read, adding the base address of the program as it is not static.

What I’d like to do is read a whole chunk of memory (up to 1300 records, each record has a memory step of 0xB0).

I’m not sure exactly what the best way is to go about this. I’ve looked into it and it looks like it is possible to do something where I take the whole thing and basically dump it into a structure of my own. The problem I’m having is that I don’t quite know what I need to actually do. I can see it in my mind, but can’t put pen to paper on it.

I’ll expand to show that it is in fact a 2d array, looking like this in structure:

    int OFFSET_CREATURE_ID = 0;
    int OFFSET_CREATURE_TYPE = 3;
    int OFFSET_CREATURE_NAME = 4;
    int OFFSET_CREATURE_Z = 36;
    int OFFSET_CREATURE_Y = 40;
    int OFFSET_CREATURE_X = 44;
    int OFFSET_CREATURE_IS_WALKING = 80;
    int OFFSET_CREATURE_DIRECTION = 84;
    int OFFSET_CREATURE_OUTFIT = 100;
    int OFFSET_CREATURE_OUTFIT_HEAD = 104;
    int OFFSET_CREATURE_OUTFIT_BODY = 108;
    int OFFSET_CREATURE_OUTFIT_LEGS = 112;
    int OFFSET_CREATURE_OUTFIT_FEET = 116;
    int OFFSET_CREATURE_OUTFIT_ADDON = 120;
    int OFFSET_CREATURE_LIGHT = 124;
    int OFFSET_CREATURE_LIGHT_COLOR = 128;
    int OFFSET_CREATURE_HP_BAR = 140;
    int OFFSET_CREATURE_WALK_SPEED = 144;
    int OFFSET_CREATURE_IS_VISIBLE = 148;
    int OFFSET_CREATURE_SKULL = 152;
    int OFFSET_CREATURE_PARTY = 156;
    int OFFSET_CREATURE_WARICON = 164;
    int OFFSET_CREATURE_ISBLOCKING = 168;

Each of those offsets needs to be assigned to a different element in my structure. Some of them are bool, some int, and some string. I’ve got the struct. I can’t guarentee that the length will consume the entire “step” for each offset, though when I read these values I think I need to declare a new instance of the struct each time (I will be reading them each 500ms or so, maybe more! The total read time for 250 records is approx 50ms, which is what I expect to read! I do need to be able to do up to 1300 though).

Please, no confusing code, just an explanation of what I should do would suffice. I struggle a lot when I’m working with this amount of code, so unless someone is going to put together a class which will read all of this, with a structure to store it (so I can convert it to work with mine), I’d appreciate literally minimal code.

  • 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-14T21:00:50+00:00Added an answer on June 14, 2026 at 9:00 pm

    For the primitive types if you know the offset you can simply take the bits from offset n (beginning of data) to n+1 and use a BitConverter to convert to the type. Because you can’t specify an end with methods such as ToInt32(byte[] value, int startIndex) you’ll have to copy the bytes into a new array.

    Lets just assume every thing is an int for this example. I’m also going to assume all of the offsets are in an array. Bytes is the memblock you got from ReadInt32

    int[] values = new int[Bytes.Length/4];
    byte[] current = new byte[4];
    BitConverter bc = new BitConvert();
    for (i = 0; i < Bytes.Length/4 -1; i++)
    {
         Buffer(Bytes, i(4), current, 0, 4); 
         values[i] = bc.ToInt32(current, 0);   
    }
    

    This is a huge simplification but it should be enough to get you moving in the right direction. You may not even want to use a loop (maybe you just hard code all of the BitConverter instructions, that is how you do serialization when reading from a db in C/C++) If you have many types that will also make things simpler. Either way the basic concept will be to use a bit converter to convert sections of the bytes you read from the other program into their respective properties in your data structure.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
For some reason, after submitting a string like this Jack’s Spindle from a text
I would like to run a str_replace or preg_replace which looks for certain words
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.