View previous topic :: View next topic |
Author |
Message |
noxrawr Newbie cheater
Reputation: 0
Joined: 15 Oct 2010 Posts: 13 Location: Netherlands
|
Posted: Fri Oct 15, 2010 10:31 am Post subject: c# reading bytes |
|
|
Hello folks,
I have found a particular adress I was looking for, however the same adress consists of 1 byte and 4 bytes both with different values.
replace the ** with tt, cant posts urls yet on this forum
h**p://img140.imageshack.us/f/memreading.jpg/
Now I want to display the value of the 4 bytes in my own written application, heres a piece of code:
pReader.ReadProcess = myProcesses[0];
pReader.OpenProcess();
int myhp = 0x0EA902D4;
int bytesRead;
int gethp;
byte[] hp;
hp = pReader.ReadProcessMemory((IntPtr)myhp, 1, out bytesRead);
gethp = hp[0];
label1.Text = gethp.ToString();
currently it returns 113, but I want it to return 625, what should I adjust in this code to achieve this?
Thanks in advance.
Regards
|
|
Back to top |
|
 |
Deltron Z Expert Cheater
Reputation: 1
Joined: 14 Jun 2009 Posts: 164
|
Posted: Fri Oct 15, 2010 10:54 am Post subject: |
|
|
Use BitConvertert methods to convert byte array to another type.
|
|
Back to top |
|
 |
noxrawr Newbie cheater
Reputation: 0
Joined: 15 Oct 2010 Posts: 13 Location: Netherlands
|
Posted: Fri Oct 15, 2010 10:58 am Post subject: |
|
|
Could you please give an example?
Cheers.
EDIT:
I tried this but it gave me an exception:
int i = BitConverter.ToInt32(hp, 0);
label1.Text = i.ToString() + " bytes" + bytesRead.ToString();
|
|
Back to top |
|
 |
Deltron Z Expert Cheater
Reputation: 1
Joined: 14 Jun 2009 Posts: 164
|
Posted: Fri Oct 15, 2010 12:34 pm Post subject: |
|
|
Notice that you've been reading only 1 byte. read 2 and convert to Int16 or read 4 and read Int32.
|
|
Back to top |
|
 |
noxrawr Newbie cheater
Reputation: 0
Joined: 15 Oct 2010 Posts: 13 Location: Netherlands
|
Posted: Fri Oct 15, 2010 1:45 pm Post subject: |
|
|
Im really sorry for asking this but how do I read 2 or 4 bytes? I am very new to this
|
|
Back to top |
|
 |
Jesper Grandmaster Cheater Supreme
Reputation: 9
Joined: 21 Feb 2007 Posts: 1156
|
Posted: Fri Oct 15, 2010 1:48 pm Post subject: |
|
|
Do you have teamviewer?
|
|
Back to top |
|
 |
Deltron Z Expert Cheater
Reputation: 1
Joined: 14 Jun 2009 Posts: 164
|
Posted: Fri Oct 15, 2010 1:55 pm Post subject: |
|
|
SwallowIt wrote: | Do you have teamviewer? |
No need to spoon feed him.
Look at the ReadProcessMemory function, one of the parameters is the number of bytes to read - if you look at your code, you'll see it's set to 1. change it to 4 or whatever you want.
Anyway, I suggest you to first learn the language properly, start from the basics - variables, loops, functions and only after a while, when you master the language, try doing a little more complicated things, instead of getting confused from learning how to read memory, basics of hacking, data types and representations in memory, language syntax and functions - it's too much to do at once. take one step at a time.
|
|
Back to top |
|
 |
Jesper Grandmaster Cheater Supreme
Reputation: 9
Joined: 21 Feb 2007 Posts: 1156
|
Posted: Fri Oct 15, 2010 1:59 pm Post subject: |
|
|
I don't intend to spoonfeed him, I'm simply bored and I enjoy programming.
|
|
Back to top |
|
 |
noxrawr Newbie cheater
Reputation: 0
Joined: 15 Oct 2010 Posts: 13 Location: Netherlands
|
Posted: Fri Oct 15, 2010 2:18 pm Post subject: |
|
|
I have managed to make it work
Thanks to all who contributed <3
|
|
Back to top |
|
 |
|