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# Aob cheats

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

Joined: 20 Nov 2008
Posts: 4

PostPosted: Fri Aug 24, 2012 2:47 pm    Post subject: C# Aob cheats Reply with quote

Hi,
could someone please help me in this?
I am using a trainer template from internet that I found. The trainer does use static address like this :

Code:
private void AcheatToggle()
      {
         if (Acheat)
         {
         if (oM.OpenProcess(GameProcess) &&
                 oM.Write(0x004D955B, new byte[] { 0x74, 0x3C }))
            {
               Acheat = false;
               hListView.Items[0].BackColor = Color.FromArgb(255, 0, 0);
            }
         }
         else
         {
            if (oM.OpenProcess(GameProcess) &&
                      oM.Write(0x004D955B, new byte[] { 0xeb, 0x3C }))
            {
               Acheat = true;
               hListView.Items[0].BackColor = Color.FromArgb(0, 255, 0);
            }
         }
            }



What I need is to write via my aob's . how can I do this .

Tkank you
Back to top
View user's profile Send private message
gamesguru
Grandmaster Cheater
Reputation: 0

Joined: 22 Mar 2006
Posts: 926
Location: detroit

PostPosted: Fri Aug 24, 2012 8:28 pm    Post subject: Reply with quote

Scan memory for addresses whose value is the AOB of interest, then write your new, desired AOBs. This would require your to code in your program a complete process scan over the memory region where the address falls.

Alternatively, you may not need to write via AOBs if it is a pointer or static. But then why would you need to write via AOBs? In that case, use cheat engine to to find the pointer and offset(s), then use a combo of ReadProcessMemory() and WriteProcessMemory() to write the new AOBs to the address.

_________________
Back to top
View user's profile Send private message
deve48
How do I cheat?
Reputation: 0

Joined: 20 Nov 2008
Posts: 4

PostPosted: Fri Aug 24, 2012 8:31 pm    Post subject: Reply with quote

maybee I write wrong , sorry my english . I need to write via aobs like the aob cheat tables work in CE .
Back to top
View user's profile Send private message
gamesguru
Grandmaster Cheater
Reputation: 0

Joined: 22 Mar 2006
Posts: 926
Location: detroit

PostPosted: Sat Aug 25, 2012 10:13 pm    Post subject: Reply with quote

Yes, so you perform a scan to find addresses whose value is the AoB (using ReadProcessMemory()). If you do this correctly, your scan will return only one unique address for each updated game version. This will be the address you write to (using WriteProcessMemory()). Depending on what you want to write, you may need to borrow from darkbyte's source, to create hooks for your trainer to allocate memory and similar things. If you just need to change a few bytes, you won't need the API hook for memory allocation, just writeprocessmemory. Then you can write your new AOB to the address's value. Darkbyte made it so in his auto assembler, you put, for example, "db AF 70 B0" beneath the address to change its AOB value. using "dd" can change only one byte at a time. You can find an api hook tut for writeprocmem in C# here: http://www.pinvoke.net/default.aspx/kernel32.writeprocessmemory.

C# a bitch, so I'd advise you just learn C++, asm, and delphi if you plan to stick to this for a long time. Java is also good to know.

_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 96

Joined: 25 Jan 2006
Posts: 5511
Location: 127.0.0.1

PostPosted: Sun Aug 26, 2012 2:38 am    Post subject: Reply with quote

There is nothing wrong with using C# for this. The end result of code will look almost 100% identical to C++

For scanning for an AoB in C#:
http://www.gamedeception.net/threads/14470-FindPattern-in-C

Once you have the address you need, just use WriteProcessMemory from there to write your data. There are plenty of examples across the net on how to do this in C# (as well as any other language that can access the system API).

_________________
- Retired.
Back to top
View user's profile Send private message
deve48
How do I cheat?
Reputation: 0

Joined: 20 Nov 2008
Posts: 4

PostPosted: Sat Sep 08, 2012 2:40 pm    Post subject: Reply with quote

So since I am a newbie with this C# can someone give me a step by step instruction on how do I go with my form .

I need to add this : gamedeception.net/threads/14470-FindPattern-in-C to my project ? us module ?

then in my code , what do I need to change ?

Code:
private void AcheatToggle()
      {
         if (Acheat)
         {
         if (oM.OpenProcess(GameProcess) &&
                 oM.Write(0x004D955B, new byte[] { 0x74, 0x3C }))
            {
               Acheat = false;
               hListView.Items[0].BackColor = Color.FromArgb(255, 0, 0);
            }
         }
         else
         {
            if (oM.OpenProcess(GameProcess) &&
                      oM.Write(0x004D955B, new byte[] { 0xeb, 0x3C }))
            {
               Acheat = true;
               hListView.Items[0].BackColor = Color.FromArgb(0, 255, 0);
            }
         }
            }


right now it reads from static address and changes the bytes. also my project works with memoryeditor.dll

Hope Iam not asking to much .

My compilied exe works with the Memoryeditor.dll
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 96

Joined: 25 Jan 2006
Posts: 5511
Location: 127.0.0.1

PostPosted: Sat Sep 08, 2012 2:49 pm    Post subject: Reply with quote

If you are unsure how to use the code then you need to stop and take some time to learn the language. Spoon feeding you how to do something is going to teach you.
_________________
- Retired.
Back to top
View user's profile Send private message
deve48
How do I cheat?
Reputation: 0

Joined: 20 Nov 2008
Posts: 4

PostPosted: Sat Sep 08, 2012 2:52 pm    Post subject: Reply with quote

yes you maybee right, I have allready a good working project in C# that I just change the address and compilie , works good. I was just wondering that if someone is willing to help me to add AOB's and not address , so I do not to update my address everytime .
Back to top
View user's profile Send private message
Unbr0ken
Advanced Cheater
Reputation: 2

Joined: 10 Aug 2011
Posts: 67

PostPosted: Sat Sep 08, 2012 3:54 pm    Post subject: Reply with quote

deve48 wrote:
yes you maybee right, I have allready a good working project in C# that I just change the address and compilie , works good. I was just wondering that if someone is willing to help me to add AOB's and not address , so I do not to update my address everytime .


Can't you read?

Learn to program before!, Then you will not have the need to copy/paste.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
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)