UnhappyAbout "Nick Name Changer" in VB.NET

Posts 19 of 9 · Page 1 of 1
About "Nick Name Changer" in VB.NET
First,thanks anyone who answered me
That address include Pointer & Offset
I will be basic Read/Write Pointer & Offset, but i don't know how to do this...(unicode string)
There are no similar examples in Google search
How to read/write unicode string in VB.NET?
01.png39 KB · 70 downloads 02.PNG6 KB · 18 downloads
So you want to make a tool in VB.NET to change the name or what exactly is your question?
Quote Originally Posted by ccman32 View Post
So you want to make a tool in VB.NET to change the name or what exactly is your question?
Yes,i want to make a tool in VB.NET to change the name
But,have no idea which way to turn....anyways
No anyone similar example can learn in google search
Quote Originally Posted by donpusher View Post
Yes,i want to make a tool in VB.NET to change the name
But,have no idea which way to turn....anyways
No anyone similar example can learn in google search
You can "convert" the name you want to a byte array like this:
Code:
Public Shared Function StrToByteArray(str As String) As Byte()
	Dim unicodeEncoding As UnicodeEncoding = New UnicodeEncoding()
	Return unicodeEncoding.GetBytes(str)
End Function
Then write that byte array to the process using WriteProcessMemory.
Quote Originally Posted by ccman32 View Post

You can "convert" the name you want to a byte array like this:
Code:
Public Shared Function StrToByteArray(str As String) As Byte()
	Dim unicodeEncoding As UnicodeEncoding = New UnicodeEncoding()
	Return unicodeEncoding.GetBytes(str)
End Function
Then write that byte array to the process using WriteProcessMemory.


Code:
Imports System
Imports System.Text
Imports System.Runtime.InteropServices
Imports Microsoft.VisualBasic.Strings

Public Class Form1
    Function GetModuleHandle(ByVal Processx As String, ByVal modulex As String) As IntPtr
        Dim AAA As Process() = Process.GetProcessesByName(Processx)
        If AAA.Length > 0 Then
            On Error Resume Next
            Dim BBB As ProcessModuleCollection = AAA(0).Modules
            For Each pmod As ProcessModule In BBB
                If pmod.ModuleName = (modulex) Then
                    Return pmod.BaseAddress
                Else
                End If
            Next
        End If
    End Function

    Public Function AVA(ByVal proc As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Byte(), ByVal Level As Integer) As Boolean
        Try
            Dim lvl As Integer = Address
            For i As Integer = 1 To Level
                lvl = ReadLong(proc, lvl,) + Offsets(i - 1)
            Next
            WriteStr(proc, lvl, Value(0),)
            Return True
        Catch ex As Exception
            Return False
        End Try
    End Function

    Public Shared Function StrToByteArray(str As String) As Byte()
        Dim st As UnicodeEncoding = New UnicodeEncoding()
        Return st.GetBytes(str)
    End Function

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Try
            Dim a As Process() = Process.GetProcessesByName("ava")
            Dim Mem As Boolean = True

            Mem = AVA("ava", GetModuleHandle("ava", "ava.exe") + &H2406774, {&H90, &H0}, StrToByteArray(TextBox1.Text), 2)

            If Mem = True Then
                MsgBox("Success", 64, "Try")
            Else
                MsgBox("Failed", 64, "Try")
            End If
        Catch ex As Exception

        End Try
Where's i do wrong? or some things i missed
This code are written on correct Address.
But,when I execute he always writes 1st string only...
ex:MPGH , only write "M" to processmemory
Quote Originally Posted by donpusher View Post
Code:
Imports System
Imports System.Text
Imports System.Runtime.InteropServices
Imports Microsoft.VisualBasic.Strings

Public Class Form1
    Function GetModuleHandle(ByVal Processx As String, ByVal modulex As String) As IntPtr
        Dim AAA As Process() = Process.GetProcessesByName(Processx)
        If AAA.Length > 0 Then
            On Error Resume Next
            Dim BBB As ProcessModuleCollection = AAA(0).Modules
            For Each pmod As ProcessModule In BBB
                If pmod.ModuleName = (modulex) Then
                    Return pmod.BaseAddress
                Else
                End If
            Next
        End If
    End Function

    Public Function AVA(ByVal proc As String, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Byte(), ByVal Level As Integer) As Boolean
        Try
            Dim lvl As Integer = Address
            For i As Integer = 1 To Level
                lvl = ReadLong(proc, lvl,) + Offsets(i - 1)
            Next
            WriteStr(proc, lvl, Value(0),)
            Return True
        Catch ex As Exception
            Return False
        End Try
    End Function

    Public Shared Function StrToByteArray(str As String) As Byte()
        Dim st As UnicodeEncoding = New UnicodeEncoding()
        Return st.GetBytes(str)
    End Function

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Try
            Dim a As Process() = Process.GetProcessesByName("ava")
            Dim Mem As Boolean = True

            Mem = AVA("ava", GetModuleHandle("ava", "ava.exe") + &H2406774, {&H90, &H0}, StrToByteArray(TextBox1.Text), 2)

            If Mem = True Then
                MsgBox("Success", 64, "Try")
            Else
                MsgBox("Failed", 64, "Try")
            End If
        Catch ex As Exception

        End Try
