Project:Useful VB.NET 2008 Stuff/Warcraft3NameSpoofer
A very simple console Warcraft III Name Spoofer program for version 1.22a. Credits to Root's (AKA Tyrano) C++ NameSpoofer for some ideas and Enmitix for his Dynamic Memory tutorial.
Click here for the plain code!
NOTE: WHEN RUNNING THIS ON WINDOWS VISTA, BOTH WARCRAFT III AND THIS PROGRAM HAVE TO BE RUN AS ADMINISTRATOR!
Parent Directory: Project:Useful VB.NET 2008 Stuff
Plain Code: VB.NET 2008 Stuff/Warcraft3NameSpoofer&action=edit edit
Module Warcraft3NameSpoofer
Private Declare Function OpenProcess Lib "kernel32" _
(ByVal dwDesiredAccess As Integer, _
ByVal bInheritHandle As Integer, _
ByVal dwProcessId As Integer) As Integer
Private Declare Function ReadProcessMemory Lib "kernel32" _
(ByVal hProcess As Integer, _
ByVal lpBaseAddress As Integer,_
ByRef lpBuffer As Integer, _
ByVal nSize As Integer, _
ByRef lpNumberOfBytesWritten As Integer) As Integer
Private Declare Function WriteProcessMemory Lib "kernel32" _
(ByVal hProcess As Integer, _
ByVal lpBaseAddress As Integer, _
ByRef lpBuffer As Integer, _
ByVal nSize As Integer, _
ByRef lpNumberOfBytesWritten As Integer) As Integer
Private Declare Function CloseHandle Lib "kernel32" _
(ByVal hObject As Integer) As Integer
Private Const PROCESS_ALL_ACCESS = &H1F0FFF
Public Version As Integer
Sub Main()
Console.Title = "Theta's Warcraft3NameSpoofer v1.22"
Console.BackgroundColor = ConsoleColor.Red
Console.ForegroundColor = ConsoleColor.Green
Console.Write("A very simple console program, ")
Console.Write("Warcraft3NameSpoofer for version 1.22a")
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write("By Theta -- codemotion.net")
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write("Don't use this program before playing a ")
Console.Write("Battle.net Ladder game!")
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Dim myProcesses As Process() = _
Process.GetProcessesByName("war3")
If myProcesses.Length = 0 Then
Console.Write("Error! Warcraft III Not Found!")
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write("Press any key to continue")
Console.ReadKey()
Exit Sub
End If
Dim hProcess As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, _
myProcesses(0).Id)
If hProcess = IntPtr.Zero Then
Console.Write("Error! Access Denied!")
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write("Press any key to continue")
Console.ReadKey()
CloseHandle(hProcess)
Exit Sub
End If
Dim Address As Integer = 764
Dim Buffer As Integer
Dim bytesRead As Integer
DoReadProcessMemory(hProcess, Address, Buffer, 4, bytesRead)
If Buffer = 1463898675 Then
Address -= 32
Version = 0
Exit Do
ElseIf Buffer = 1462982736 Then
Address -= 32
Version = 1
Exit Do
ElseAddress += 65536
End If
LoopDim ret As Byte() = Nothing
Dim oldName As String = ""
For i As Integer = 0 To 15
ReadProcessMemory(hProcess, Address + i, Buffer, 1, 0)
ret = BitConverter.GetBytes(Buffer)
If Version = 0 Then
oldName &= _System.Text.Encoding.ASCII.GetString(ret).Replace("RAW", "")
Else oldName &= _System.Text.Encoding.ASCII.GetString(ret).Replace("X3W", "")
End If
NextConsole.Write("Your current name is: ")
Console.Write(oldName)
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write("Type in a new name:")
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Dim newName As String = Console.ReadLine
If (Len(newName) > 15) Then
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write_("Error! The new name is longer than 15 characters!")
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write("Press any key to continue")
Console.ReadKey()
CloseHandle(hProcess)
Exit Sub
End If
For i = 0 To Len(newName) - 1
WriteProcessMemory(hProcess, (Address) + i, _
Asc(Mid(newName, i + 1, 1)), 1, 0&)
Next iFor i = Len(newName) To 14
WriteProcessMemory(hProcess, (Address) + i, &H0, 1, 0&)
Next iConsole.Write(Constants.vbLf)
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write("Your new name is: ")
Console.Write(newName)
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write(ControlChars.Lf)
Console.Write("Press any key to continue")
Console.ReadKey()
CloseHandle(hProcess)
End Sub
End Module