Jump to content
Kyan

Replicate PHP pack('H*' ... in autoit

Recommended Posts

Hey

I don't know PHP, was trying to get the same output of PHP pack function, already read http://php.net/manual/en/function.pack.php but didn't found a proper translation for "high nible"

I tried with StringFormat('%X',"6D2222E8B845C7B2199357B5FAF9B2C57C8FDAB4") but isn't the same thing

I found this page http://perplexed.co.uk/960_php_pack_function.htm but I don't know how to replicate it in autoit

Can someone lend a hand and point me in the right direction?


Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Share this post


Link to post
Share on other sites

it should be padded from the left. tested the output using this site http://writecodeonline.com/php/ (use bin2hex() on php and Binary() to check if the pack output matches)

Edited by Kyan

Heroes, there is no such thing

One day I'll discover what IE.au3 has of special for so many users using it.
C'mon there's InetRead and WinHTTP, way better
happy.png

Share this post


Link to post
Share on other sites

BTW, packH looks nothing more than:

Func _packH($sInput)
    Return ((StringLeft($sInput, 2) = "0x") ? _
        BinaryToString($sInput):BinaryToString("0x" & $sInput))
EndFunc

To me... or am I missing something?


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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

×
×
  • Create New...