 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
OSIRIS Grandmaster Cheater
Reputation: 0
Joined: 27 Aug 2006 Posts: 654
|
Posted: Sun Sep 07, 2008 1:34 pm Post subject: [VB.NET HELP] How to write to memory adress? (NEED-HELP) |
|
|
If I already know the address and the value.
Last edited by OSIRIS on Sun Sep 07, 2008 2:53 pm; edited 1 time in total |
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Sun Sep 07, 2008 1:41 pm Post subject: |
|
|
use API's
OpenProcess
ReadProcessMemory
WriteProcessMemory
CloseHandle
there's a ProcessMemoryReaderLib on the internet but it's written in C# so it's useless for u unless u know how to convert it to VB.NET
_________________
Stylo |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Sep 07, 2008 1:55 pm Post subject: |
|
|
I'm sure you can manage making 2 buttons and a text box.
| Code: | [code]Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("kernel32.dll")> _
Public Shared Function WriteProcessMemory( _
ByVal hProcess As IntPtr, _
ByVal lpBaseAddress As IntPtr, _
ByVal lpBuffer As Byte(), _
ByVal nSize As UInt32, _
ByRef lpNumberOfBytesWritten As UInt32 _
) As Boolean
End Function
<DllImport("kernel32.dll")> _
Public Shared Function ReadProcessMemory( _
ByVal hProcess As IntPtr, _
ByVal lpBaseAddress As IntPtr, _
ByVal lpBuffer As Byte(), _
ByVal iSize As UInt32, _
ByRef lpNumberOfBytesRead As UInt32 _
) As Boolean
End Function
Dim p As Process() = Process.GetProcessesByName("winmine")
Dim buffer As Byte() = New Byte(3) {}
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WriteProcessMemory(p(0).Handle, &H100579C, New Byte() {&HFF}, 4, 0)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ReadProcessMemory(p(0).Handle, &H100579C, buffer, 4, 0)
TextBox1.Text = Convert.ToString(BitConverter.ToUInt32(buffer, 0))
End Sub
End Class[/code] |
|
|
| Back to top |
|
 |
OSIRIS Grandmaster Cheater
Reputation: 0
Joined: 27 Aug 2006 Posts: 654
|
Posted: Sun Sep 07, 2008 2:07 pm Post subject: |
|
|
| slovach wrote: | I'm sure you can manage making 2 buttons and a text box.
| Code: | [code]Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("kernel32.dll")> _
Public Shared Function WriteProcessMemory( _
ByVal hProcess As IntPtr, _
ByVal lpBaseAddress As IntPtr, _
ByVal lpBuffer As Byte(), _
ByVal nSize As UInt32, _
ByRef lpNumberOfBytesWritten As UInt32 _
) As Boolean
End Function
<DllImport("kernel32.dll")> _
Public Shared Function ReadProcessMemory( _
ByVal hProcess As IntPtr, _
ByVal lpBaseAddress As IntPtr, _
ByVal lpBuffer As Byte(), _
ByVal iSize As UInt32, _
ByRef lpNumberOfBytesRead As UInt32 _
) As Boolean
End Function
Dim p As Process() = Process.GetProcessesByName("winmine")
Dim buffer As Byte() = New Byte(3) {}
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
WriteProcessMemory(p(0).Handle, &H100579C, New Byte() {&HFF}, 4, 0)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
ReadProcessMemory(p(0).Handle, &H100579C, buffer, 4, 0)
TextBox1.Text = Convert.ToString(BitConverter.ToUInt32(buffer, 0))
End Sub
End Class[/code] |
|
It is too hard I don't know what to do. Tell me moar pl0x.
|
|
| Back to top |
|
 |
arigity Advanced Cheater
Reputation: 0
Joined: 03 Jul 2008 Posts: 65 Location: middle of nowhere.
|
|
| Back to top |
|
 |
OSIRIS Grandmaster Cheater
Reputation: 0
Joined: 27 Aug 2006 Posts: 654
|
Posted: Sun Sep 07, 2008 3:16 pm Post subject: |
|
|
Didn't teach anything.
|
|
| Back to top |
|
 |
arigity Advanced Cheater
Reputation: 0
Joined: 03 Jul 2008 Posts: 65 Location: middle of nowhere.
|
Posted: Sun Sep 07, 2008 5:46 pm Post subject: |
|
|
>_> it's simple, ill explain slovach's code with a few modifications and most of it cut out.
step 1. get the process you want to hack
| Code: | | dim MyProcess as process() = Process.GetProcessesByName("winmine") |
(slovach used winmine as the process to hack)
step 2. use writeProcessMemory to do lolhax
| Code: | dim lolhax as valuetype = value '(replace valuetype with what the type of data ie single for float values integer for integer values, and value for what you want it to set it to ie 7.1 or 3)
dim addressToHax as integer = &H*Address here* '&H means its in hex (thats good >_> )
WriteProcessMemory(MyProcess(0).Handle, addressToHax, lolhax, 4, 0)
|
BOOL WINAPI WriteProcessMemory(
__in HANDLE hProcess, = MyProcess(0).Handle
__in LPVOID lpBaseAddress, = addressToHax
__in LPCVOID lpBuffer, = lolhax
__in SIZE_T nSize, = 4
__out SIZE_T *lpNumberOfBytesWritten = 0
);
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Sep 07, 2008 7:06 pm Post subject: |
|
|
| [Stefon] wrote: |
Didn't teach anything. |
I'm using Minesweeper as the example. 100579C is the address to the timer.
1. The first 2 imports are the pinvoke signatures for the API calls. Look them up on pinvoke.net; it is a good resource for this.
2. Look up the System.Diagnostics.Process class on MSDN. I used | Code: | | Process.GetProcessesByName | method to get everything I needed, like the handle to the process.
| Code: | | Dim p As Process() = Process.GetProcessesByName("winmine") |
If you looked it up, you'd surely find that the method returns a process array.
3. | Code: | | Dim buffer As Byte() = New Byte(3) {} | is just creating a new byte array that is 4 bytes large. Look at ReadProcessMemory and it's purpose should become pretty obvious.
| Code: | | WriteProcessMemory(p(0).Handle, &H100579C, New Byte() {&HFF}, 4, 0) |
Remember the process array? p(0) is the first element to the array. The process class does most of the work here and will provide the handle and everything we need.
Next is the address, obvious enough.
Next, I'm declaring a new byte array, which holds one byte of 255. Obviously you don't have to do it this way.
Next is how many bytes to write. I should have wrote 1 actually.
|
|
| Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Mon Sep 08, 2008 4:56 pm Post subject: |
|
|
Wow VB.net is sooooo different from vb6.0
I can give u an example in vb6.0 if u want.
|
|
| 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
|
|