• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook pagefor updates, or we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.)

[RELEASE] Hex dump formatting program

Newbie Spellweaver
Joined
Jul 31, 2010
Messages
30
Reaction score
0
Hey guys, this is my first post of a release I have made. I am currently reverse engineering a game called Golf King and while I am building a proper program to decrypt the encrypted files, I built a program that will take hex dump (from a program like ollyDBG) and will convert it into a nice formatted file. The program works with ASCII and is very easy to use.

I built this program as a means to see the dumped version of the encrypted files once they were decrypted in the game client. I hated going through each hex term as a means to produce a readable file. As you can see the olly produced ASCII isn't very readable.

Code:
02F063B8  50 72 65 73 65 74 09 53 65 63 74 69 6F 6E 09 4B  Preset.Section.K
02F063C8  65 79 20 63 6F 75 6E 74 09 56 61 6C 75 65 20 54  ey count.Value T
02F063D8  79 70 65 20 49 6E 66 6F 09 09 0D 0A 56 61 6C 75  ype Info....Valu
02F063E8  65 09 43 68 61 74 09 31 32 09 30 2D 69 6E 74 20  e.Chat.12.0-int
02F063F8  31 2D 75 69 6E 74 20 32 2D 66 6C 6F 61 74 20 33  1-uint 2-float 3
02F06408  2D 73 74 72 69 6E 67 20 34 2D 62 6F 6F 6C 09 09  -string 4-bool..
02F06418  0D 0A 49 6E 64 65 78 09 4B 65 79 09 54 79 70 65  ..Index.Key.Type
02F06428  09 56 61 6C 75 65 20 54 79 70 65 20 44 65 73 63  .Value Type Desc
02F06438  09 56 61 6C 75 65 09 43 6F 6D 6D 65 6E 74 0D 0A  .Value.Comment..
02F06448  30 09 52 65 6A 65 63 74 20 57 68 69 73 70 65 72  0.Reject Whisper
02F06458  09 34 09 62 6F 6F 6C 09 30 09 72 65 6A 65 63 74  .4.bool.0.reject
02F06468  20 77 68 69 73 70 65 72 20 6D 65 73 73 61 67 65   whisper message

The program handles tabs, carriage returns, new lines, etc.

I handle everything by chars so other foreign languages like Korean, Chinese, etc. will not work with this program, but most things are in English so I figured this was fine.

I am sure there is something like this out there but I couldn't find anything so I just wrote a program myself. Again I just wanted to share this with the community for anyone that can benefit from it. Ill provide some instructions below on how to use the program.

-Nerdy

Instructions:
0.) Extract the jar from the zipped folder.
1.) Open a terminal and change directory to where you saved the jar file.
2.) Run the command "java -jar FormatHex.jar" (without quotes)
3.) Choose an option that best represents how your input file is formatted. As with the example I provided above, I would select 1. (Make sure that a space separates each term (even the hex terms).
4.) Read the instructions carefully. Next, type the directory (using back-slashes) where your saved text file of the hex is stored. (For example "c:/Users/server.enc.txt")
5.) Type the number of hex terms per line excluding the last line. In the case with the example above, I would choose 16.
6.) Next, type the number of hex terms on the last line. In the example above I would again type 16 but you can type whatever number you wish so long as it matches your input file.
7.) You will be given the option to say yes or no to keeping the same directory as your input file for saving the formatted file. If you type 'n' then you will be prompted to type another directory for saving. Followed the instructions for this part. For simplicity I will just say 'y.'
8.) Verify that the information that you entered is correct. Type 'y' if it is, else type 'n.'
9.) If no error occurs, the file will be saved with the same name plus the string "Format."

---------------
Error Help:
IOException - Make sure that you have read and write access to the directory. For example, I am able to format files on my desktop, but if I stick them solely in my Users folder I am unable to save the file there even though I can manually edit files in that folder.

NumberFormatException - If you enter an incorrect number for the hex terms per line (and also for the final line) you can get this exception as it tried to grab some of the ASCII and of course most times that isn't comparable hex.
---------------

If all goes to plan, a successful formatting should look like this:
nerdyguy64 - [RELEASE] Hex dump formatting program - RaGEZONE Forums


Scan:
Download: View attachment FormatHex.zip
 

Attachments

You must be registered for see attachments list
Joined
Jul 8, 2009
Messages
445
Reaction score
64
Hey guys, this is my first post of a release I have made. I am currently reverse engineering a game called Golf King and while I am building a proper program to decrypt the encrypted files, I built a program that will take hex dump (from a program like ollyDBG) and will convert it into a nice formatted file. The program works with ASCII and is very easy to use.

I built this program as a means to see the dumped version of the encrypted files once they were decrypted in the game client. I hated going through each hex term as a means to produce a readable file. As you can see the olly produced ASCII isn't very readable.

