 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Felgore Master Cheater
Reputation: 0
Joined: 16 Apr 2007 Posts: 447
|
Posted: Tue Jul 08, 2008 2:54 am Post subject: Memory Editing Using "Memory Editing Class" (C#) |
|
|
Hello everyone,
Well, I decided that i wanted to write an App to edit memory in C#, using Estx's "Memory Editing Class" LINK
At the moment, there is a Text Box, Button and Label on the form.
What is meant to happen is this:
When you click the button, the address typed in t he TextBox is read, and the Value is displayed in the Label.
Here is a code snippet of what Im trying to do:
| Code: |
private void button2_Click(object sender, EventArgs e)
{
int sAddress myMemEditor.ReadMemoryInt(int.Parse(textBox2.Text));
label1.Text = Convert.ToString(sAddress);
}
|
It successfully Builds, but when i type in the address (0x0100579C for Example), and press the button, I get this error:
| Quote: |
FormatException was Unhandled
Input string was not in a correct format
|
In this part of the code: (int.Parse(textBox2.Text));
If anyone has any tips (especially Estx LOL), it would be VERY much appreciated.
I am quite new to the Programming Scene, so I am probably making a very basic error.
Thanks Again, especially to Estx. Good work buddy .
~Felgore.
|
|
| Back to top |
|
 |
Ferocious Advanced Cheater
Reputation: 0
Joined: 06 Feb 2008 Posts: 54
|
Posted: Tue Jul 08, 2008 5:11 am Post subject: |
|
|
prolly you have to do this?
| Quote: | | (int.Parse(textBox2.Text.ToString())); |
_________________
I wanna hack, but I don't know how...
Last edited by Ferocious on Tue Jul 08, 2008 8:52 am; edited 1 time in total |
|
| Back to top |
|
 |
Felgore Master Cheater
Reputation: 0
Joined: 16 Apr 2007 Posts: 447
|
Posted: Tue Jul 08, 2008 5:55 am Post subject: |
|
|
Thanks, ill give it a go.
EDIT: Nah, didn't work. Thanks anyway.
|
|
| Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Tue Jul 08, 2008 7:28 am Post subject: |
|
|
int sAddress = myMemEditor.ReadMemoryInt(Convert.ToInt64(textBox2.Text, 16));
label1.Text = sAddress.ToString();
Just change your code to look like that. =)
Convert.ToInt64(textBox2.Text, 16): Int64 = long, which is what ReadMemoryInt() requires, the 16 in the second argument is the base number, which is the hexadecimal base.
The last part is just a more convenient method of converting to a string.
=)
|
|
| Back to top |
|
 |
Felgore Master Cheater
Reputation: 0
Joined: 16 Apr 2007 Posts: 447
|
Posted: Tue Jul 08, 2008 7:37 am Post subject: |
|
|
| Estx wrote: | int sAddress = myMemEditor.ReadMemoryInt(Convert.ToInt64(textBox2.Text, 16));
label1.Text = sAddress.ToString();
Just change your code to look like that. =)
Convert.ToInt64(textBox2.Text, 16): Int64 = long, which is what ReadMemoryInt() requires, the 16 in the second argument is the base number, which is the hexadecimal base.
The last part is just a more convenient method of converting to a string.
=) |
Wow, thank you very much!
Ill test it soon (I'm on my Laptop)
EDIT: It works!
Thanks again.
|
|
| Back to top |
|
 |
|
|
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
|
|