Jump to content

Memoryread String


Recommended Posts

I am trying to read a String from an Address, but it seems more difficult than I thought. Even with the right address the MsgBox doenst show the right Value of my String, it shows the Address in Assigned Long but not the right String Value.

The String even beeing a number between 1 and 100 is a String in ASCII.

The Address of the String is 0x011683F0 and the current value of my string is 94

My Code

#include <Array.au3>
#include <NomadMemory.au3>

$ID=_MemoryOpen(ProcessExists("Tutorial.exe"))
$Address=0x011683F0
$Res = _MemoryRead($Address,$ID)

MsgBox(0,"","Value " & $Res)
MsgBox(0,"","Value " & Hex($Res))
MsgBox(0,"","Value " & Dec($Res))
MsgBox(0,"","Value " & Dec(Hex($Res)))
_MemoryClose($ID)

My results for the MsgBox:

13369

00003439

13369

78697

But it doesnt show the real value 94, maybe I need to do something like that ConvertValueToString($Res), but I dont know the right command.

Edited by hendrikhe
Link to comment
Share on other sites

I am trying to read a String from an Address, but it seems more difficult than I thought. Even with the right address the MsgBox doenst show the right Value of my String, it shows the Address in Assigned Long but not the right String Value.

The String even beeing a number between 1 and 100 is a String in ASCII.

The Address of the String is 0x011683F0 and the current value of my string is 94

My Code

#include <Array.au3>
#include <NomadMemory.au3>

$ID=_MemoryOpen(ProcessExists("Tutorial.exe"))
$Address=0x011683F0
$Res = _MemoryRead($Address,$ID)

MsgBox(0,"","Value " & $Res)
MsgBox(0,"","Value " & Hex($Res))
MsgBox(0,"","Value " & Dec($Res))
MsgBox(0,"","Value " & Dec(Hex($Res)))
_MemoryClose($ID)

My results for the MsgBox:

13369

00003439

13369

78697

But it doesnt show the real value 94, maybe I need to do something like that ConvertValueToString($Res), but I dont know the right command.

If you want to read a string then you must set the last parameter in _MemoryRead to "char" as documented in NomadMemory.

EDIT:

Looks like you have the correct address because the return by default id a dword and

00003439 = ascii values for 49, which would be read as 94 for a string.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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...