Code:
02F063B8  50 72 65 73 65 74 09 53 65 63 74 69 6F 6E 09 4B  Preset.Section.K
02F063C8  65 79 20 63 6F 75 6E 74 09 56 61 6C 75 65 20 54  ey count.Value T
02F063D8  79 70 65 20 49 6E 66 6F 09 09 0D 0A 56 61 6C 75  ype Info....Valu
02F063E8  65 09 43 68 61 74 09 31 32 09 30 2D 69 6E 74 20  e.Chat.12.0-int
02F063F8  31 2D 75 69 6E 74 20 32 2D 66 6C 6F 61 74 20 33  1-uint 2-float 3
02F06408  2D 73 74 72 69 6E 67 20 34 2D 62 6F 6F 6C 09 09  -string 4-bool..
02F06418  0D 0A 49 6E 64 65 78 09 4B 65 79 09 54 79 70 65  ..Index.Key.Type
02F06428  09 56 61 6C 75 65 20 54 79 70 65 20 44 65 73 63  .Value Type Desc
02F06438  09 56 61 6C 75 65 09 43 6F 6D 6D 65 6E 74 0D 0A  .Value.Comment..
02F06448  30 09 52 65 6A 65 63 74 20 57 68 69 73 70 65 72  0.Reject Whisper
02F06458  09 34 09 62 6F 6F 6C 09 30 09 72 65 6A 65 63 74  .4.bool.0.reject
02F06468  20 77 68 69 73 70 65 72 20 6D 65 73 73 61 67 65   whisper message

The program handles tabs, carriage returns, new lines, etc.

I handle everything by chars so other foreign languages like Korean, Chinese, etc. will not work with this program, but most things are in English so I figured this was fine.

I am sure there is something like this out there but I couldn't find anything so I just wrote a program myself. Again I just wanted to share this with the community for anyone that can benefit from it. Ill provide some instructions below on how to use the program.

-Nerdy

Instructions:
0.) Extract the jar from the zipped folder.
1.) Open a terminal and change directory to where you saved the jar file.
2.) Run the command "java -jar FormatHex.jar" (without quotes)
3.) Choose an option that best represents how your input file is formatted. As with the example I provided above, I would select 1. (Make sure that a space separates each term (even the hex terms).
4.) Read the instructions carefully. Next, type the directory (using back-slashes) where your saved text file of the hex is stored. (For example "c:/Users/server.enc.txt")
5.) Type the number of hex terms per line excluding the last line. In the case with the example above, I would choose 16.
6.) Next, type the number of hex terms on the last line. In the example above I would again type 16 but you can type whatever number you wish so long as it matches your input file.
7.) You will be given the option to say yes or no to keeping the same directory as your input file for saving the formatted file. If you type 'n' then you will be prompted to type another directory for saving. Followed the instructions for this part. For simplicity I will just say 'y.'
8.) Verify that the information that you entered is correct. Type 'y' if it is, else type 'n.'
9.) If no error occurs, the file will be saved with the same name plus the string "Format."

---------------
Error Help:
IOException - Make sure that you have read and write access to the directory. For example, I am able to format files on my desktop, but if I stick them solely in my Users folder I am unable to save the file there even though I can manually edit files in that folder.

NumberFormatException - If you enter an incorrect number for the hex terms per line (and also for the final line) you can get this exception as it tried to grab some of the ASCII and of course most times that isn't comparable hex.
---------------

If all goes to plan, a successful formatting should look like this:
nerdyguy64 - [RELEASE] Hex dump formatting program - RaGEZONE Forums


Scan:
Download: View attachment 152183

I did not understand this very well but you wanted to say this a general algorithim to decrypt HEX packetz captured? to reverse ?
 
Newbie Spellweaver
Joined
Jul 31, 2010
Messages
30
Reaction score
0
I did not understand this very well but you wanted to say this a general algorithim to decrypt HEX packetz captured? to reverse ?

No no, this doesn't decrypt anything at all. I wanted to take dumped hex and convert it into a nice readable file. As you can see with my example, the ASCII on the far right is not very readable at all. So my program takes that dumped memory and creates a file that is formatted accordingly to the original hex. For example hex code O9 0D is the carriage return and a line feed. It basically makes a new line in the text file. My program takes this and makes a new line for you whereas with ollyDBG, it cannot do this. My apologizes if this is confusing but all it does it take inputted hex and output a file that conforms to all those hex terms.

The reason I made this is, is because I dumped the memory of where the decrypted text was stored in memory. The client just decrypted it and I wanted to read the contents (as I dont have a decryption program just yet). This program just builds a new file that is formatted accordingly to the hex that you dumped. Plain and simple.
 
Last edited:
Back
Top