Where's i do wrong? or some things i missed
This code are written on correct Address.
But,when I execute he always writes 1st string only...
ex:MPGH , only write "M" to processmemory
You are only passing the first byte of "Value" to your "WriteStr" function so why would you expect it to write anything else than just the first character?
Try this:
Code:
Imports System.Text
Imports System.Runtime.InteropServices

Public Class Form1
    Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, <[In](), Out()> ByVal buffer As Byte(), ByVal size As UInt32, ByRef lpNumberOfBytesRead As IntPtr) As Int32
    Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByVal lpBuffer As Byte(), ByVal nSize As System.UInt32, <Out()> ByRef lpNumberOfBytesWritten As IntPtr) As Boolean

    Private Function ReadBytes(ByVal ProcessHandle As IntPtr, ByVal memAdr As Long, ByVal bytesToRead As UInteger) As Byte()
        Dim BytesRead As IntPtr
        Dim Buffer As Byte() = New Byte(bytesToRead - 1) {}
        ReadProcessMemory(ProcessHandle, New IntPtr(memAdr), Buffer, bytesToRead, BytesRead)
        Return Buffer
    End Function

    Public Function WriteBytes(ByVal ProcessHandle As IntPtr, ByVal memAdr As Long, ByVal bytes As Byte(), ByVal length As UInteger) As Boolean
        Dim BytesWritten As IntPtr
        Dim Result As Integer = WriteProcessMemory(ProcessHandle, New IntPtr(memAdr), bytes, length, BytesWritten)
        Return Result <> 0
    End Function

    Public Function ReadInt32(ByVal ProcessHandle As IntPtr, ByVal memAdr As Int32) As Integer
        Return BitConverter.ToInt32(ReadBytes(ProcessHandle, memAdr, 4), 0)
    End Function

    Public Function AVA(ByVal ProcessHandle As IntPtr, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Byte()) As Boolean
        Try
            Dim Current As Integer = Address
            For i As Integer = 1 To Offsets.Length
                Current = ReadInt32(ProcessHandle, Current) + Offsets(i - 1)
            Next
            WriteBytes(ProcessHandle, Current, Value, Value.Length)
            Return True
        Catch ex As Exception
            Return False
        End Try
    End Function

    Public Shared Function StrToByteArray(str As String) As Byte()
        Dim UE As UnicodeEncoding = New UnicodeEncoding()
        Return UE.GetBytes(str)
    End Function

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Try
            Dim AVAProcesses As Process() = Process.GetProcessesByName("AVA")
            If AVAProcesses.Length > 0 Then
                Dim Mem As Boolean = AVA(AVAProcesses(0).Handle, AVAProcesses(0).MainModule.BaseAddress + &H2406774, {&H90, &H0}, StrToByteArray(TextBox1.Text + vbNullChar))
                If Mem = True Then
                    MsgBox("Success", 64, "Try")
                Else
                    MsgBox("Failed", 64, "Try")
                End If
            Else
                MsgBox("Process not found", 64, "Try")
            End If
        Catch ex As Exception
            MsgBox("Error", 64, "Catch")
        End Try
    End Sub
End Class
Quote Originally Posted by ccman32 View Post

You are only passing the first byte of "Value" to your "WriteStr" function so why would you expect it to write anything else than just the first character?
Try this:
Code:
Imports System.Text
Imports System.Runtime.InteropServices

