🙁 How do i edit a string with visual basic express 2010?

Posts 16–29 of 29 · Page 2 of 2
Quote Originally Posted by getsuga121 View Post
yes, i do, do you want it?
You can give me it, but I can show you how to do this without correct address. .
Did you copy & paste memory class in your main class ?
If you did, add this code:

Code:
If Process_Handle("t6mp") Then
WriteString(address,value) 
End If
Replace address with real address & value with real value.
Don't forget to add &H in front of address(eg. &H0123456)
Error 7 'Process_Handle' is not declared. It may be inaccessible due to its protection level. C:\Users\Getsuga121\Documents\Visual Studio 2010\Projects\Login1\Login1\trainer.vb 94 12 Login1
Error 8 'WriteString' is not declared. It may be inaccessible due to its protection level. C:\Users\Getsuga121\Documents\Visual Studio 2010\Projects\Login1\Login1\trainer.vb 95 13 Login1

i even added both classes and modules and get that

code:
clan:
023049b0

name:
02304944
that is 4d1 so.
Quote Originally Posted by getsuga121 View Post
Error 7 'Process_Handle' is not declared. It may be inaccessible due to its protection level. C:\Users\Getsuga121\Documents\Visual Studio 2010\Projects\Login1\Login1\trainer.vb 94 12 Login1
Error 8 'WriteString' is not declared. It may be inaccessible due to its protection level. C:\Users\Getsuga121\Documents\Visual Studio 2010\Projects\Login1\Login1\trainer.vb 95 13 Login1

i even added both classes and modules and get that

code:
clan:
023049b0

name:
02304944
that is 4d1 so.
Seems that I already have this addresses
No, use only one class.
I prefer Jorndel's class(I used it in example).
If you copied & pasted Jorndel's class, Process_Handle must be there...
I did everything you said aswell, and its still not working, i even made a new project and only added jorndels class and still errors
Ok i took out the other class, it still gives error about write string,etc and what do i use to edit normal integers like ammo because it is not in there.
Quote Originally Posted by getsuga121 View Post
Ok i took out the other class, it still gives error about write string,etc and what do i use to edit normal integers like ammo because it is not in there.

Please copy whole code here.
First I'll help you with string, we can move on integers later.
lol i feel like i am in school messing with integers.

Class BO2_MemoryClass
Private GameProc As String = ""
Private Function OpenGame() As IntPtr
If System.Diagnostics.Process.GetProcessesByName(Game Proc).Length = 1 Then
Return System.Diagnostics.Process.GetProcessesByName(Game Proc)(0).Handle
End If
Return New IntPtr(0)
End Function
Public Enum ProcessAccessFlags As UInteger
All = &H1F0FFF
Terminate = &H1
CreateThread = &H2
Operation = &H8
Read = &H10
Write = &H20
DupHandle = &H40
SetInformation = &H200
QueryInformation = &H400
Synchronize = &H100000
End Enum
<Runtime.InteropServices.DllImport("kernel32.dll") > _
Private Shared Function OpenProcess(dwDesiredAccess As ProcessAccessFlags, <Runtime.InteropServices.MarshalAs(Runtime.Interop Services.UnmanagedType.Bool)> bInheritHandle As Boolean, dwProcessId As Integer) As IntPtr
End Function
<Runtime.InteropServices.DllImport("kernel32.dll") > _
Private Shared Function CloseHandle(hObject As IntPtr) As Boolean
End Function
<Runtime.InteropServices.DllImport("kernel32.dll") > _
Private Shared Function ReadProcessMemory(hProcess As IntPtr, lpBaseAddress As IntPtr, <Runtime.InteropServices.In, Runtime.InteropServices.Out> buffer As Byte(), size As UInt32, ByRef lpNumberOfBytesWritten As IntPtr) As Int32
End Function
<Runtime.InteropServices.DllImport("kernel32.dll") > _
Private Shared Function WriteProcessMemory(hProcess As IntPtr, lpBaseAddress As IntPtr, <Runtime.InteropServices.In, Runtime.InteropServices.Out> buffer As Byte(), size As UInt32, ByRef lpNumberOfBytesWritten As IntPtr) As Int32
End Function


