Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › C# Programming › How to use Pointer + Offset in C#?

How to use Pointer + Offset in C#?

Posts 1–11 of 11 · Page 1 of 1
_PuRe.LucK*
_PuRe.LucK*
How to use Pointer + Offset in C#?
Question in title ^_^
#1 · 13y ago
AT
atom0s
If your C# stuff is injected, use the Marshal class, such as:
var basePtr = new IntPtr(0x12345678);
var ptrVal = Marshal.ReadIntPtr(basePointer);
Marshal.WriteByte(new IntPtr(ptrVal.ToInt32() + 0x123), 0x90);
If you are externally reading/writing, then use ReadProcessMemory / WriteProcessMemory.
pinvoke.net: readprocessmemory (kernel32)
pinvoke.net: writeprocessmemory (kernel32)

Read the pointer, convert it to an Int32 using BitConverter, then add the offset, read again etc. for each offset.
#2 · 13y ago
_PuRe.LucK*
_PuRe.LucK*
Quote Originally Posted by atom0s View Post
If your C# stuff is injected, use the Marshal class, such as:


If you are externally reading/writing, then use ReadProcessMemory / WriteProcessMemory.
pinvoke.net: readprocessmemory (kernel32)
pinvoke.net: writeprocessmemory (kernel32)

Read the pointer, convert it to an Int32 using BitConverter, then add the offset, read again etc. for each offset.
Thanks this will help




But how I can do this?

So?

ReadProcessMemory(bla, bla, bla);
...
// Add ofsset
WriteProcessMemory(bla, bla, bla);

how to add it(offset)?

Oh you mean so

// Read pointer
return (IntPtr)(BitConverter.ToInt32(memory, 0) + Offset);
#3 · edited 13y ago · 13y ago
rabir007
rabir007
Quote Originally Posted by Nik0815 View Post
Thanks this will help




But how I can do this?

So?

ReadProcessMemory(bla, bla, bla);
...
// Add ofsset
WriteProcessMemory(bla, bla, bla);

how to add it(offset)?

Oh you mean so

// Read pointer
return (IntPtr)(BitConverter.ToInt32(memory, 0) + Offset);

As i see you are using External editing...
So:
Pointer + Offset looks like:
Code:
IntPtr Pointer = 0xEACBD
int Offset = 0x555
IntPtr PointTo = ReadMem(Pointer)
WriteMem(
Code:
PointTo + Offset, 999)
Edit: ^ Vbulletion auto-correction fuck up the post -_-
#4 · edited 13y ago · 13y ago
_PuRe.LucK*
_PuRe.LucK*
Quote Originally Posted by rabir007 View Post



As i see you are using External editing...
So:
Pointer + Offset looks like:
Code:
IntPtr Pointer = 0xEACBD
int Offset = 0x555
IntPtr PointTo = ReadMem(Pointer)
WriteMem(
Code:
PointTo + Offset, 999)
Edit: ^ Vbulletion auto-correction fuck up the post -_-

Thanks you

And with more Offsets?
#5 · edited 13y ago · 13y ago
AR
Artak
OM me i ll help u
#6 · 13y ago
AT
atom0s
Quote Originally Posted by Nik0815 View Post
Thanks this will help

But how I can do this?

So?

ReadProcessMemory(bla, bla, bla);
...
// Add ofsset
WriteProcessMemory(bla, bla, bla);

how to add it(offset)?

Oh you mean so

// Read pointer
return (IntPtr)(BitConverter.ToInt32(memory, 0) + Offset);

You'd loop each offset and keep reading the pointers. Heres some pseudo code on what you'd do:
Code:
var baseAddress     = new IntPtr(0x12345678);
var offsetList      = new int[] { 0x12, 0x22, 0x033, 0x44, 0x55, 0x67 };
var buffer          = new byte[4];
var lpOutStorage    = IntPtr.Zero;