Public Class Form1
    Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, <[In](), Out()> ByVal buffer As Byte(), ByVal size As UInt32, ByRef lpNumberOfBytesRead As IntPtr) As Int32
    Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByVal lpBuffer As Byte(), ByVal nSize As System.UInt32, <Out()> ByRef lpNumberOfBytesWritten As IntPtr) As Boolean

    Private Function ReadBytes(ByVal ProcessHandle As IntPtr, ByVal memAdr As Long, ByVal bytesToRead As UInteger) As Byte()
        Dim BytesRead As IntPtr
        Dim Buffer As Byte() = New Byte(bytesToRead - 1) {}
        ReadProcessMemory(ProcessHandle, New IntPtr(memAdr), Buffer, bytesToRead, BytesRead)
        Return Buffer
    End Function

    Public Function WriteBytes(ByVal ProcessHandle As IntPtr, ByVal memAdr As Long, ByVal bytes As Byte(), ByVal length As UInteger) As Boolean
        Dim BytesWritten As IntPtr
        Dim Result As Integer = WriteProcessMemory(ProcessHandle, New IntPtr(memAdr), bytes, length, BytesWritten)
        Return Result <> 0
    End Function

    Public Function ReadInt32(ByVal ProcessHandle As IntPtr, ByVal memAdr As Int32) As Integer
        Return BitConverter.ToInt32(ReadBytes(ProcessHandle, memAdr, 4), 0)
    End Function

    Public Function AVA(ByVal ProcessHandle As IntPtr, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Byte()) As Boolean
        Try
            Dim Current As Integer = Address
            For i As Integer = 1 To Offsets.Length
                Current = ReadInt32(ProcessHandle, Current) + Offsets(i - 1)
            Next
            WriteBytes(ProcessHandle, Current, Value, Value.Length)
            Return True
        Catch ex As Exception
            Return False
        End Try
    End Function

    Public Shared Function StrToByteArray(str As String) As Byte()
        Dim UE As UnicodeEncoding = New UnicodeEncoding()
        Return UE.GetBytes(str)
    End Function

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Try
            Dim AVAProcesses As Process() = Process.GetProcessesByName("AVA")
            If AVAProcesses.Length > 0 Then
                Dim Mem As Boolean = AVA(AVAProcesses(0).Handle, AVAProcesses(0).MainModule.BaseAddress + &H2406774, {&H90, &H0}, StrToByteArray(TextBox1.Text + vbNullChar))
                If Mem = True Then
                    MsgBox("Success", 64, "Try")
                Else
                    MsgBox("Failed", 64, "Try")
                End If
            Else
                MsgBox("Process not found", 64, "Try")
            End If
        Catch ex As Exception
            MsgBox("Error", 64, "Catch")
        End Try
    End Sub
End Class
Thank you for making me understand somethings.
This code is definitely worth learning.
I can't express my gratitude enough.
Quote Originally Posted by ccman32 View Post

You are only passing the first byte of "Value" to your "WriteStr" function so why would you expect it to write anything else than just the first character?
Try this:
Code:
Imports System.Text
Imports System.Runtime.InteropServices

Public Class Form1
    Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, <[In](), Out()> ByVal buffer As Byte(), ByVal size As UInt32, ByRef lpNumberOfBytesRead As IntPtr) As Int32
    Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByVal lpBuffer As Byte(), ByVal nSize As System.UInt32, <Out()> ByRef lpNumberOfBytesWritten As IntPtr) As Boolean

    Private Function ReadBytes(ByVal ProcessHandle As IntPtr, ByVal memAdr As Long, ByVal bytesToRead As UInteger) As Byte()
        Dim BytesRead As IntPtr
        Dim Buffer As Byte() = New Byte(bytesToRead - 1) {}
        ReadProcessMemory(ProcessHandle, New IntPtr(memAdr), Buffer, bytesToRead, BytesRead)
        Return Buffer
    End Function

    Public Function WriteBytes(ByVal ProcessHandle As IntPtr, ByVal memAdr As Long, ByVal bytes As Byte(), ByVal length As UInteger) As Boolean
        Dim BytesWritten As IntPtr
        Dim Result As Integer = WriteProcessMemory(ProcessHandle, New IntPtr(memAdr), bytes, length, BytesWritten)
        Return Result <> 0
    End Function

    Public Function ReadInt32(ByVal ProcessHandle As IntPtr, ByVal memAdr As Int32) As Integer
        Return BitConverter.ToInt32(ReadBytes(ProcessHandle, memAdr, 4), 0)
    End Function

    Public Function AVA(ByVal ProcessHandle As IntPtr, ByVal Address As Integer, ByVal Offsets As Integer(), ByVal Value As Byte()) As Boolean
        Try
            Dim Current As Integer = Address
            For i As Integer = 1 To Offsets.Length
                Current = ReadInt32(ProcessHandle, Current) + Offsets(i - 1)
            Next
            WriteBytes(ProcessHandle, Current, Value, Value.Length)
            Return True
        Catch ex As Exception
            Return False
        End Try
    End Function

    Public Shared Function StrToByteArray(str As String) As Byte()
        Dim UE As UnicodeEncoding = New UnicodeEncoding()
        Return UE.GetBytes(str)
    End Function

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Try
            Dim AVAProcesses As Process() = Process.GetProcessesByName("AVA")
            If AVAProcesses.Length > 0 Then
                Dim Mem As Boolean = AVA(AVAProcesses(0).Handle, AVAProcesses(0).MainModule.BaseAddress + &H2406774, {&H90, &H0}, StrToByteArray(TextBox1.Text + vbNullChar))
                If Mem = True Then
                    MsgBox("Success", 64, "Try")
                Else
                    MsgBox("Failed", 64, "Try")
                End If
            Else
                MsgBox("Process not found", 64, "Try")
            End If
        Catch ex As Exception
            MsgBox("Error", 64, "Catch")
        End Try
    End Sub
End Class


You should have pointer him/her to your source on the simple vb trainer.
nothing wrong with mine
forgot to add the first letter
but its alright too late nothing left to do
Posts 19 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?