blackd
01-28-2013, 11:51
We have improved the core of all our Tibia tools and bots. They should now work for more persons. If they didn't work for you before please try them again now.
For curious persons and programmers - this is the new code of the function that was updated, the one that searches the base of the main tibia module in Tibia.exe (In latest versions of Tibia that module can be stored in a random part of the memory so you need to search where it starts, else you can't apply any cheat at all.)
Public Function getProcessBase(ByVal hProcess As Long, ByVal expectedRegionSize As Long, Optional PIDinsteadHp As Boolean = False) As Long
On Error GoTo goterr
' expectedRegionSize is used again
Dim lpMem As Long, ret As Long, lLenMBI As Long
Dim lWritten As Long, CalcAddress As Long, lPos As Long
Dim sBuffer As String
Dim sSearchString As String, sReplaceString As String
Dim si As SYSTEM_INFO
Dim mbi As MEMORY_BASIC_INFORMATION
Dim realH As Long
Dim pid As Long
Dim res As Long
If PIDinsteadHp = True Then
res = GetWindowThreadProcessId(hProcess, pid)
realH = OpenProcess(PROCESS_READ_WRITE_QUERY, False, pid)
hProcess = realH
End If
Call GetSystemInfo(si)
lpMem = si.lpMinimumApplicationAddress
lLenMBI = Len(mbi)
' Scan memory
Do While lpMem < si.lpMaximumApplicationAddress
mbi.RegionSize = 0
ret = VirtualQueryEx(hProcess, ByVal lpMem, mbi, lLenMBI)
If ret = lLenMBI Then
If (mbi.State = MEM_COMMIT) Then
If mbi.AllocationProtect = &H80 Then
If mbi.BaseAddress - mbi.AllocationBase = &H1000 Then
If mbi.Protect = &H20 Then
If (mbi.RegionSize = expectedRegionSize) Then
res = mbi.AllocationBase
'Debug.Print "The new result is " & CStr(res)
If PIDinsteadHp = True Then
CloseHandle hProcess
End If
getProcessBase = res
Exit Function
End If
End If
End If
End If
End If
lpMem = mbi.BaseAddress + mbi.RegionSize
Else
Exit Do
End If
Loop
If PIDinsteadHp = True Then
CloseHandle hProcess
End If
goterr:
getProcessBase = 0
End Function
I am almost sure that this new function should now work for everybody. Or at least it should work for more persons than before.
For curious persons and programmers - this is the new code of the function that was updated, the one that searches the base of the main tibia module in Tibia.exe (In latest versions of Tibia that module can be stored in a random part of the memory so you need to search where it starts, else you can't apply any cheat at all.)
Public Function getProcessBase(ByVal hProcess As Long, ByVal expectedRegionSize As Long, Optional PIDinsteadHp As Boolean = False) As Long
On Error GoTo goterr
' expectedRegionSize is used again
Dim lpMem As Long, ret As Long, lLenMBI As Long
Dim lWritten As Long, CalcAddress As Long, lPos As Long
Dim sBuffer As String
Dim sSearchString As String, sReplaceString As String
Dim si As SYSTEM_INFO
Dim mbi As MEMORY_BASIC_INFORMATION
Dim realH As Long
Dim pid As Long
Dim res As Long
If PIDinsteadHp = True Then
res = GetWindowThreadProcessId(hProcess, pid)
realH = OpenProcess(PROCESS_READ_WRITE_QUERY, False, pid)
hProcess = realH
End If
Call GetSystemInfo(si)
lpMem = si.lpMinimumApplicationAddress
lLenMBI = Len(mbi)
' Scan memory
Do While lpMem < si.lpMaximumApplicationAddress
mbi.RegionSize = 0
ret = VirtualQueryEx(hProcess, ByVal lpMem, mbi, lLenMBI)
If ret = lLenMBI Then
If (mbi.State = MEM_COMMIT) Then
If mbi.AllocationProtect = &H80 Then
If mbi.BaseAddress - mbi.AllocationBase = &H1000 Then
If mbi.Protect = &H20 Then
If (mbi.RegionSize = expectedRegionSize) Then
res = mbi.AllocationBase
'Debug.Print "The new result is " & CStr(res)
If PIDinsteadHp = True Then
CloseHandle hProcess
End If
getProcessBase = res
Exit Function
End If
End If
End If
End If
End If
lpMem = mbi.BaseAddress + mbi.RegionSize
Else
Exit Do
End If
Loop
If PIDinsteadHp = True Then
CloseHandle hProcess
End If
goterr:
getProcessBase = 0
End Function
I am almost sure that this new function should now work for everybody. Or at least it should work for more persons than before.