| View previous topic :: View next topic |
| Author |
Message |
CyClonenl Newbie cheater
Reputation: 0
Joined: 12 Mar 2005 Posts: 24
|
Posted: Tue Feb 19, 2008 5:18 am Post subject: C# Read/WriteProcessMemory class. |
|
|
Hi,
I've made a C# Class that will make reading and writing memory simple.
The source is in the attachment, it comes with a minesweeper example. Its just made quickly to show what its capable of.
The class currently has the following features:
Selecting the process by three ways: Process name, Existing process class and handle.
| Code: | public MemoryEdit(Process process)
public MemoryEdit(IntPtr handle)
public MemoryEdit(string processName)
|
Simple read memory, just give the address and length and it will read.
| Code: |
public byte[] readMemory(IntPtr Address, uint bytesToRead)
|
3 overloads of writeprocessmemory, that will accept byte, int and (thanks to samuri25404) string.
| Code: | public bool writeMemory(IntPtr Address, byte [] bytesToWrite)
public bool writeMemory(IntPtr Address, int intToWrite)
public bool writeMemory(IntPtr Address, string opCode) |
It also has an event, which fires when the process you hooked on closes. I've made it in Visual Studio 2005.
Credits too samuri25404 for the Opcode class, DarkByte for cheatengine
Last edited by CyClonenl on Tue Feb 19, 2008 4:16 pm; edited 1 time in total |
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Tue Feb 19, 2008 9:16 am Post subject: |
|
|
Where's those credits that you spoke so much of?
_________________
|
|
| Back to top |
|
 |
CyClonenl Newbie cheater
Reputation: 0
Joined: 12 Mar 2005 Posts: 24
|
Posted: Tue Feb 19, 2008 4:17 pm Post subject: |
|
|
| Code: | | ...pt byte, int and (thanks to samuri25404) string... |
But i added a footnote. Sorry.
I'm currently trying to add a CreateCave method, that'll create a code cave automatically.
| Code: | | CreateCave(IntPtr baseAddress, byte[] bytesToWrite) |
But i'm having some trouble turning opcodes to bytes.
| Code: | | byte[] jmpAdd = Opcode.Converter.GetBytes("JMP [" + baseAddress + "]", ""); |
Wont work xD And when i try a manual address, it also gives the not found error.
|
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Tue Feb 19, 2008 4:22 pm Post subject: |
|
|
opcodes = bytes.
Human interpretation = mnemonic.
_________________
|
|
| Back to top |
|
 |
CyClonenl Newbie cheater
Reputation: 0
Joined: 12 Mar 2005 Posts: 24
|
Posted: Wed Feb 20, 2008 9:35 am Post subject: |
|
|
Ok,
So i have trouble converting Opcodes from String to Bytes...
Gonna mess with marshal a bit.
|
|
| Back to top |
|
 |
|