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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:04:51+00:00 2026-06-03T16:04:51+00:00

I am trying to read memory from an process in C#. I found out

  • 0

I am trying to read memory from an process in C#. I found out how to read from an specific address:

    public static byte[] ReadMemory(Process process, int address, int numOfBytes, out int bytesRead)
    {
        IntPtr hProc = OpenProcess(ProcessAccessFlags.All, false, process.Id);
        byte[] buffer = new byte[numOfBytes];
        ReadProcessMemory(hProc, new IntPtr(address), buffer, numOfBytes, out bytesRead);
        return buffer;
    }
    private int getVal(Process proc, int address)
    {
        int bytesRead;
        byte[] value = ReadMemory(proc, address, 4, out bytesRead);
        int am = BitConverter.ToInt32(value, 0);
        return am;
    }
    public void threadFunction()
    {
        Process[] processes = Process.GetProcessesByName("gta_sa");
        foreach (Process process in processes)
        {
            int ServerPointer = getVal(process, 0xB6F5F0);//Its about this line
            MessageBox.Show(ServerPointer.ToString());
        }
    }

but as I am looking trough the web, I keep finding this:

But instead of 0xB6F5F0 I actually need to read address samp.dll+2071C0 (this address I found on the web)

Does anyone know how I can do this?

Thanks in advance

  • 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-03T16:04:54+00:00Added an answer on June 3, 2026 at 4:04 pm

    You need to know the base address of the DLL. That’s readily available through Process.Modules, you want the ProcessModule.BaseAddress property value. An example:

    using System;
    using System.Diagnostics;
    
    class Program {
        static void Main(string[] args) {
            var prc = Process.Start("notepad.exe");
            prc.WaitForInputIdle();
            foreach (ProcessModule module in prc.Modules) {
                if (string.Compare(module.ModuleName, "user32.dll", true) == 0) {
                    Console.WriteLine("User32 loaded at 0x{0:X16}", (long)module.BaseAddress);
                    break;
                }
            }
            prc.Kill();
            Console.ReadLine();
        }
    }
    

    Output:

    User32 loaded at 0x0000000076F20000

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

Sidebar

Related Questions

Iam trying to read a binary file to memory and pass the starting address
I'm trying to read a process memory using the following code: void readdata(HANDLE phandle,
I am trying to read data from a very large binary file and process
Im trying to read a column of String values from my DB. Im trying
I am trying to read a binary file from a program that writes a
I was trying to figure out how much memory I can malloc to maximum
I'm trying to read from a text file using the read function and store
I am trying to read in the pixel data from an image file as
I'm trying to read a number of performance counters from a running .NET 4
Malloc allocates memory from one of the virtual memory regions of the process called

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.