Visual Basic Forum

Visual Basic Forum
für VB6 und VB.NET Programmierer
 
RegistrierenRegistrieren  LoginLogin

Neues Thema eröffnen   Neue Antwort erstellen    Visual Basic Forum Foren-Übersicht -> [VB6] Fragen - Antworten
Autor
Nachricht
Kaali_
Tutorial Leser
Tutorial Leser

Anmeldedatum: 14.12.2007
Beiträge: 42

[Trainer] in Prozess eingreifen/verändern
Verfasst am: 16.12.2007, 09:46

Hallöchen,

wollte mal fragen, ob es möglich ist in einen Prozess einzugreifen und den Wert zu ändern: z.B. Ich hab den Prozess mit der Adresse 0D2971E8 der typ des Prozesses ist Integer 4 bytes und von diesem Prozess möchte ich die Value/Wert ändern, ist das möglich ?

Soll eine Art Trainer werden Very Happy

Vielen Dank, Gruß Kaali
_________________
 
Kaali_
Tutorial Leser
Tutorial Leser

Anmeldedatum: 14.12.2007
Beiträge: 42


Verfasst am: 16.12.2007, 18:05

Sooo Leudde, bin jetzt mal schon ein wenig weitergekommen, benötige aber noch dringend eure Hilfe ! Very Happy

Also ich habe mir ein Trainermodul runtergeladen:

gghz.de hat Folgendes geschrieben:
Eine Übersicht der möglichen funktionen:
'--------------------------------------------------------------------
'Read a Long *Reads 4 bytes[&HXXXXXXXX] from the Game*
'EX: Variable = ReadALong(&HAddress)

'--------------------------------------------------------------------
'Write a Long *Writes 4 bytes [&HXXXXXXXX] to the Game*
'EX: Call WriteALong(&HAddress,&HXXXXXXXX)

'--------------------------------------------------------------------
'Read Ascii *Reads Ascii[text strings] from the Game*
'EX:
'If you want a Text Box[Text1] to ReadAscii use this:
'Text1.Text = ReadAscii(&HStartAddress,Lenght)
'If you want to ReadAscii use this:
'Call ReadAscii (&HStartAddress,Lenght)

'--------------------------------------------------------------------
'Write Ascii *Writes Ascii[text strings] to the Game*
'EX:
'If you want to write a string use this:
'Call WriteAscii(&HStartAddress,"This is the String")
'If you want a Text Box [Text1] to WriteAscii use this:
'Call WriteAscii(&HStartAddress,Text1.Text)

'--------------------------------------------------------------------
'Read Write *Reads and Write an Address*
'EX: Call ReadWrite(&HAddress to read,&HAddress to write,&HXX)

'---------------------------------------------------------------------
'Add A Byte:
Public Sub AddAByte(Address As Long, ValueToAdd As Byte)
Call WriteAByte(Address, ReadAByte(Address) + ValueToAdd)
End Sub
'---------------------------------------------------------------------
Public Sub SubAByte(Address As Long, ValueToSub As Byte)
Call WriteAByte(Address, ReadAByte(Address) - ValueToSub)
End Sub
'---------------------------------------------------------------------
'Add A Integer:
Public Sub AddAInt(Address As Long, ValueToAdd As Integer)
Call WriteAInt(Address, ReadAInt(Address) + ValueToAdd)
End Sub
'---------------------------------------------------------------------
'Sub A Integer:
Public Sub SubAInt(Address As Long, ValueToSub As Integer)
Call WriteAInt(Address, ReadAInt(Address) - ValueToSub)
End Sub
'---------------------------------------------------------------------
'EX: Call WriteNOPs(&HAddy,6)'6 = Number of NOPs to Write 90 90 90 90
'---------------------------------------------------------------------
'EX: Call WriteXBytes(&HAddress,"22 44 55 88 99 66 33 55 88")

'---------------------------------------------------------------------
'EX: Hyperlink Me,"http://www.yourwebsite.com"

'---------------------------------------------------------------------


Das Modul:
VB Trainer-modul hat Folgendes geschrieben:

