Jump to content

Recommended Posts

Posted (edited)

Hello guys, i have problem with MemoryRead and BinaryToString, i trying to get text from one thing, by memory. So i had to do :

$1 = _MemoryRead(0x75C1B4, $proces)
$2 = _MemoryRead(0x75C1B4 + 4, $proces)

$1a = BinaryToString($1)
$2a = BinaryToString($2)

And here is problem, when i trying to return it like : MsgBox(0, "", $1a & $2a) I get just $1a in msgbox.

But when i do it MsgBox(0, "", $1a) and MsgBox(0, "", $2a) i get $1a and $2a, so it's no problem with MemoryRead.

Why $1a and $2a can't be combined in one string?

I hope you can help me, Thanks guys.

Edited by xdp22
Posted

iam not sure but:

$2 = _MemoryRead(0x75C1B4 [color="#FF0000"]+ 4[/color], $proces)

0x75C1B4 equals to hex and + 4 must be hex too.

If you want to do + 4, you have to convert 0x75C1B4 to decimal first.

Here you go:

$dec = Dec("0x75C1B4"); or Dec(75C1B4) if any probs.
$val = $dec + 4

$now_convert_it_back = Hex($val); make it "0x"&$now_con... if it comes without 0x

$2 = _MemoryRead($now_convert_it_back, $proces)

lemme know if it works :mellow:

:alien: ~ Every Living Thing is a Code Snippet of World Application ~ :alien:

Posted

Nope :/ but i know what is the problem, $1 returns - "text " not "text", so i need delete spaces.

StringRegExp with $1, but how to delete only spaces with StringRegExp?

Ty

Posted (edited)

$1a is just in example "abcd "

i need to do just "abcd", but any of that doesn't work :

$option_1 = StringStripWS($string, 8))
$option_22 = StringSplit(StringStripWS($string, 8), " ")
$option_22[0] = StringSplit(StringStripWS($string, 8), " ")

All return "abcd "

And it isn't problem with space deletion, i tried change spaces for "," too, and i get "abcd ," so something is wrong here, cuz if i test it with my normal text it works :

$sString = "test    " & @CRLF & @CRLF & "test   "
$aArray = StringSplit($sString, @CRLF)

; Start here if you use _FileReadToArray

$sNewString = ""

For $i = 1 To $aArray[0]
    If StringLen($aArray[$i]) > 0 Then
        $sNewString &= StringStripWS($aArray[$i], 8) & ","
    EndIf
Next

MsgBox(0, "", $sNewString)
Edited by xdp22
Posted

Well It is not a space then or any other whitespace.

My guess is that its a null char, maybe such a char does not exist in autoit, but you are not dealing with exclusive autoit vars when you are reading from memory.

Deal with the binary before you convert it to string.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted (edited)

It returns nothing :|

Edit:

Done !!

THANKS ALL

MsgBox(0, "", StringRegExpReplace($1,"[^0-9,a-z,A-Z]","") & $2)
Edited by xdp22

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
×
×
  • Create New...