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 


[VB6] Help: Writing a double

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
homer_simpson
Grandmaster Cheater
Reputation: 0

Joined: 25 Feb 2007
Posts: 596

PostPosted: Tue Mar 11, 2008 1:37 pm    Post subject: [VB6] Help: Writing a double Reply with quote

How can a write a double with writeprocessmemory?

Heres what i want to do:

address: 007DE3C8
Bytes:Double
Change to: 1
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Mar 12, 2008 1:06 pm    Post subject: Reply with quote

Define a variable as a double then write the variable to memory. From my trainer toolkit I wrote for VB6:

Code:
Private Function WriteMemory(dwProcId As Long, dwAddress As Long, ByVal pValue As Long, ByVal dwLength As Long) As Boolean
   
    If dwAddress = 0 Then
        WriteMemory = False
        Exit Function
    End If
   
    Dim procHandle  As Long
    procHandle = OpenProcess(PROCESS_ALL_ACCESS, False, dwProcId)
    If procHandle = 0 Then
        WriteMemory = False
        Exit Function
    End If
   
    Dim dwReturned As Long
    dwReturned = WriteProcessMemory(procHandle, ByVal dwAddress, ByVal pValue, dwLength, 0&)
    Call CloseHandle(procHandle)
   
    If dwReturned > 0 Then
        WriteMemory = True
    Else
        WriteMemory = False
    End If
   
End Function

Public Function WriteDouble(dwProcId As Long, dwAddress As Long, ByVal dwValue As Double) As Boolean

    If dwProcId = 0 Or dwAddress = 0 Then
        WriteDouble = False
        Exit Function
    End If
   
    If WriteMemory(dwProcId, dwAddress, VarPtr(dwValue), LenB(dwValue)) = False Then
        WriteDouble = False
        Exit Function
    End If
   
    WriteDouble = True
   
End Function


WriteDouble wraps the WriteMemory function so you need both. Theres a few API you will need but I'm sure you can figure those out.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
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