Jump to content

Decode script


[dx]
 Share

Recommended Posts

Hi, I have some script, and part of it is encoded (I guess it's hex) So I need extract script to user readable. When I search some function with windows grep, it finds in one file, but when I open it, I just see variable which is encoded. So how properly decode it. Format is: $var='94CD76CD371C5A7BC70C186E779C293B9B49BACA5A781A6';

Link to comment
Share on other sites

Although the above are good for numbers, for characters, you may want to "manually" decode them... assuming that these stand for character data that is. Something like this:

function decodeHexString($string) {    $result = '';    for ($i = 0, $l = strlen($string); $i < $l; $i += 2) {        $result .= chr(hexdec(substr($string, $i, 2)));    }    return $result;}

Your $var returns gibberish though, so it's probably a little more complicated than that. You need to find out how the data was encoded to decode it properly.

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

×
×
  • Create New...