'Downloaded from delta-h.net
Option Explicit
'Find Window
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Long
'Get Process ID
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal Hwnd As Long, lpdwProcessId As Long) As Long
'Open Process
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
'Write Process Memory
Private Declare Function WPM Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
'Read Process Memory
Private Declare Function RPM Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
'Close Handle
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
'Post Message (SendAMessage)
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal Hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
'SpyCheck
Private Declare Function FindDebugger Lib "kernel32.dll" Alias "IsDebuggerPresent" () As Long
'Hotkeys
'Executing Any Aplication
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal Hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal _
nShowCmd As Long) As Long
Public Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal Key As Long) As Integer
'Pauses the Script for X Miliseconds
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'SetProcess *goes in form load*
'SetProcess = WindowCaption
'EX: SetProcess = "Delta Force 1.00.03.03P" 'DF1
'EX: SetProcess = "Delta Force 2, V1.06.15" 'DF2
'EX: SetProcess = "Delta Force, V1.5.0.5" 'BHD
'EX: SetProcess = "Jedi Knight®: Jedi Academy (MP)" 'JKA
'EX: SetProcess = "Delta Force Land Warrior, Demo V0.99.49"' LW_Demo
Public SetProcess As String

'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Read a Byte *Reads 1 byte[&HXX] from the Game*
'EX: Variable = ReadAbyte(&HAddress)
Public Function ReadAByte(Address As Long) As Byte
Dim pid&, phandle&
If FindWindow(vbNullString, SetProcess) = 0 Then Exit Function
GetWindowThreadProcessId FindWindow(vbNullString, SetProcess), pid
phandle = OpenProcess(&H1F0FFF, False, pid)
If phandle = 0 Then Exit Function
RPM phandle, Address, ReadAByte, 1, 0&
CloseHandle phandle
End Function
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Write a Byte *Writes 1 byte[&HXX] to the Game*
'EX: Call WriteAbyte(&HAddress, &HXX)
Public Sub WriteAByte(Address As Long, Value As Byte)
Dim pid&, phandle&
If FindWindow(vbNullString, SetProcess) = 0 Then Exit Sub
GetWindowThreadProcessId FindWindow(vbNullString, SetProcess), pid
phandle = OpenProcess(&H1F0FFF, False, pid)
If phandle = 0 Then Exit Sub
WPM phandle, Address, Value, 1, 0&
CloseHandle phandle
End Sub
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Read a Integer *Reads 2 bytes[&HXXXX] from the Game*
'EX: Variable = ReadAInt(&HAddress)
Public Function ReadAInt(Address As Long) As Integer
Dim pid&, phandle&
If FindWindow(vbNullString, SetProcess) = 0 Then Exit Function
GetWindowThreadProcessId FindWindow(vbNullString, SetProcess), pid
phandle = OpenProcess(&H1F0FFF, False, pid)
If phandle = 0 Then Exit Function
RPM phandle, Address, ReadAInt, 2, 0&
CloseHandle phandle
End Function
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Write a Integer *Writes 2 bytes[&HXXXX] to the Game*
'EX: Call WriteAInt(&HAddress,&HXXXX)
Public Sub WriteAInt(Address As Long, Value As Integer)
Dim pid&, phandle&
If FindWindow(vbNullString, SetProcess) = 0 Then Exit Sub
GetWindowThreadProcessId FindWindow(vbNullString, SetProcess), pid
phandle = OpenProcess(&H1F0FFF, False, pid)
If phandle = 0 Then Exit Sub
WPM phandle, Address, Value, 2, 0&
CloseHandle phandle
End Sub
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Read a Long *Reads 4 bytes[&HXXXXXXXX] from the Game*
'EX: Variable = ReadALong(&HAddress)
Public Function ReadALong(Address As Long) As Long
Dim pid&, phandle&
If FindWindow(vbNullString, SetProcess) = 0 Then Exit Function
GetWindowThreadProcessId FindWindow(vbNullString, SetProcess), pid
phandle = OpenProcess(&H1F0FFF, False, pid)
If phandle = 0 Then Exit Function
RPM phandle, Address, ReadALong, 4, 0&
CloseHandle phandle
End Function
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Write a Long *Writes 4 bytes [&HXXXXXXXX] to the Game*
'EX: Call WriteALong(&HAddress,&HXXXXXXXX)
Public Sub WriteALong(Address As Long, Value As Long)
Dim pid&, phandle&
If FindWindow(vbNullString, SetProcess) = 0 Then Exit Sub
GetWindowThreadProcessId FindWindow(vbNullString, SetProcess), pid
phandle = OpenProcess(&H1F0FFF, False, pid)
If phandle = 0 Then Exit Sub
WPM phandle, Address, Value, 4, 0&
CloseHandle phandle
End Sub
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Read Ascii *Reads Ascii[text strings] from the Game*
'EX:
'If you want a Text Box[Text1] to ReadAscii use this:
'Text1.Text = ReadAscii(&HStartAddress,Lenght)
'If you want to ReadAscii use this:
'Call ReadAscii (&HStartAddress,Lenght)
Public Function ReadAscii(StartAddress As Long, Lenght As Integer) As String
Dim Address As Long, data As Integer
For Address = StartAddress To (StartAddress + (Lenght - 1))
data = ReadAByte(Address)
If data <= 0 Then Exit For
ReadAscii = ReadAscii & Chr(data)
Next Address
End Function
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Write Ascii *Writes Ascii[text strings] to the Game*
'EX:
'If you want to write a string use this:
'Call WriteAscii(&HStartAddress,"This is the String")
'If you want a Text Box [Text1] to WriteAscii use this:
'Call WriteAscii(&HStartAddress,Text1.Text)
Public Sub WriteAscii(StartAddress As Long, WhatToWrite As String)
Dim Go As Long
For Go& = 0 To (Len(WhatToWrite) - 1)
Call WriteAByte((StartAddress + Go), Asc(Mid$(WhatToWrite, Go + 1)))
Next Go&
Call WriteAByte(StartAddress + Len(WhatToWrite), 0)
End Sub
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Read Write *Reads and Write an Address*
'EX: Call ReadWrite(&HAddress to read,&HAddress to write,&HXX)
Public Sub ReadWrite(ReadAddress As Long, WriteAddress As Long, Bytes As Integer)
Dim E As Integer
Dim P As Long
Dim XP As Long
Dim PX As Long
XP = WriteAddress
PX = ReadAddress
For E = 1 To (Bytes / 4)
P = ReadALong(PX)
Call WriteALong(XP, P)
XP = XP + 4
PX = PX + 4
Next E
End Sub
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Add A Byte:
Public Sub AddAByte(Address As Long, ValueToAdd As Byte)
Call WriteAByte(Address, ReadAByte(Address) + ValueToAdd)
End Sub
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Sub A Byte:
Public Sub SubAByte(Address As Long, ValueToSub As Byte)
Call WriteAByte(Address, ReadAByte(Address) - ValueToSub)
End Sub
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Add A Integer:
Public Sub AddAInt(Address As Long, ValueToAdd As Integer)
Call WriteAInt(Address, ReadAInt(Address) + ValueToAdd)
End Sub
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Sub A Integer:
Public Sub SubAInt(Address As Long, ValueToSub As Integer)
Call WriteAInt(Address, ReadAInt(Address) - ValueToSub)
End Sub
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Write NOPs:
'EX: Call WriteNOPs(&HAddy,6)'6 = Number of NOPs to Write 90 90 90 90 90 90.
Public Sub WriteNOPs(Address As Long, NOPNum As Integer)
Dim pid&, phandle&
Dim c As Integer
Dim B As Integer
If FindWindow(vbNullString, SetProcess) = 0 Then Exit Sub
GetWindowThreadProcessId FindWindow(vbNullString, SetProcess), pid
phandle = OpenProcess(&H1F0FFF, False, pid)
If phandle = 0 Then Exit Sub
B = 0
For c = 1 To NOPNum
Call WPM(phandle, Address + B, &H90, 1, 0&)
B = B + 1
Next c
CloseHandle phandle
End Sub
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Write Values of Any Size:
'EX: Call WriteXBytes(&HAddress,"22 44 55 88 99 66 33 55 88")
Public Sub WriteXBytes(Address As Long, Value As String)
Dim pid&, phandle&
Dim c As Integer
Dim B As Integer
Dim D As Integer
Dim V As Byte
Dim CleanStr As String

