Code:
Public Declare Function ReadProcessMemoryA Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, <[In](), Out()> ByVal lpBuffer As Byte(), ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
Public Function ReadSingle(ByVal processhandle As IntPtr, ByVal address As Integer) As Single
Dim theBytes As Byte() = New Byte(3) {}
ReadProcessMemoryA(processhandle, address, theBytes, 4, 0)
Return BitConverter.ToSingle(theBytes, 0)
End Function
Basically I'm reading 4 Bytes (Float = 4 Bytes) and converting them with the BitConverter Class.
EDIT:
You could also read the Float directly with :
Code:
Public Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Single, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer