xdp22 Posted August 18, 2011 Share Posted August 18, 2011 (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 August 18, 2011 by xdp22 Link to comment Share on other sites More sharing options...
Bert Posted August 18, 2011 Share Posted August 18, 2011 Try this: MsgBox(0, "", $1a &" "& $2a) The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
xdp22 Posted August 18, 2011 Author Share Posted August 18, 2011 I tried, doesn't work too :/ Link to comment Share on other sites More sharing options...
aNewLyfe Posted August 18, 2011 Share Posted August 18, 2011 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 ~ Every Living Thing is a Code Snippet of World Application ~ Link to comment Share on other sites More sharing options...
xdp22 Posted August 18, 2011 Author Share Posted August 18, 2011 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 Link to comment Share on other sites More sharing options...
JohnOne Posted August 18, 2011 Share Posted August 18, 2011 Try StringStripWS() function with correct flag AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
xdp22 Posted August 18, 2011 Author Share Posted August 18, 2011 StringStripWS(BinaryToString(_MemoryRead(0x75C1B4, $proces)), 8) Still return me text with spaces, my god Link to comment Share on other sites More sharing options...
aNewLyfe Posted August 18, 2011 Share Posted August 18, 2011 Have you tried: $1a = BinaryToString($1) $2a = BinaryToString($2) $combined = $1a & " - " & $2a yet ? ~ Every Living Thing is a Code Snippet of World Application ~ Link to comment Share on other sites More sharing options...
xdp22 Posted August 18, 2011 Author Share Posted August 18, 2011 (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 August 18, 2011 by xdp22 Link to comment Share on other sites More sharing options...
JohnOne Posted August 18, 2011 Share Posted August 18, 2011 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. Link to comment Share on other sites More sharing options...
xdp22 Posted August 18, 2011 Author Share Posted August 18, 2011 U mean $1 = BinaryToString(Binary(_MemoryRead(0x76C2B4, $proces))) ?? Still nothing :/ Link to comment Share on other sites More sharing options...
JohnOne Posted August 18, 2011 Share Posted August 18, 2011 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. Link to comment Share on other sites More sharing options...
JohnOne Posted August 18, 2011 Share Posted August 18, 2011 Try StringReplace($var,Asc(00),"") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
xdp22 Posted August 18, 2011 Author Share Posted August 18, 2011 (edited) It returns nothing :| Edit: Done !! THANKS ALL MsgBox(0, "", StringRegExpReplace($1,"[^0-9,a-z,A-Z]","") & $2) Edited August 18, 2011 by xdp22 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now