CleanStr = ""

For c = 1 To Len(Value)
If Mid(Value, c, 1) <> " " Then
CleanStr = CleanStr & Mid(Value, c, 1)
End If
Next c

If FindWindow(vbNullString, SetProcess) = 0 Then Exit Sub
GetWindowThreadProcessId FindWindow(vbNullString, SetProcess), pid
phandle = OpenProcess(&H1F0FFF, False, pid)
If phandle = 0 Then Exit Sub
B = 0
D = 1
For c = 1 To Round((Len(CleanStr) / 2))
V = Val("&H" & Mid$(CleanStr, D, 2))
Call WPM(phandle, Address + B, V, 1, 0&)
B = B + 1
D = D + 2
Next c
CloseHandle phandle
End Sub
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'EX: Hyperlink Me,"http://www.yourwebsite.com"
Public Sub Hyperlink(Frm As Form, ToOpen As String)
ShellExecute Frm.Hwnd, "Open", ToOpen, &O0, &O0, vbNormalFocus
End Sub
'Send A Message, Send Keys or Characters to the Game
Public Sub SendAMessage(Message As Long)
Dim pid&, phandle&
Const WM_KEYDOWN = &H100
Const WM_KEYUP = &H101
If FindWindow(vbNullString, SetProcess) = 0 Then Exit Sub
GetWindowThreadProcessId FindWindow(vbNullString, SetProcess), pid
phandle = OpenProcess(&H1F0FFF, False, pid)
If phandle = 0 Then Exit Sub
PostMessage FindWindow(vbNullString, SetProcess), WM_KEYDOWN, Message, 0&
PostMessage FindWindow(vbNullString, SetProcess), WM_KEYUP, Message, 0&
CloseHandle phandle
End Sub
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
'Checks for Spy:
'EX: Put this code in the FORM_LOAD or in a Timer With interval = 1
'Call SpyCheck("Your Message if a Spy is Found")
Public Sub SpyCheck(MessageToDisplay As String)
Dim Spy1 As Long
Dim Spy2 As Long
Dim Spy3 As Long
Spy1 = FindWindow(vbNullString, "TRNSNP")
Spy2 = FindWindow(vbNullString, "TrainerSpy XP + NT / 2000 / XP + Coded By BofeN") 'Trainer Spy
Spy3 = FindWindow(vbNullString, "OllyDbg")
If Spy1 <> 0 Then
MsgBox MessageToDisplay, vbCritical, "Error 24"
End
End If
If Spy2 <> 0 Then
MsgBox MessageToDisplay, vbCritical, "Error 24"
End
End If
If Spy3 <> 0 Then
MsgBox MessageToDisplay, vbCritical, "Error 24"
End
End If
If (FindDebugger) Then
MsgBox MessageToDisplay, vbCritical, "Error 15"
End
End If
End Sub
'############################################


