| View previous topic :: View next topic |
| Author |
Message |
ElectroFusion Grandmaster Cheater
Reputation: 0
Joined: 17 Dec 2006 Posts: 786
|
Posted: Mon Dec 08, 2008 11:40 am Post subject: [C#] ReadPointer |
|
|
how would I read pointers in C#? I have looked everywhere..
_________________
| qwerty147 wrote: |
| ghostonline wrote: |
what world are you in?
|
bera
but i live in NZ
|
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Mon Dec 08, 2008 11:46 am Post subject: |
|
|
| ..readprocessmemory ?
|
|
| Back to top |
|
 |
ElectroFusion Grandmaster Cheater
Reputation: 0
Joined: 17 Dec 2006 Posts: 786
|
Posted: Mon Dec 08, 2008 11:47 am Post subject: |
|
|
I knew that, but I don't think your getting my question.
_________________
| qwerty147 wrote: |
| ghostonline wrote: |
what world are you in?
|
bera
but i live in NZ
|
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Mon Dec 08, 2008 12:02 pm Post subject: |
|
|
| A pointer points to: the offset + the base address's value.
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Mon Dec 08, 2008 12:04 pm Post subject: |
|
|
| Code: |
public byte[] Read(IntPtr handle, IntPtr address, UInt32 size, ref UInt32 bytes)
{
byte[] buffer = new byte[size];
ReadProcessMemory(handle, address, buffer, size, ref bytes);
Debug.Assert(bytes == size);
return buffer;
}
byte[] loloutput;
loloutput = Read(pHandle, (IntPtr)Addr, 4); //DWORD or ULONG pointer
IntPtr value = BitConverter.ToInt32(loloutput, 0);
|
|
|
| Back to top |
|
 |
ElectroFusion Grandmaster Cheater
Reputation: 0
Joined: 17 Dec 2006 Posts: 786
|
Posted: Tue Dec 09, 2008 9:51 pm Post subject: |
|
|
so I would do this?
| Code: | byte[] memory = { 0x43e }; // OFFSET
pKernel.ReadProcessMemory((IntPtr)ADDRESS, memory); |
_________________
| qwerty147 wrote: |
| ghostonline wrote: |
what world are you in?
|
bera
but i live in NZ
|
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue Dec 09, 2008 10:06 pm Post subject: |
|
|
Wow guy.
It works exactly as you would expect. Read from the static address you hopefully worked your way down to, add the offset if needed.
Repeat until done.
|
|
| Back to top |
|
 |
ElectroFusion Grandmaster Cheater
Reputation: 0
Joined: 17 Dec 2006 Posts: 786
|
Posted: Tue Dec 09, 2008 10:23 pm Post subject: |
|
|
I can't just read the addy, because i'm trying to read character X and Y. So what I said will work or do I have to do something else?
_________________
| qwerty147 wrote: |
| ghostonline wrote: |
what world are you in?
|
bera
but i live in NZ
|
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue Dec 09, 2008 10:40 pm Post subject: |
|
|
What, you have a pointer to the character structure I'm guessing?
Like I said, read from the static address, then add the offset to what you get from it, repeat until you're done if necessarily.
|
|
| Back to top |
|
 |
ElectroFusion Grandmaster Cheater
Reputation: 0
Joined: 17 Dec 2006 Posts: 786
|
Posted: Wed Dec 10, 2008 11:04 am Post subject: |
|
|
AHAH! I got you now.
so it would be | Code: | | IntPtr ADDR = (IntPtr)0xADDR + 0xOFFSET; | ? ya know and then read it through a RPM.
_________________
| qwerty147 wrote: |
| ghostonline wrote: |
what world are you in?
|
bera
but i live in NZ
|
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Dec 10, 2008 12:25 pm Post subject: |
|
|
no
you want to add the offset to the contents that you got out of the static address you hopefully worked your way down too.
example, you've worked it down to 0x00123456.
BYTE offset = 0xAB;
ReadProcessMemory(handle, 0x00123456, &buffer, sizeof(buffer), 0);
buffer += offset;
buffer is now the contents of 0x00123456 + 0xAB and is hopefully pointing to the right address now.
|
|
| Back to top |
|
 |
ElectroFusion Grandmaster Cheater
Reputation: 0
Joined: 17 Dec 2006 Posts: 786
|
Posted: Wed Dec 10, 2008 3:13 pm Post subject: |
|
|
So to modify the value I would do
BYTE offset = 0xAB;
BYTE bytestowrite = 0x7F; // 7F = value in hex
WriteProcessMemory(handle, 0x00123456, &buffer, sizeof(buffer), bytestowrite);
buffer += offset;
_________________
| qwerty147 wrote: |
| ghostonline wrote: |
what world are you in?
|
bera
but i live in NZ
|
|
|
| Back to top |
|
 |
GMZorita Grandmaster Cheater Supreme
Reputation: 0
Joined: 21 Mar 2007 Posts: 1361
|
Posted: Wed Dec 10, 2008 3:44 pm Post subject: |
|
|
| ElectroFusion wrote: | So to modify the value I would do
BYTE offset = 0xAB;
BYTE bytestowrite = 0x7F; // 7F = value in hex
WriteProcessMemory(handle, 0x00123456, &buffer, sizeof(buffer), bytestowrite);
buffer += offset; |
| Code: |
unsigned base = 0x954A2F;
unsigned ptr;
ReadProcessMemory(hProcess, (void*)base, &ptr, 4, NULL);
ptr+=0x5D8;//Offset.
char writeval = 0x7F;
WriteProcessMemory(hProcess,(void*)ptr,&writeval,1,NULL);
|
_________________
Gone |
|
| Back to top |
|
 |
ElectroFusion Grandmaster Cheater
Reputation: 0
Joined: 17 Dec 2006 Posts: 786
|
Posted: Thu Dec 11, 2008 12:27 pm Post subject: |
|
|
my RPM/WPM only takes 2 arguements, so it would have to be
| Code: | | loloutput = Read((IntPtr)Addr, 4); |
Would this still work? or would it only work if I put it in a dll? (because read has no clue what handle)
_________________
| qwerty147 wrote: |
| ghostonline wrote: |
what world are you in?
|
bera
but i live in NZ
|
|
|
| Back to top |
|
 |
GMZorita Grandmaster Cheater Supreme
Reputation: 0
Joined: 21 Mar 2007 Posts: 1361
|
Posted: Thu Dec 11, 2008 1:10 pm Post subject: |
|
|
| ElectroFusion wrote: | my RPM/WPM only takes 2 arguements, so it would have to be
| Code: | | loloutput = Read((IntPtr)Addr, 4); |
Would this still work? or would it only work if I put it in a dll? (because read has no clue what handle) |
Ofcourse it won't work w/o a handle...
_________________
Gone |
|
| Back to top |
|
 |
|