Jump to content

Rotate binary


qwer85
 Share

Recommended Posts

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 by qwer85
Link to comment
Share on other sites

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

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²)Ü¢{(ç(1ÓQ

It gives me the right result:

0x01E8F5DC
0x616C696173
Link to comment
Share on other sites

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 by Siao

"be smart, drink your wine"

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...