Public Function Process_Handle(ProcessName As String) As Boolean
GameProc = ProcessName
If System.Diagnostics.Process.GetProcessesByName(Proc essName).Length = 1 Then
Return True
End If
Return False
End Function
#Region "Write Stuff"
Public Sub WriteString(Address As Integer, Text As String, Optional Length As Integer = -1)
If Length = -1 Then
Length = Text.Length
End If
Dim Buffer As Byte() = New System.Text.ASCIIEncoding().GetBytes(Text)
Dim Zero As IntPtr = IntPtr.Zero
WriteProcessMemory(OpenGame(), New IntPtr(Address), Buffer, CUInt(Length), Zero)
End Sub
Public Sub WriteInt(Address As Integer, Value As Integer)
Dim buffer As Byte() = BitConverter.GetBytes(Value)
Dim R As IntPtr
WriteProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
End Sub
Public Sub WriteUInt(Address As UInteger, Value As UInteger)
Dim buffer As Byte() = BitConverter.GetBytes(Value)
Dim R As IntPtr
WriteProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
End Sub
Public Sub WriteFloat(Address As Integer, Value As Single)
Dim buffer As Byte() = BitConverter.GetBytes(Value)
Dim R As IntPtr
WriteProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
End Sub
Public Sub WriteBytes(Address As Integer, ByteArray As Byte())
Dim buffer As Byte() = ByteArray
Dim R As IntPtr
WriteProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(buffer.Length), R)
End Sub
#End Region
#Region "Read Stuff"
Public Function ReadString(Address As Integer, Length As Integer) As String
Dim buffer As Byte() = New Byte(Length - 1) {}
Dim R As IntPtr
ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(buffer.Length), R)
Return New System.Text.ASCIIEncoding().GetString(buffer, 0, Length)
End Function
Public Function ReadInt(Address As Integer) As Integer
Dim buffer As Byte() = New Byte(3) {}
Dim R As IntPtr
ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
Return BitConverter.ToInt32(buffer, 0)
End Function
Public Function ReadUInt(Address As UInteger) As UInteger
Dim buffer As Byte() = New Byte(3) {}
Dim R As IntPtr
ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
Return BitConverter.ToUInt32(buffer, 0)
End Function
Public Function ReadFloat(Address As UInteger) As Single
Dim buffer As Byte() = New Byte(7) {}
Dim R As IntPtr
ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(4), R)
Return BitConverter.ToSingle(buffer, 0)
End Function
Public Function ReadBytes(Address As Integer, BytesLength As Integer) As Byte()
Dim buffer As Byte() = New Byte(BytesLength - 1) {}
Dim R As IntPtr
ReadProcessMemory(OpenGame(), New IntPtr(Address), buffer, CUInt(buffer.Length), R)
Return buffer
End Function
#End Region
#Region "Pointers"
Public Function BaseAddress(Module_Name As String) As Integer
Try
If System.Diagnostics.Process.GetProcessesByName(Game Proc).Length <> 0 Then
For Each [Mod] As System.Diagnostics.ProcessModule In System.Diagnostics.Process.GetProcessesByName(Game Proc)(0).Modules
If [Mod].ModuleName = Module_Name Then
Return [Mod].BaseAddress.ToInt32()
End If
Next
Return 0
Else
Return 0
End If
Catch
Console.WriteLine("Base Address Error")
Return 0
End Try
End Function
Public Function Pointers([Module] As String, PointersX As Integer()) As Integer
Dim Base As Integer = BaseAddress([Module]) + PointersX(0)
Dim Runner As Integer = ReadInt(Base) + PointersX(1)
Dim i As Integer = 2
While i <> PointersX.Length - 2
Runner = ReadInt(Runner) + PointersX(i)
i += 1
End While

Return Runner
End Function
#End Region
End Class
Quote Originally Posted by getsuga121 View Post
lol i feel like i am in school messing with integers.
CODE
Next time use code tags .
Code:
If BO2_MemoryClass.Process_Handle("t6mp") Then
BO2_MemoryClass.WriteString(address,value) 
End If
I guess this works.
Error 2 Reference to a non-shared member requires an object reference. C:\Users\Getsuga121\Documents\Visual Studio 2010\Projects\Login1\Login1\trainer.vb 95 12 Login1
What now?
Quote Originally Posted by getsuga121 View Post
Error 2 Reference to a non-shared member requires an object reference. C:\Users\Getsuga121\Documents\Visual Studio 2010\Projects\Login1\Login1\trainer.vb 95 12 Login1
What now?
Sorry for late answer. I went to see what happened in this episode of my favorite TV show.
Yup, I forgot, you have to make reference to memory class.
You can do this:
Code:
Dim BO2 As BO2_MemoryClass
[CODE]
If BO2.Process_Handle("t6mp") Then
BO2.WriteString(address,value)
End If
[CODE]
Whats the tv show?
and thank you it works now <3
Quote Originally Posted by getsuga121 View Post
Whats the tv show?
and thank you it works now <3

You can do same if you want Integer, just replace WriteString with WriteInteger .
Edit:
title: *********enceException was unhandled
title 2:Object reference not set to an instance of an object.
when i try to use the code
Quote Originally Posted by getsuga121 View Post
Edit:
title: *********enceException was unhandled
title 2:Object reference not set to an instance of an object.
when i try to use the code

Sorry. I tought the code works so I went to bed yesterday .
Can you paste code here again ?
Thanks!
Posts 16–29 of 29 · Page 2 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us