atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Wed Mar 12, 2008 1:06 pm Post subject: |
|
|
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. |
|