unknowncheats uc-forum.com ucdownloads ucdownloads.com

Go Back   UC-Tutorials - Multiplayer Game Hacking and Cheat Tutorials > Programming > C and C++

- Sponsored Advertisement -
http://www.myfpscheats.com/


Reply
 
Thread Tools Display Modes
  #1  
Old 02-09-2009, 04:17 AM
Alkatraz Alkatraz is offline
Administrator
 
Join Date: Jan 2007
Posts: 72
Default [Tutorial] - Hack Stuff in C# (VB/C#.NET)

credits to d1gitalSLR


This is my first tutorial for Unknown Cheats, the people here are so nice.

So heres me giving back.

http://www.codeproject.com/KB/trace/...oryreader.aspx

That is a good read to get you started with the MemoryProcessReaderLib

It has a hook and its pre-setup to call the Win32 C++ WriteProcessMemory and ReadProcessMemory.

Now for the start of your class. You will need to add these using Statements.

PHP Code:
using System.Diagnostics;
using ProcessMemoryReaderLib
At the beginning of your partial class (if you are doing this in a windows form) add these:

PHP Code:
ProcessMemoryReader Reader = new ProcessMemoryReader();
Process[] MyProcess Process.GetProcessesByName("GAME");// Do Not Include the .exe part
ProcessModule mainModule;
int GAMEBaseAddress// Base Address
int bytesReadSize// out Value not used 
Where ever you have your C# dll or Form in my case loaded add code like this.
PHP Code:
private void Form1_Load(object senderEventArgs e)
        {
            try
            {
                
mainModule MyProcess[0].MainModule;
                
GAMEBaseAddress = (int)mainModule.BaseAddress;//get base address
                
Reader.ReadProcess MyProcess[0];
                
Reader.OpenProcess();
            }
            catch (
Exception)
            {
                
MessageBox.Show("Please Start GAMENAME\nBefore running this hack.""Error: 120");//dont run unles the game is running
                
Application.Exit();
            }
        } 
Now you are able to do what ever you would nomally do in C++, just with a twist.

For something like a loop on its own thread I would reccomend Timers set to around 100-200ms.

For an example I will just use a button to make things simpler:
PHP Code:
byte[] health;
health Reader.ReadProcessMemory((IntPtr)(GAMEBaseAddress 0xA3DA3C), 4out bytesReadSize); 
It follows this, ReadProcessMemory((IntPtr)(Address), sizeof, out bytesReadSize);

For Writeprocessmemory its simple the same.
PHP Code:
Reader.WriteProcessMemory((IntPtr)(GAMEBaseAddress 0x75D534), BitConverter.GetBytes((float)10), out bytesReadSize); // Writes a int32, BitConverter Converts it to a byte array which can be writen. 
WriteProcessMemory Follows this ((IntPtr)Address, Value2Write, out BytesReadSize)

You can do many diffrent types of pointers with this simple method aswell, I am not 100% sure how to do pointers but this method works just fine.

PHP Code:
int pointer1 BitConverter.ToInt32(Reader.ReadProcessMemory((IntPtr)(GAMEBaseAddress 0xA3DA3C), 4out bytesReadSize), 0);
Reader.WriteProcessMemory((IntPtr)(pointer1 0x75D5E8), BitConverter.GetBytes((float)8), out bytesReadSize); 
I hope this helps someone, Thank you Unknown-Cheats for helping me with an assortment of C++ problems (I'm not too perfect with C++ like I am with C#)
Reply With Quote
Reply

  • Submit Thread to Digg
  • Submit Thread to del.icio.us
  • Submit Thread to StumbleUpon
  • Submit Thread to Google
  • Submit Thread to Facebook
  • Submit Thread to My Yahoo!
  • Submit Thread to MySpace
  • Submit Thread to Twitter
  • Submit Thread to Reddit

Tags
hack, stuff, tutorial, vb or c#net

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 03:09 AM.