Hex Converter

I would like to know, if someone could help me with, converting a say, exe-file into a hex number file. Sort of like Ultra Edit.
Who is Participating?
rickpetConnect With a Mentor Commented:
I guess you didn't read my comment...Thexdump can be found at

You can find one ...\Borland\Delphi #\Demos\RESXPLOR

Take a look at
You find all the examples you need
Hex to bin,
bin to hex.
dec to bin

Hello Inkognito,

First run thrue your text file, and get all the chars, then send them thrue this

function Dec2Hex(Dec: byte): string;
var Hi: byte;
    Low: byte;
     Hi:=Dec div 16;
     Low:=Dec mod 16;
     case Low of
          10: result:=result+'A';
          11: result:=result+'B';
          12: result:=result+'C';
          13: result:=result+'D';
          14: result:=result+'E';
          15: result:=result+'F';
     else result:=result+inttostr(Low);

I hope this helps, otherwise, giv me a comment.

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

inkognitoAuthor Commented:
The link you posted, seems to be very good, for future looking, though at writing time, I haven't had the time to look through the whole page, but I'll just hope for the best. Cuz the problems, is more or less, (problably due to my insufficent detailed question), that I need a fast converter from ASCII(string, dec) to Hex. I've used a BlockRead function, that could barley convert 1 Kb large Txt-filez, but it went so slow, that the program crashed, so I neede a simple / or not, version that won't hang it self, when filez up to a meg are read...
     I hope you understand my prolem, somehow better so that you can help me...?!
Here is a very fast conversion function, is that what you need?

Function Byte2Hex(Number: Byte) : String;
    Ch1 := Number SHR 4;
    Ch2 := Number - (Ch1 SHL 4);    Byte2Hex := Hexa[Ch1]+Hexa[Ch2];

inkognitoAuthor Commented:
Could you please implement (is it spelled this way?), this function in a little for ... loop, which would go through the whole file. Not that I'm totally bonkers, just don't have the time to try and wait for a result taht could work without too much trouble. And since you're obviously not a new-beginner which I'm Please Help Me!!!!!!!(Am I deperate?)
Sounds like a assignment to me. But OK

Download hexview from http://www.belhard.minsk.by/delphi/D20F5.HTM

Last answer...

You can find one ...\Borland\Delphi #\Demos\RESXPLOR

look at hexdump.pas

inkognitoAuthor Commented:
Well I just have to start by thanking Mirkwood, for the suggestions on my problem, however, I visited the site,
http://www.belhard.minsk.by/delphi/D20F5.HTM, which had a perfect
HexViewer for my purposes, but it didn't have a complete code. Cuz it requested a THexDump component that I didn't find in the Zip-archive, so I'm getting desperate! Please someone out there...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.