float value to write???

Posts 1–3 of 3 · Page 1 of 1
float value to write???
my friends I have a problem . I Read from jostick events and will in a game memory write the value is must float but not going pls help me


Code:
Module Module1

    Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer

    Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Integer, ByRef lpdwProcessId As Integer) As Integer
    Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Integer, ByVal lpBaseAddressAsAny As Integer, ByRef lpBufferAsAny As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
    Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Integer, ByVal lpBaseAddressAsAny As Integer, ByRef lpBufferAsAny As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
    Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Integer) As Integer
    Private hPid As Long
    Private hProcess As Long
    Private Const PROCESS_ALL_ACCESS As Long = &H1F0FFF
    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Integer
    Public Function ReadMemory(ByVal lngAddress As Integer, ByVal value As Single, ByRef intSize As Short) As Integer
        Dim hWnd As Object, processHandle As Object, processId As Integer

        hWnd = FindWindow(vbNullString, "THE HOUSE OF THE DEAD 3")
        If (hWnd = 0) Then Application.Exit()

        GetWindowThreadProcessId(hWnd, processId)
        processHandle = OpenProcess(PROCESS_ALL_ACCESS, False, processId)

        If (intSize > 4) Then intSize = 4
        If (intSize < 1) Then intSize = 1

        WriteProcessMemory(processHandle, lngAddress, value, intSize, 0)

    End Function

    Public Sub writeSingle(ByVal lngAddress As Single, ByVal sngValue As Single)
        ReadMemory(lngAddress, (sngValue), 2)
    End Sub
    

End Module
Oh my gawd, learn VB.NET or how to use Win32 API functions correctly.
Deleted After formatting, the computer code I had but all the time when I moved in over the long-forgotten
Posts 1–3 of 3 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us