Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C#] pointer/address finding, then using it

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
ak5745
How do I cheat?
Reputation: 0

Joined: 26 Aug 2010
Posts: 4

PostPosted: Thu Aug 26, 2010 11:19 pm    Post subject: [C#] pointer/address finding, then using it Reply with quote

Pointers: I have the address I need, but am unable to find the pointer for it. I aquire what CE thinks is the hex value to search for (always ends up being the address - no offset), I search for it using Exact, 4 bytes, tick Hex, and I always come up empty. Is there something else I should do? I've followed about every tut on here and am still coming up empty.

Also, now that I have this address, I'd like to see if I can somehow have the value (a double) reflected on a form from C# (a textbox). Is this a possibility? I have no need to write to this address value - just want to see it update as the game updates it.

As you can tell, I'm new to programming. This is probably way over my head, but just wanted to see if it could work. Any tips would be greatly appreciated.

Thanks
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Aug 27, 2010 12:15 am    Post subject: Reply with quote

http://msdn.microsoft.com/en-us/library/3hfd35ad.aspx
Back to top
View user's profile Send private message
ak5745
How do I cheat?
Reputation: 0

Joined: 26 Aug 2010
Posts: 4

PostPosted: Fri Aug 27, 2010 8:31 am    Post subject: Reply with quote

Thanks for the link.

So the way I'm seeing it is the double.toString() method will let me reflect a double in a textbox (as a string). How can I get this said double from the game? Since I have its address, is there a method that takes the memory address and retrieves the double value it is storing, alowing me to use double.toString() for the textbox?

Thanks again
Back to top
View user's profile Send private message
TROLOLOLOLOLOLOLOLOLOLOLO
Expert Cheater
Reputation: -1

Joined: 27 Dec 2009
Posts: 100

PostPosted: Fri Aug 27, 2010 5:09 pm    Post subject: Reply with quote

ak5745 wrote:
Thanks for the link.

So the way I'm seeing it is the double.toString() method will let me reflect a double in a textbox (as a string). How can I get this said double from the game? Since I have its address, is there a method that takes the memory address and retrieves the double value it is storing, alowing me to use double.toString() for the textbox?

Thanks again


Try:

Textbox1.Text = myAddress.ToString();

Or something like:

string strMyAddress;
double dblMyAddress = Double.Parse(strMyAddress);

Textbox1.Text = dblMyAddress.ToString();
Back to top
View user's profile Send private message
XaLeX
Expert Cheater
Reputation: 0

Joined: 19 Aug 2008
Posts: 226

PostPosted: Sat Aug 28, 2010 1:24 am    Post subject: Reply with quote

ak5745 wrote:
How can I get this said double from the game? Since I have its address, is there a method that takes the memory address and retrieves the double value it is storing, alowing me to use double.toString() for the textbox?
check out ReadProcessMemory


CometJack wrote:
Textbox1.Text = myAddress.ToString();
That would write the address, not its content.

CometJack wrote:
string strMyAddress;
double dblMyAddress = Double.Parse(strMyAddress);
Textbox1.Text = dblMyAddress.ToString();
Why are you parsing a string to a double back to a string?
Back to top
View user's profile Send private message
ak5745
How do I cheat?
Reputation: 0

Joined: 26 Aug 2010
Posts: 4

PostPosted: Mon Aug 30, 2010 11:27 pm    Post subject: Reply with quote

Thank you for the responses. Now that I have my pointer, would someone know what I need to do to be able to use this pointer in ReadProcessMemory? I found this pointer using the scan, but am unsure how I can use it (I believe it's address + offset, but which combo?) I've tried ((0x029A62D4) + 0x2D8) with no luck (that's adding, right?). Anyway, the list is as it appears on CE:

Address pointed to: 029B8268
Pointer Address: / Offset:
029A62D4 / 2D8
0298071C / 64
023A00D4 / 6D4
0018B030 / D4
Program.exe+0017AFA0 / 7C4

Thanks for the help
Back to top
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 891

PostPosted: Tue Aug 31, 2010 12:14 am    Post subject: Reply with quote

You'd read program.exe + 17afa0 (probably 417afa0), then add 7c4 and read the next pointer, then add d4 and read again, etc.
Back to top
View user's profile Send private message
ak5745
How do I cheat?
Reputation: 0

Joined: 26 Aug 2010
Posts: 4

PostPosted: Tue Aug 31, 2010 1:51 pm    Post subject: Reply with quote

So would this be heading in the right direction? I'm still learning how ReadProcessMemory is used, so I thought I'd try. Not expecting to get it right the first time:

Code:

int bytesReaded;
int pointerBase;
byte[] memory;
int intExample;
           
memory = pReader.ReadProcessMemory((IntPtr)0x417AFA0, 4, out bytesReaded);
pointerBase = memory [0];
pointerBase += 0x7C4;
intExample = memory[0];
MessageBox.Show ("intExample: " + intExample.ToString());


Basically just trying to add offset 7C4. So after offset 7C4 is added, would I then use ReadProcessMemory again and add the next offset after, then rinse and repeat for all other offsets? Would it also be possible to get the final value (a double) in a MessageBox?

Thanks
Back to top
View user's profile Send private message
flash harry
Newbie cheater
Reputation: 0

Joined: 19 Jun 2010
Posts: 16

PostPosted: Wed Sep 01, 2010 3:00 am    Post subject: Reply with quote

ak5745 wrote:
So would this be heading in the right direction? I'm still learning how ReadProcessMemory is used, so I thought I'd try. Not expecting to get it right the first time:

Code:

int bytesReaded;
int pointerBase;
byte[] memory;
int intExample;
           
memory = pReader.ReadProcessMemory((IntPtr)0x417AFA0, 4, out bytesReaded);
pointerBase = memory [0];
pointerBase += 0x7C4;
intExample = memory[0];
MessageBox.Show ("intExample: " + intExample.ToString());


Basically just trying to add offset 7C4. So after offset 7C4 is added, would I then use ReadProcessMemory again and add the next offset after, then rinse and repeat for all other offsets? Would it also be possible to get the final value (a double) in a MessageBox?

Thanks


This helped me to start off:

sites(dot)google(dot)com/site/gametrainerswithcsharp/

i cant post url's yet Sad

there is also a nice lil app called TMH to help with writing it out too, and ProcessMemoryReaderLib class to go with it but im not sure if its any good for multilevel pointers tbh ive not tried it

*EDIT* not sure about the messagebox thing tho.
Back to top
View user's profile Send private message
TROLOLOLOLOLOLOLOLOLOLOLO
Expert Cheater
Reputation: -1

Joined: 27 Dec 2009
Posts: 100

PostPosted: Fri Sep 03, 2010 11:08 pm    Post subject: Reply with quote

XaLeX wrote:
ak5745 wrote:
How can I get this said double from the game? Since I have its address, is there a method that takes the memory address and retrieves the double value it is storing, alowing me to use double.toString() for the textbox?
check out ReadProcessMemory


CometJack wrote:
Textbox1.Text = myAddress.ToString();
That would write the address, not its content.

CometJack wrote:
string strMyAddress;
double dblMyAddress = Double.Parse(strMyAddress);
Textbox1.Text = dblMyAddress.ToString();
Why are you parsing a string to a double back to a string?


I dunno, what the hell was I thinking Shocked
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites