Jump to content

Registry hex to text?

- - - - -

  • Please log in to reply
5 replies to this topic

#1
ahmed

ahmed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 304 posts
I have a registry file that contains hex codes , and i need to convert those codes to plain text. Is there a possibility to do so?
I am attaching the file and if possible then can someone do it for me?

Attached Files

  • Attached File  w.zip   5.76K   37 downloads


#2
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US
Do you know any programming languages?

#3
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,120 posts
  • Location:Vancouver, Eh! Cleverness: 200
I could write a script, however I would likely waste time as the contents may not actually hold any text.

Can you be sure of the format? What is it from?
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#4
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US
Having this page in mind {How to convert from Hex to ASCII in javascript? - Stack Overflow}, you can probably convert the list of hex codes to text using JavaScript.

You can just take all the extra spaces out and all the "\\\r\n" out, and then do something like this:
var array1= the_text.split(","); 

You can then iterate through the array1 array, and convert each element to a character.

And then you can use the parseInt(some_hex_code_string, 16) function to turn the code into an integer. After that, you'll just have to use String.fromCharCode(the_integer_you_got_from_the_parseInt_function) to get the actual character.

Then you can put all the characters together, to form a string.

#5
ahmed

ahmed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 304 posts
Yes i do know the programming languages . But i don't think that a simple program will do the conversion right. Since i checked in the registry editor (Edit Binary Value) i see some special characters in the last columns.

#6
RhetoricalRuvim

RhetoricalRuvim

    JavaScript Programmer

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,254 posts
  • Location:C:\Countries\US
Well, if there are special characters, then why even convert them to text if they don't tell much (as text) anyway?
Why not convert them to integers, or just keep them in hex?


EDIT:
I made this command line tool for converting from hex to text.

The command line:
hex2text <filename1> <filename2>

<filename1> is the name of the file that contains the source hex
<filename2> is the name of the file where to save the output text

The input file doesn't have to have all the characters 0-9 and a-f or A-F; but if a character such as 'j' or '.' or any other non-hex character would show up, it'll just be ignored.

And it even accepts an odd number of hex digits; it'll automatically add a '0' to the last byte, to make the number of digits even.

I posted the .exe file on that page: Hex2Text - Site5

Edited by RhetoricalRuvim, 09 August 2011 - 06:10 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users