Jump to content
Sign in to follow this  
xdp22

BinaryToString problem

Recommended Posts

xdp22

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

Share this post


Link to post
Share on other sites
aNewLyfe

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:

Share this post


Link to post
Share on other sites
xdp22

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

Share this post


Link to post
Share on other sites
xdp22

StringStripWS(BinaryToString(_MemoryRead(0x75C1B4, $proces)), 8) Still return me text with spaces, my god

Share this post


Link to post
Share on other sites
xdp22

$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

Share this post


Link to post
Share on other sites
JohnOne

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.

Share this post


Link to post
Share on other sites
xdp22

U mean $1 = BinaryToString(Binary(_MemoryRead(0x76C2B4, $proces))) ??

Still nothing :/

Share this post


Link to post
Share on other sites
JohnOne

Its difficult to say without seeing what it is or where its coming from, it could be null or it could be eof or something.

Loop through it maybe, trying to get the ascii code, my guess is that it will be 00


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

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
xdp22

It returns nothing :|

Edit:

Done !!

THANKS ALL

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.