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] How to allocate memory in VB?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
FLiNG
Newbie cheater
Reputation: 0

Joined: 09 Apr 2011
Posts: 19

PostPosted: Sat Apr 09, 2011 12:26 pm    Post subject: [VB] How to allocate memory in VB? Reply with quote

Hi, I am new to programming, also, apologize for my bad English.
I am making a trainer using VB. The only problem I had is that I don't know how to dynamically allocate memory just like CE trainers.

Here is my code:

Code:
    Private Sub KeyLogger_Tick() Handles KeyLogger.Tick
        Dim Open = Process.GetProcessesByName("Crysis2")
        If Open.Length = 0 Then
            Exit Sub
        End If
        AxWindowsMediaPlayer1.close()
        If GetAsyncKeyState(Keys.NumPad1) = &HFFFF8001 Then
            If Timer1.Enabled = False Then
                My. Computer. Audio. PlaySystemSound (Media.SystemSounds.Asterisk)
                WriteMemoryASM("Crysis2", &H115CB20, New Byte() {&HE9, &HDB, &H34, &HD7, &H5, &H90, &H90})
                WriteMemoryASM("Crysis2", &H6ED0000, New Byte() {&HD9, &H1E, &HC7, &H6, &H0, &H0, &HC8, &H42, &H5E, &HC9, &HC2, &H4, &H0, &HE9, &H15, &HCB, &H28, &HFA})
                Timer1.Enabled = True
            ElseIf Timer1.Enabled = True Then
                My. Computer. Audio. PlaySystemSound (Media.SystemSounds.Beep)
                WriteMemoryASM("Crysis2", &H115CB20, New Byte() {&HD9, &H1E, &H5E, &HC9, &HC2, &H4, &H0})
                Timer1.Enabled = False
            End If
        End If

    End Sub


I only know how to jump to a specific address and jump back, but I can't find a stable codecave, so sometime it causes game crash.
Back to top
View user's profile Send private message
Innovation
Grandmaster Cheater
Reputation: 12

Joined: 14 Aug 2008
Posts: 617

PostPosted: Sat Apr 09, 2011 12:45 pm    Post subject: Reply with quote

Perhaps what you are looking for is VirtualAllocEx?
Back to top
View user's profile Send private message
ej52
Cheater
Reputation: 0

Joined: 29 Mar 2011
Posts: 39
Location: Mother City

PostPosted: Sun Apr 10, 2011 6:43 am    Post subject: Reply with quote

Yes the forgetfull 1 is right Razz

You would have 2 use VirtualAllocEx in order to create a code cave.

I have posted a example, "[C#]Trainer Code Injection (Example)" which should give you an idea Smile

_________________
Hitler dNt HiDe WaT mOtHa NaTurE pRoViDe ... Razz
Back to top
View user's profile Send private message
FLiNG
Newbie cheater
Reputation: 0

Joined: 09 Apr 2011
Posts: 19

PostPosted: Sun Apr 10, 2011 5:05 pm    Post subject: Reply with quote

Thanks ej52
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