Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[vb.net] read Multi-level Pointer

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
eva2215
How do I cheat?
Reputation: 0

Joined: 17 Jan 2015
Posts: 6

PostPosted: Sat Jan 17, 2015 3:07 pm    Post subject: [vb.net] read Multi-level Pointer Reply with quote

Code:

    <DllImport("kernel32", EntryPoint:="ReadProcessMemory")> _
    Private Shared Function ReadProcessMemoryFloat(ByVal Handle As Integer, ByVal Address As Integer, ByRef Value As Single, ByVal Size As Integer, ByRef BytesRead As Integer) As Single
    End Function

    Public Shared Function ReadPointerFloat(ByVal Name As String, ByVal Pointer As Integer, ByVal Offset As Integer()) As Single
        Dim num As Single
        Dim processesByName As Process() = Process.GetProcessesByName(Name)
        If (processesByName.Length = 0) Then
            MessageBox.Show("^^")
            Return num
        End If
        Dim bytesRead As Integer = 0
        Dim handle As Integer = OpenProcess(&H1F0FFF, 0, processesByName(0).Id)
        If (handle = 0) Then
            Return num
        End If
        Dim num4 As Integer
        For Each num4 In Offset
            ReadMemoryInteger(handle, Pointer, Pointer, 4, bytesRead)
            Pointer = (Pointer + num4)
        Next
        ReadProcessMemoryFloat(handle, Pointer, num, 4, bytesRead)
        CloseHandle(handle)
        Return num
    End Function


Code:
       Label1.Text = ReadPointerFloat("CLIENT.bin", &H4D6608, New Integer() {&H1318, &H158, &H12C}) 


i.imgur.co m/un6PsMf.png?1

always read it 0

i.imgur.co m/JxxU7dH.png?1

how can fix it !
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Sat Jan 17, 2015 5:13 pm    Post subject: Reply with quote

Have you tried removing the .bin
Code:
 Label1.Text = ReadPointerFloat("CLIENT", &H4D6608, New Integer() {&H1318, &H158, &H12C})

_________________
Back to top
View user's profile Send private message
eva2215
How do I cheat?
Reputation: 0

Joined: 17 Jan 2015
Posts: 6

PostPosted: Sat Jan 17, 2015 7:14 pm    Post subject: Reply with quote

Pingo wrote:
Have you tried removing the .bin
Code:
 Label1.Text = ReadPointerFloat("CLIENT", &H4D6608, New Integer() {&H1318, &H158, &H12C})

full game Client name is "CLIENT.bin" !
but i triedand didn't work Sad
Back to top
View user's profile Send private message
Pingo
Grandmaster Cheater
Reputation: 8

Joined: 12 Jul 2007
Posts: 571

PostPosted: Sat Jan 17, 2015 7:25 pm    Post subject: Reply with quote

See if this works for you. Needs more error handling but if it works, you could just add it.

Code:
    <DllImport("kernel32.dll")> _
Public Shared Function ReadProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As Integer, ByVal buffer As Byte(), ByVal size As Integer, ByVal lpNumberOfBytesRead As Integer) As Boolean
    End Function


Code:
    Public Shared Function ReadPointerFloat(ByVal Name As String, ByVal Pointer As Integer, ByVal Offset As Integer()) As Single
        Dim pName As Process() = Process.GetProcessesByName(Name)
        If (pName.Length = 0) Then
            Return 0
        End If
        Dim buffer As Byte() = New Byte(3) {}
        ReadProcessMemory(pName(0).Handle, Pointer, buffer, 4, 0)
        Pointer = BitConverter.ToInt32(buffer, 0)

        For i = 0 To Offset.Length - 1
            ReadProcessMemory(pName(0).Handle, Pointer + Offset(i), buffer, 4, 0)
            Pointer = IIf(i <> (Offset.Length - 1), BitConverter.ToInt32(buffer, 0), Pointer + Offset(i))
        Next
        ReadProcessMemory(pName(0).Handle, Pointer, buffer, 4, 0)
        Return BitConverter.ToSingle(buffer, 0)
    End Function
 


Code:
Label1.Text = ReadPointerFloat("CLIENT.bin", &H4D6608, New Integer() {&H1318, &H158, &H12C})

_________________
Back to top
View user's profile Send private message
eva2215
How do I cheat?
Reputation: 0

Joined: 17 Jan 2015
Posts: 6

PostPosted: Sat Jan 17, 2015 8:59 pm    Post subject: Reply with quote

Pingo wrote:
See if this works for you. Needs more error handling but if it works, you could just add it.

Code:
    <DllImport("kernel32.dll")> _
Public Shared Function ReadProcessMemory(ByVal hProcess As IntPtr, ByVal lpBaseAddress As Integer, ByVal buffer As Byte(), ByVal size As Integer, ByVal lpNumberOfBytesRead As Integer) As Boolean
    End Function


Code:
    Public Shared Function ReadPointerFloat(ByVal Name As String, ByVal Pointer As Integer, ByVal Offset As Integer()) As Single
        Dim pName As Process() = Process.GetProcessesByName(Name)
        If (pName.Length = 0) Then
            Return 0
        End If
        Dim buffer As Byte() = New Byte(3) {}
        ReadProcessMemory(pName(0).Handle, Pointer, buffer, 4, 0)
        Pointer = BitConverter.ToInt32(buffer, 0)

        For i = 0 To Offset.Length - 1
            ReadProcessMemory(pName(0).Handle, Pointer + Offset(i), buffer, 4, 0)
            Pointer = IIf(i <> (Offset.Length - 1), BitConverter.ToInt32(buffer, 0), Pointer + Offset(i))
        Next
        ReadProcessMemory(pName(0).Handle, Pointer, buffer, 4, 0)
        Return BitConverter.ToSingle(buffer, 0)
    End Function
 


Code:
Label1.Text = ReadPointerFloat("CLIENT.bin", &H4D6608, New Integer() {&H1318, &H158, &H12C})

THanks You for help .
i made this one too and it work fine now Smile

Fixed!

Code:

    Public Function ReadPointerFloat(ByVal ProcessName As String, ByVal Pointer As Integer, ByVal ParamArray Offset As Integer()) As Single
        Dim Value As Single
        Dim processesByName() As Process = Process.GetProcessesByName(ProcessName)
        Dim ptr As IntPtr = CType(OpenProcess(127231, 0, processesByName(0).Id), IntPtr)
        If (ptr = IntPtr.Zero) Then
            MessageBox.Show("Run As Admin")
        Else
            Dim xs As Integer = 0
            For Each I As Integer In Offset
                ReadMemoryInteger(ptr, Pointer, Pointer, 4, Value)
                Pointer = (Pointer + I)
            Next
            ReadMemoryFloat(ptr, Pointer, Value, 4, xs)
        End If
        Return Value
    End Function
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites