Sign in to follow this  
Followers 0
cls

Searching process memory for float value

2 posts in this topic

#1 ·  Posted (edited)

I have to search some process for an 8 bytes float value. Let's say it is "189734.2243". Here is my code.

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#Include <WinAPI.au3>
#Include <ProcessConstants.au3>

$cur = 0x00000000;

$pid = _WinAPI_OpenProcess($PROCESS_ALL_ACCESS, False, ProcessExists("app.exe"));
$pBuffer = DllStructCreate("float");
$iRead = 0;

While 1
 _WinAPI_ReadProcessMemory($pid, $cur, DllStructGetPtr($pBuffer), 8, $iRead) ; here we read the memory

 $file = FileOpen("go.txt", 1);
 FileWrite($file, $pBuffer);
 FileClose($file);
 If $pBuffer = 189734.2243 Then
  MsgBox(0, "Found!", $cur);
  Exit
 EndIf
 $cur = $cur + 1;
WEnd

It doesn´t work. Any suggestions?

Edited by cls

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0