Kann mir hier jemand erklären, wie ich jetzt einen 4Byte integer auslesen/schreiben kann ? Blick hier nicht ganz durch Razz

Vielen Dank, Gruß Kaali
 
Jolo_
Coder
Coder



Anmeldedatum: 20.03.2007
Beiträge: 210


Verfasst am: 16.12.2007, 18:19

Also erstmal hättest du auch ein Edit machen können aber egal ^^

das einzigste was ich dort finde ist wie man ein 2byte Integer ausliest:

Code:
'Read a Integer *Reads 2 bytes[&HXXXX] from the Game*
'EX: Variable = ReadAInt(&HAddress)
Public Function ReadAInt(Address As Long) As Integer
Dim pid&, phandle&
If FindWindow(vbNullString, SetProcess) = 0 Then Exit Function
GetWindowThreadProcessId FindWindow(vbNullString, SetProcess), pid
phandle = OpenProcess(&H1F0FFF, False, pid)
If phandle = 0 Then Exit Function
RPM phandle, Address, ReadAInt, 2, 0&
CloseHandle phandle
End Function


Hau den code in ein modul

und verwende das: Function ReadAInt(Address As Long) As Integer

ich schätz mal so: deinString = ReasAInt(DeineAdresse)

//Edit: Hab gerade auch gesehen das man auch ein Integer schreiben kann:

