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]Using Pointers in VB.NET?

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

Joined: 21 May 2010
Posts: 1

PostPosted: Fri May 21, 2010 1:02 pm    Post subject: [VB.NET]Using Pointers in VB.NET? Reply with quote

Hello together,
I've got this Pointer:

How can i use it in VB.NET?
This the code as far as i can write it:
Code:

Private Sub TimerRead_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimerRead.Tick
        Dim prozess As Process() = Process.GetProcessesByName("PadMT2")
        Dim p As Process = prozess(0)
        Dim pID As IntPtr = p.Handle
        Dim base As IntPtr = p.MainModule.BaseAddress
        Dim sptr As IntPtr = &H1DB505B0 'das ist die Adresse aus dem linken oberen Textfeld
        Dim basepointer As IntPtr = &H1EF73C 'das ist die hinter PadMT2+
        Dim addr As IntPtr = FindAddress(pID, base, basepointer, sptr)
        GPSL_SetTextLineData(30, 30, addr, Color.FromArgb(255, 0, 255, 0).ToArgb, True, 0, False, 1)
    End Sub

 Private Function FindAddress(ByVal pHandle As IntPtr, ByVal BaseAddress As IntPtr, ByVal PointerAddress As IntPtr, ByVal StaticPointer As IntPtr) As Short
        Dim buffer(1) As Byte 'Ziel-Array, Größe 2 Byte (die 0 zählt mit)
        'Verschiedene Varianten:
        Dim readAddress As IntPtr = BaseAddress + PointerAddress + StaticPointer + &H5B2 'Da kommt 30027 raus
        Dim readAddress As IntPtr = BaseAddress + PointerAddress + StaticPointer 'Da kommt -12780 raus
        Dim readAddress As IntPtr = BaseAddress + StaticPointer 'Da kommt 14396 raus
        Dim bytesRead As Integer
        Dim ret As Boolean = ReadProcessMemory(pHandle, readAddress, buffer, 2, bytesRead)
        If Not (ret And bytesRead = 2) Then Return 0 'Wenn nicht genau 2 Bytes gelesen wurden, ist ein Fehler aufgetreten
        Return BitConverter.ToInt16(buffer, 0)
    End Function


Thanks for help Smile

Padmak



screen.jpg
 Description:
 Filesize:  34.72 KB
 Viewed:  5029 Time(s)

screen.jpg


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