-
Important VB Functions, etc
Here you will find important VB functions, modules and etc selected by our programmers and staff.
You may post a comment with a function which you might find important so we can add it to the list/module.
To start off, I'm posting a simple module with the following functions:
Tibia_Hwnd
Returns the value of the Tibia Window.
subDelay(sngDelay As Single)
Delays the function where its used by X seconds.
Memory_ReadByte(windowHwnd As Long, Address As Long) As Byte
Reads an address and returns a single byte value.
Memory_ReadLong(windowHwnd As Long, Address As Long) As Long
Reads and address and returns a long value.
Memory_ReadString(windowHwnd As Long, Address As Long) As String
Reads an address and returns a string.
Memory_WriteString(TibiaHwnd As Long, Address As Long, tibiaString As String)
Writes a string on an address.
Memory_WriteString_LenUsed by Memory_WriteString
Memory_WriteByte(windowHwnd As Long, Address As Long, valbuffer As Byte)
Writes a single byte value on an address.
Memory_WriteLong(windowHwnd As Long, Address As Long, valbuffer As Long)
Writes a long value on an address.
-
Important VB Functions, etc
Here are some Visual Basic Functions and Statements.
Visual Basic Functions and Statements
-
Important VB Functions, etc
Thanks a lot for that link, it was awesome! :)
-
Important VB Functions, etc
-
Important VB Functions, etc
how about some functions to send packets?
and some explanation off how i use this to make a program?
-
Important VB Functions, etc
Great job. I need this for my next version of Tibia Book.
Btw how do i use sendkey to any window even if it is not in focus?
Example If you have 2 tibia running and u want to sendkeys to the second tibia from the first tibia window.
Thanks for your help
-
Important VB Functions, etc
If you want to use the function SendKeys to a specified window, you need to set whatever window as the foreground window with SetForegroundWindow
Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Example..
Code:
SetForegroundWindow Tibia_Hwnd
-
Important VB Functions, etc
Isn't there a function like sendkey that doesn't need the window to be focused?
I know there is, but I can't remember its name! :(
-
Important VB Functions, etc
Hi im trying to change for exampel level, just for learn how to write to memory.
I newbie in this so don't tell my im an idiot etc.
I'm trying this code:
Dim levelchange As Long
levelchange = Memory_WriteLong(Tibia_Hwnd, &H613B60)
Text1.Text = "" & levelchange
My idea with this is to change my level in client with the value from textbox1
THX for good respons. // Klusbert
-
Important VB Functions, etc
Quote:
Originally Posted by klusbert
Hi im trying to change for exampel level, just for learn how to write to memory.
I newbie in this so don't tell my im an idiot etc.
I'm trying this code:
Dim levelchange As Long
levelchange = Memory_WriteLong(Tibia_Hwnd, &H613B60)
Text1.Text = "" & levelchange
My idea with this is to change my level in client with the value from textbox1
THX for good respons. // Klusbert
Try this man:
Code:
Dim levelchange as Long
levelchange = Text1.Text
Memory_WriteLong(Tibia_Hwnd, &H613B60, levelchange)
;)
-
Important VB Functions, etc
-
Important VB Functions, etc
Quote:
Originally Posted by L4K
Try this man:
Code:
Dim levelchange as Long
levelchange = Text1.Text
Memory_WriteLong(Tibia_Hwnd, &H613B60, levelchange)
;)
Thx man!
I'll try it as soon as my girfriend leave tonight, and i upload the source for fake skill view.
-
Important VB Functions, etc
i'm using the module that you uploaded and now i try to make a function that read my characters level.
Code:
Private Sub Form_Load()
Dim level As Long
Call Memory_ReadLong(Tibia_Hwnd, &H621C60, level)
End Sub
when i try to run it i get the error
Compile error:
Wrong number of arguments or invalid property assignment
can anyone please help me? this is for 8.2
-
Important VB Functions, etc
Quote:
Originally Posted by Xavious
i'm using the module that you uploaded and now i try to make a function that read my characters level.
Code:
Private Sub Form_Load()
Dim level As Long
Call Memory_ReadLong(Tibia_Hwnd, &H621C60, level)
End Sub
when i try to run it i get the error
Compile error:
Wrong number of arguments or invalid property assignment
can anyone please help me? this is for 8.2
Code:
Private Sub Form_Load()
Dim level As Long
level = Memory_ReadLong(Tibia_Hwnd, &H621C60)
End Sub
Jo3
-
Important VB Functions, etc
Quote:
Originally Posted by Jo3Bingham
Code:
Private Sub Form_Load()
Dim level As Long
level = Memory_ReadLong(Tibia_Hwnd, &H621C60)
End Sub
Jo3
ah! thanks alot!:D
been a while since i was working with this
-
Important VB Functions, etc
Quote:
Originally Posted by Xavious
ah! thanks alot!:D
been a while since i was working with this
No problem, glad to help.
Jo3
-
Important VB Functions, etc
Quote:
Originally Posted by L4K
Try this man:
Code:
Dim levelchange as Long
levelchange = Text1.Text
Memory_WriteLong(Tibia_Hwnd, &H613B60, levelchange)
;)
this wont work :S even if i try Memory_WriteLong(Tibia_Hwnd, &H613B60, 24)
Or another exact value its still does'nt work :/
-
Important VB Functions, etc
Quote:
Originally Posted by klusbert
this wont work :S even if i try Memory_WriteLong(Tibia_Hwnd, &H613B60, 24)
Or another exact value its still does'nt work :/
Make sure the memory address (&H613B60) is the right one for the client you are working with.
Jo3
-
Important VB Functions, etc
Quote:
Originally Posted by Jo3Bingham
Make sure the memory address (&H613B60) is the right one for the client you are working with.
Jo3
Yes it is, thats the problem :S im always updated with cheatengine.
Atm im working for a litle cheat for Counter-strike; in cheat engine i can write for example on address 1A1B9DC wich are the adress value for the money in game(there is 2 adresses you have to change to gain money ingame)
Here is my module:
Code:
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Public Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Integer, ByVal lpString As String) As Integer
Public 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
Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As String, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Integer, ByRef lpdwProcessId As Integer) As Integer
Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Integer) As Integer
Public Const PROCESS_VM_READ As Short = (&H10)
Public Function cs_Hwnd() As Integer
Dim hl As Integer
hl = FindWindow(vbNullString, "Counter-Strike")
If (hl = 0) Then
MsgBox("Run CounterStrike first")
Exit Function
End If
cs_Hwnd = hl
End Function
Public Function Memory_ReadLong(ByVal windowHwnd As Integer, ByVal Address As Integer) As Integer
Dim PID As Integer
Dim phandle As Integer
Dim valbuffer As Integer
If (windowHwnd = 0) Then Exit Function
GetWindowThreadProcessId(windowHwnd, PID)
phandle = OpenProcess(PROCESS_VM_READ, False, PID)
If (phandle = 0) Then Exit Function
ReadProcessMemory(phandle, Address, valbuffer, 4, 0)
Memory_ReadLong = valbuffer
CloseHandle(phandle)
End Function
Public Sub Memory_WriteLong(ByVal cs_Hwnd As Integer, ByVal Address As Integer, ByVal valbuffer As Integer)
Dim PID As Integer
Dim phandle As Integer
If (cs_Hwnd = 0) Then Exit Sub
GetWindowThreadProcessId(cs_Hwnd, PID)
If (phandle = 0) Then Exit Sub
WriteProcessMemory(phandle, Address, valbuffer, 4, 0)
CloseHandle(phandle)
And here is my code;
Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = Memory_ReadLong(cs_Hwnd, &H1A1B9DC)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If cs_Hwnd() = 0 Then
Application.[Exit]()
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Memory_WriteLong(cs_Hwnd, &H1A1B9DC 16000)
End Sub
Can someone help me? and yes can read how much money i have with my readlong
-
Important VB Functions, etc
Quote:
Originally Posted by klusbert
Yes it is, thats the problem :S im always updated with cheatengine.
Atm im working for a litle cheat for Counter-strike; in cheat engine i can write for example on address 1A1B9DC wich are the adress value for the money in game(there is 2 adresses you have to change to gain money ingame)
Here is my module:
Code:
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
Public Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Integer, ByVal lpString As String) As Integer
Public 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
Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As String, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Integer, ByRef lpdwProcessId As Integer) As Integer
Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Integer) As Integer
Public Const PROCESS_VM_READ As Short = (&H10)
Public Function cs_Hwnd() As Integer
Dim hl As Integer
hl = FindWindow(vbNullString, "Counter-Strike")
If (hl = 0) Then
MsgBox("Run CounterStrike first")
Exit Function
End If
cs_Hwnd = hl
End Function
Public Function Memory_ReadLong(ByVal windowHwnd As Integer, ByVal Address As Integer) As Integer
Dim PID As Integer
Dim phandle As Integer
Dim valbuffer As Integer
If (windowHwnd = 0) Then Exit Function
GetWindowThreadProcessId(windowHwnd, PID)
phandle = OpenProcess(PROCESS_VM_READ, False, PID)
If (phandle = 0) Then Exit Function
ReadProcessMemory(phandle, Address, valbuffer, 4, 0)
Memory_ReadLong = valbuffer
CloseHandle(phandle)
End Function
Public Sub Memory_WriteLong(ByVal cs_Hwnd As Integer, ByVal Address As Integer, ByVal valbuffer As Integer)
Dim PID As Integer
Dim phandle As Integer
If (cs_Hwnd = 0) Then Exit Sub
GetWindowThreadProcessId(cs_Hwnd, PID)
If (phandle = 0) Then Exit Sub
WriteProcessMemory(phandle, Address, valbuffer, 4, 0)
CloseHandle(phandle)
And here is my code;
Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = Memory_ReadLong(cs_Hwnd, &H1A1B9DC)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If cs_Hwnd() = 0 Then
Application.[Exit]()
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Memory_WriteLong(cs_Hwnd, &H1A1B9DC 16000)
End Sub
Can someone help me? and yes can read how much money i have with my readlong
you say that its needed to change 2 adresses to gain money and u are just changing one &H1A1B9DC. Anyways i think u cant change cs cash cos its server sided like tibia cash (im not sure cos i've never tryed)
-
Important VB Functions, etc
Quote:
Originally Posted by Floppy
you say that its needed to change 2 adresses to gain money and u are just changing one &H1A1B9DC. Anyways i think u cant change cs cash cos its server sided like tibia cash (im not sure cos i've never tryed)
Its work to do this i tried with cheat engine :)
But there is two adresses like i said one for actual money and one for viewing how much money i have :P
-
Important VB Functions, etc
Wait, are you programming in VB6 or VB.NET? Because these are VB6 functions. :)
Jo3
-
Important VB Functions, etc
Quote:
Originally Posted by Jo3Bingham
Wait, are you programming in VB6 or VB.NET? Because these are VB6 functions. :)
Jo3
Yes this is Vb6 function that i've converted to vb.net.
But i got it working now :)
Now now i can freeze your money in counterstrike on 16000 :)
-
Important VB Functions, etc
Quote:
Originally Posted by klusbert
Yes this is Vb6 function that i've converted to vb.net.
But i got it working now :)
Now now i can freeze your money in counterstrike on 16000 :)
Good. :D
Jo3
-
Important VB Functions, etc
Quote:
Originally Posted by klusbert
Yes this is Vb6 function that i've converted to vb.net.
But i got it working now :)
Now now i can freeze your money in counterstrike on 16000 :)
Are you sure you're able to buy for it all?
That is, on an online server and not just on your computer? :O
-
Important VB Functions, etc
Quote:
Originally Posted by klusbert
Yes this is Vb6 function that i've converted to vb.net.
But i got it working now :)
Now now i can freeze your money in counterstrike on 16000 :)
Doubt it at least in multiplayer and VAC proof server. If you try to use something like that there it'll just get your accound banned.
-
Important VB Functions, etc
Quote:
Originally Posted by Erra
Are you sure you're able to buy for it all?
That is, on an online server and not just on your computer? :O
When u start a newgame in counterstrike, there is 2 adresses for the money one for the view and one for the is for the actual money.
And then u can change the gold and just made it and now i can freeze that value and buy for how much i wan't.
But like u said when u play on another server u cant change the other value, and then its just one adress(for the view only :)
-
Important VB Functions, etc
Quote:
Originally Posted by klusbert
When u start a newgame in counterstrike, there is 2 adresses for the money one for the view and one for the is for the actual money.
And then u can change the gold and just made it and now i can freeze that value and buy for how much i wan't.
But like u said when u play on another server u cant change the other value, and then its just one adress(for the view only :)
Yeah, kind of thought so :P
-
Important VB Functions, etc
Uhm... I hate to say this but nothing is working for me :(
I only get error. Im using VB 2008. What can be the problem:icon5:
-
Important VB Functions, etc
Someone can update it to latest vb.net? ;> (To much errors)