// Read the base pointer..
ReadProcessMemory( process.Handle, baseAddress, buffer, (uint)buffer.Length, ref lpOutStorage );

// Loop each offset and read the pointers..
for (int x = 0; x < offsetList.Length - 1; x++)
{
    baseAddress = BitConverter.ToInt32(buffer, 0) + offsetList[x];
    ReadProcessMemory( process.Handle, baseAddress, buffer, (uint)buffer.Length, ref lpOutStorage );
}

// Read the last pointer+offset as the main value..
var valueBuffer = new byte[255];
baseAddress = BitConverter.ToInt32(btBuffer, 0) + offsetList[offsetList.Length - 1];
ReadProcessMemory( process.Handle, baseAddress, valueBuffer, (uint)valueBuffer.Length, ref lpOutStorage );
#7 · 13y ago
_PuRe.LucK*
_PuRe.LucK*
Quote Originally Posted by atom0s View Post
You'd loop each offset and keep reading the pointers. Heres some pseudo code on what you'd do:
Code:
var baseAddress     = new IntPtr(0x12345678);
var offsetList      = new int[] { 0x12, 0x22, 0x033, 0x44, 0x55, 0x67 };
var buffer          = new byte[4];
var lpOutStorage    = IntPtr.Zero;

// Read the base pointer..
ReadProcessMemory( process.Handle, baseAddress, buffer, (uint)buffer.Length, ref lpOutStorage );

// Loop each offset and read the pointers..
for (int x = 0; x < offsetList.Length - 1; x++)
{
    baseAddress = BitConverter.ToInt32(buffer, 0) + offsetList[x];
    ReadProcessMemory( process.Handle, baseAddress, buffer, (uint)buffer.Length, ref lpOutStorage );
}

// Read the last pointer+offset as the main value..
var valueBuffer = new byte[255];
baseAddress = BitConverter.ToInt32(btBuffer, 0) + offsetList[offsetList.Length - 1];
ReadProcessMemory( process.Handle, baseAddress, valueBuffer, (uint)valueBuffer.Length, ref lpOutStorage );
Works this without marshall class like Rabirs method
#8 · 13y ago
AT
atom0s
Marshal is only for if your dll is injected. It allows you to directly access the memory without needing 'unsafe' code.
#9 · 13y ago
rabir007
rabir007
Quote Originally Posted by Nik0815 View Post
Works this without marshall class like Rabirs method
With more offset:
Pointer1 = Ptr + Offset1;
Pointer2 = Pointer1 + Offset2;
Pointer3 = Pointer2 + Offset3;
Money = Pointer3 + MoneyOffset;

Etc...
You can use loops, it makes things easier...
Good luck...
#10 · 13y ago
_PuRe.LucK*
_PuRe.LucK*
Quote Originally Posted by rabir007 View Post


With more offset:
Pointer1 = Ptr + Offset1;
Pointer2 = Pointer1 + Offset2;
Pointer3 = Pointer2 + Offset3;
Money = Pointer3 + MoneyOffset;

Etc...
You can use loops, it makes things easier...
Good luck...
Ah okay thank you
#11 · 13y ago
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

  • How to use pointer from CheatEngine in C#By pakistanihaider in Call of Duty Modern Warfare 3 Coding, Programming & Source Code
    24Last post 14y ago
  • How TO Find THis Offset Using OllyDbg!By Jhem in Piercing Blow Hack Coding/Source Code
    6Last post 13y ago
  • How to use OllyDGB to find offsetsBy super*eagle in Crossfire Coding Help & Discussion
    1Last post 13y ago
  • How to use GameStatus Pointer!By seeplusplus in Combat Arms Hack Coding / Programming / Source Code
    14Last post 15y ago
  • [vb6] How do i read a float from memory(pointer+offset)+how to use multilevelpointerBy freitag in Visual Basic Programming
    5Last post 17y ago

Tags for this Thread

None