qwer85 Posted September 13, 2007 Share Posted September 13, 2007 (edited) I have a binary: 0xDCF5E801 how to convert it, so I will get this: 0x01E8F5DC I have done it by following script: $tmp = BinaryToString($binary) $new_binary = StringToBinary(StringMid($tmp, 4, 1) & StringMid($tmp, 3, 1) & StringMid($tmp, 2, 1) & StringMid($tmp, 1, 1)) is there any way to simplify this script? Thanks. Edited September 13, 2007 by qwer85 Link to comment Share on other sites More sharing options...
The Kandie Man Posted September 13, 2007 Share Posted September 13, 2007 I have a binary 0xDCF5E801 how to convert it, so I will get this 0x01E8F5DC.Thanks.Your question is analagous to the following:I have 5,697,476. How do I make it -3?Please elaborate on exactly you want done in order to make 0xDCF5E801 0x01E8F5DC.- The Kandie Man ;-) "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
qwer85 Posted September 13, 2007 Author Share Posted September 13, 2007 (edited) pls look at the modified first post The difference between those numbers is that each two bytes are grouped in "words" and there is a back order of those "words". Edited September 13, 2007 by qwer85 Link to comment Share on other sites More sharing options...
Siao Posted September 13, 2007 Share Posted September 13, 2007 To change endian-ity of dwords I use this: Func byteSwap($bin) Return Binary(BitRotate(String($bin), 32, "D")) EndFunc "be smart, drink your wine" Link to comment Share on other sites More sharing options...
qwer85 Posted September 13, 2007 Author Share Posted September 13, 2007 To change endian-ity of dwords I use this: Func byteSwap($bin) Return Binary(BitRotate(String($bin), 32, "D")) EndFunc thx a lot, that helped me at once... Link to comment Share on other sites More sharing options...
qwer85 Posted September 13, 2007 Author Share Posted September 13, 2007 I'm trying to implement searching the value in memory by pointer, can someone explain me why this happens? When i use foll script (with pointer search): $v_Read = _MemRead($v_Open, 0x01D2AE53, 4) $tmp = Binary(BitRotate(String($v_Read), 32, "D")) ConsoleWrite($tmp & @CRLF) $v_Read = _MemRead($v_Open, $tmp, 5) ConsoleWrite($v_Read & @CRLF)oÝ÷ Ú(¶Øb²)Ü¢{(ç(uí1ÓQ It gives me the right result: 0x01E8F5DC 0x616C696173 Link to comment Share on other sites More sharing options...
Siao Posted September 13, 2007 Share Posted September 13, 2007 (edited) Well, looks like _MemRead function doesn't like Autoit's Binary data type as an argument. Try Dec(Hex(Binary(BitRotate(String($v_Read), 32, "D")))). Although TBH this conversion is turning from extravagant to ridiculous quite fast Edited September 13, 2007 by Siao "be smart, drink your wine" Link to comment Share on other sites More sharing options...
qwer85 Posted September 13, 2007 Author Share Posted September 13, 2007 Dec(Binary(BitRotate(String($v_Read), 32, "D"))) returns 0 Link to comment Share on other sites More sharing options...
Siao Posted September 13, 2007 Share Posted September 13, 2007 don't skip that Hex() "be smart, drink your wine" Link to comment Share on other sites More sharing options...
qwer85 Posted September 13, 2007 Author Share Posted September 13, 2007 don't skip that Hex()hoh, you are genious, man thanks again. 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