Code:
'Write a Integer *Writes 2 bytes[&HXXXX] to the Game*
'EX: Call WriteAInt(&HAddress,&HXXXX)
Public Sub WriteAInt(Address As Long, Value As Integer)
Dim pid&, phandle&
If FindWindow(vbNullString, SetProcess) = 0 Then Exit Sub
GetWindowThreadProcessId FindWindow(vbNullString, SetProcess), pid
phandle = OpenProcess(&H1F0FFF, False, pid)
If phandle = 0 Then Exit Sub
WPM phandle, Address, Value, 2, 0&
CloseHandle phandle
End Sub



MfG Jolo Wink
 
Kaali_
Tutorial Leser
Tutorial Leser

Anmeldedatum: 14.12.2007
Beiträge: 42


Verfasst am: 18.12.2007, 12:31

hi, danke für deine Antowort, aber...

1. Ich muss mit 4byte in den Prozess schreiben Very Happy

2. Wie genau muss ich das jetzt schreiben ?

4byte waren glaub:

Call WriteALong(&HAddress,&HXXXXXXXX)

wie mach ich das jetzt z.B.

Call WriteALong(&H0D2D71E8,&H500000)

???? Very Happy

Danke, gruß Kaali
 
Jolo_
Coder
Coder



Anmeldedatum: 20.03.2007
Beiträge: 210


Verfasst am: 18.12.2007, 14:39

Ich denke mal so:

zuserst musst du in Formload angeben welcher prozess mit der Caption:
Zitat:
'SetProcess *goes in form load*
'SetProcess = WindowCaption
'EX: SetProcess = "Delta Force 1.00.03.03P" 'DF1
'EX: SetProcess = "Delta Force 2, V1.06.15" 'DF2
'EX: SetProcess = "Delta Force, V1.5.0.5" 'BHD
'EX: SetProcess = "Jedi Knight®: Jedi Academy (MP)" 'JKA
'EX: SetProcess = "Delta Force Land Warrior, Demo V0.99.49"' LW_Demo
Public SetProcess As String


und dann kannst du die functionen verwenden:

Code:
Call WriteALong(&HAddress,&HXXXXXXXX)


Ich kenn mich nur leider nicht mit den Adressen aus etc. Rolling Eyes


MfG Jolo Wink
_________________


 
Kaali_
Tutorial Leser
Tutorial Leser

Anmeldedatum: 14.12.2007
Beiträge: 42


Verfasst am: 18.12.2007, 16:10


ok, trotzdem danke, ich werds mal ausprobieren Very Happy

Gruß, Kaali

//Edit: Da passt was ned, ich such jetzt mal nen kompletten Source von nem trainer Sad hat wer einen ?
 
Neues Thema eröffnen   Neue Antwort erstellen    Visual Basic Forum Foren-Übersicht -> [VB6] Fragen - Antworten

Tags: trainer, value, verändern, ändern

 
 Verwandte Themen   Aufrufe   Letzter Beitrag 
Keine neuen Beiträge Wichtig: Filebrowser z.B. für ein RAT 2118 13.01.2008, 11:14
Keine neuen Beiträge msgbox mit symbol _&_ z.B. yesno oder systemmodal 1078 26.09.2008, 23:16
Keine neuen Beiträge Abändern eines Ordnernamens (z.B. C:\Programme = Programme) 1196 23.04.2008, 15:33
Keine neuen Beiträge "Zurück-Funktion" mit Listview und z.B. DirView 734 17.04.2008, 13:30
Keine neuen Beiträge Fenster auslesen z.b von icq oder msn wer online kommt 1224 11.02.2008, 16:46
 



[ Time: 0.2715s ][ Queries: 103 (0.0255s) ][ GZIP on - Debug on ]