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 


Memory Editing Using "Memory Editing Class" (C#)

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Felgore
Master Cheater
Reputation: 0

Joined: 16 Apr 2007
Posts: 447

PostPosted: Tue Jul 08, 2008 2:54 am    Post subject: Memory Editing Using "Memory Editing Class" (C#) Reply with quote

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 Very Happy.

~Felgore.
Back to top
View user's profile Send private message
Ferocious
Advanced Cheater
Reputation: 0

Joined: 06 Feb 2008
Posts: 54

PostPosted: Tue Jul 08, 2008 5:11 am    Post subject: Reply with quote

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
View user's profile Send private message
Felgore
Master Cheater
Reputation: 0

Joined: 16 Apr 2007
Posts: 447

PostPosted: Tue Jul 08, 2008 5:55 am    Post subject: Reply with quote

Thanks, ill give it a go.

EDIT: Nah, didn't work. Thanks anyway.
Back to top
View user's profile Send private message
Estx
Expert Cheater
Reputation: 0

Joined: 04 Mar 2008
Posts: 172

PostPosted: Tue Jul 08, 2008 7:28 am    Post subject: Reply with quote

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
View user's profile Send private message
Felgore
Master Cheater
Reputation: 0

Joined: 16 Apr 2007
Posts: 447

PostPosted: Tue Jul 08, 2008 7:37 am    Post subject: Reply with quote

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. Very Happy
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