Jump to content

how to ReadProc/WriteProc


anath3ma

Recommended Posts

to make this trainer we need to know something about vb6 code and api

first of all we need declares

what we shall use:

[glow=red,2,300]Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long[/glow]

with this open a process to have access on it

[glow=red,2,300]Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long[/glow]

with this we take pID of the current game

[glow=red,2,300]Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long[/glow]

with this we write values in memory of the proc

[glow=red,2,300]Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByVal lpBuffer As Long, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long[/glow]

with this code read values from proc

and finaly with this

[glow=red,2,300]Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

[/glow]

test if the game run searching windows we can make a project like if findwindow=0 then unload me

thats all about declares

now lets move to code

i have make a code for a pinball trainer cos im borring to make a another one here i copy paste it

Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Public Function ReadProc(ByVal adrs As Long, buffer As Long)
Dim PiD As Long
Dim Fhwnd As Long
Dim OpPRoC As Long
Fhwnd = FindWindow(vbNullString, "Öëßðåñ-3Ä ãéá Windows - Space Cadet")
PiD = GetWindowThreadProcessId(Fhwnd, lpdwProcessId)
OpPRoC = OpenProcess(&H10FFF, False, lpdwProcessId)
Call ReadProcessMemory(OpPRoC, adrs, buffer, 4, 0&)
Form1.Label1 = PiD
End Function
Public Function FindHwnd()
Dim Fhwnd As Long
Dim ProC As String
Dim PiD
PiD = GetWindowThreadProcessId(Fhwnd, lpdwProcessId)
Fhwnd = FindWindow(vbNullString, "Öëßðåñ-3Ä ãéá Windows - Space Cadet")
If Fhwnd = 0 Then
MsgBox "No Window Found Im Running Pinbal Now!!!!", vbExclamation, "Error"
ProC = Shell("C:\Program Files\Windows NT\Pinball\PINBALL.EXE", vbNormalFocus)
Call OpenProcess(&H10FFF, False, ProC)
End If
End Function
Public Function WriteProc(ByVal addrs As Long, val As Long)
Dim PiD As Long
Dim Fhwnd As Long
Dim OpPRoC As Long
Fhwnd = FindWindow(vbNullString, "Öëßðåñ-3Ä ãéá Windows - Space Cadet")
PiD = GetWindowThreadProcessId(Fhwnd, lpdwProcessId)
OpPRoC = OpenProcess(&H10FFF, False, lpdwProcessId)
Call WriteProcessMemory(OpPRoC, addrs, val, 4, 0&)
End Function

Form Code:

Private Sub Command1_Click()
If Timer1.Enabled = True Then
Timer1.Enabled = False
ElseIf Timer1.Enabled = False Then
Timer1.Enabled = True
End If
End Sub

Private Sub Command2_Click()
Dim Qq As Long
Qq = Text1
Call WriteProc(Combo1, Qq)
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
Combo1.AddItem ("&HB73B8C")
Combo1.AddItem ("&HCEAEBA")
Combo2.AddItem ("&HB73B8C")
Combo2.AddItem ("&HCEAEBA")
Call FindHwnd
End Sub

Private Sub Timer1_Timer()
Dim QqQ As Long
Call ReadProc(Combo2, QqQ)
Text2 = Hex(QqQ)
End Sub

Private Sub Timer2_Timer()

End Sub

and dont forget to add &h before adress or if u wanna change dec to hex value stil use &H cos its not gonna work without

PS:

Dont leech my code and paste it on other forums as urs dont be -beep-ing lecheers with other's work if u wanna copy that give creds

 

 

Link to comment
Share on other sites

and what that trainer do?

 

i mean what you can do with it, maybe you could explain some of those code so the people )like me) who are just getting into world of programing can undestand a little better :D

Link to comment
Share on other sites

if u are using greek windows edit this line

WinWnd = FindWindow(vbNullString, "Öëßðåñ-3Ä ãéá Windows - Space Cadet")

with ur pinball window name very simple

with this u can add some score on ur pinball

&HB73B8C, &H3B9AC9FF,4

addres and value 4bytes

Link to comment
Share on other sites

  • 4 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • rename the l2.bin into l2.exe
    • L2LIVE.PRO- Dynamic Mid-rates Essence Seven Signs GRAND OPENING - July 5, 20:00 GMT+3 (EEST) TEST SERVER IS OPEN - COME AND CHECK IT OUT TODAY! Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu   Server description * EXP/SP: Dynamic (x1- x100 based on your level, *before* Sayha and EXP buffs * Adena: x50 / Item Drop: x10 / Fishing EXP increased / Attribute EXP increased * Simplified gameplay to stay in the loop while not spending hours and hours farming * Starter Pack containing very useful items for beginners * MP replenishing potions with auto-consumption * No overpowered donations L2LIVE shop * All spellbook coupons, pet spellbook coupons and master books are sold via Game Assistant * Additionally you can buy SP pouches, enchanted talismans, pet training guides and various other consumables for Adena and L-Coin * More items such as cloaks, more talismans, agathions, belts, pendants, enchantment scrolls of various grades, evolution stones, etc will be added! Shop server as a shortcut, and all retail-like ways of earning items are still here! L-Coins * Drops with small change and in random amounts from Lv60+ monsters  * All raidbosses drop random amount of L-Coin Pouches generating up to 420 Lcoin per unit. **Grand Olympiad and Events** * Grand Olympiad is held week day * Format is 1v1, unlimited weekly fights  * Heroes are declared weekly at Sunday * There are three automated events - TvT, CTF and Deathmatch, running at evenings * Orc Fortress, Battle with Balok, Keber Hunter, Archievements Box, Daily Gift Calendar provisional events are active too Custom user commands * .offlineplay command, your character will keep playing till death or server restart * .offlineshop command, keeps your shop sitting until all items are purchased * .apon / .apoff - enable/disable HP/MP autoconsume And lots of other small improvements are waiting for you!   Join our community and be part of it at: https://www.l2live.pro https://discord.gg/k3NMgR4Dmu
  • Topics

×
×
  • Create New...