Jump to content

Searching process memory for float value


cls
 Share

Recommended Posts

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...