View Full Version : Hex Edit 101
Madox58
02-08-07, 01:53 AM
Is anybody interested in some time spent learning some of the ins and outs
of Hex Editing SH3?
I've learned a great deal thanks to so many here and time spent digging around.
But all the info is scattered, makeing it hard to learn for most.
I do not have all the answers, but I think I can teach most anyone how it
all works, how to spot what you want, and what connects what.
What do you think?
yes please!! if could take time to write a tutorial that would be fantastic :rock:
Mr.Fleck
02-08-07, 04:17 AM
Hello Privateer,
a very good idea to share your knowledge in a wiki, offline document, web page or where ever it suits you. :up:
Cheers!
Mr. Fleck
Mush Martin
02-08-07, 04:26 AM
Is anybody interested in some time spent learning some of the ins and outs
of Hex Editing SH3?
I've learned a great deal thanks to so many here and time spent digging around.
But all the info is scattered, makeing it hard to learn for most.
I do not have all the answers, but I think I can teach most anyone how it
all works, how to spot what you want, and what connects what.
What do you think?
Sign me up !
MM
I'm not a good writer, and the languaje barrier makes thing worse, but I'd be happy to contribute where I can.
Ref
sh3rules
02-08-07, 07:59 AM
I have no idea, and I’d like to learn so I don’t have to bother people asking them for files.
bigboywooly
02-08-07, 09:23 AM
Nice one
Great idea
Count me in
Madox58
02-08-07, 11:59 AM
Ok, 1st we'll make sure we have some tools and such.
Pack3d all versions and some Guide info I've collected from various threads
are on my Filefront page.
http://hosted.filefront.com/priater
Next is a Hex Editor. You may have a version you like but I'll recommend
you get the same one I use to make following along easier.
It's free and does not install into Windows so if you want to get rid of it
all you need do is delete it.
http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm
Once you have the files, create a folder that we will use to work in.
Go into the Library folder and copy the NavalMine.dat and Navalmine.zon
files to your work folder.
These are nice small files we will start with to learn our way around and
what a byte, dword, and other scary terms mean. :lol:
bigboywooly
02-08-07, 12:02 PM
Sweet
My current Hex just expired
Rather liked it too
:damn:
I take it we are getting 2.51 ?
Is this an online tutorial
:rotfl:
Hope there is no homework :nope:
Albrecht Von Hesse
02-08-07, 12:13 PM
Is anybody interested in some time spent learning some of the ins and outs
of Hex Editing SH3?
I've learned a great deal thanks to so many here and time spent digging around.
But all the info is scattered, makeing it hard to learn for most.
I do not have all the answers, but I think I can teach most anyone how it
all works, how to spot what you want, and what connects what.
What do you think?
Yes yes YES!! :yep: :yep: :yep:
Madox58
02-08-07, 12:27 PM
Sweet
My current Hex just expired
Rather liked it too
:damn:
I take it we are getting 2.51 ?
Is this an online tutorial
:rotfl:
Hope there is no homework :nope:
Yes, it will be online.
I'll just save the lessons as a reference anyone can grab at any time.
Oh, and yes, the newest version is 2.51
I've used it for years now and have never had any troubles
what so ever.
UBOAT234
02-08-07, 01:32 PM
Hi,
What uses in order to modify the boxes in .zon file? Work in hex?
BEST REGARDS
UBOAT234
Madox58
02-08-07, 01:48 PM
Hi,
What uses in order to modify the boxes in .zon file? Work in hex?
BEST REGARDS
UBOAT234
right now I'm doing it in Hex,
I have got a program I'm working on that will let us do it in a 3d enviroment.
Madox58
02-08-07, 02:47 PM
Open the Hex Editor, select Tools and put a check on data inspecter.
Open Tools again and select Options, then appearance.
set columns to 25
I work with text on the left but select the way that suits you.
select Data inspecter, I have the 1st 6 boxes on the left checked.
Select OK.
Now open the NavalMine.dat and you should see something like this image.
http://i108.photobucket.com/albums/n12/privateer_2006/Hex%20Edit/Lesson_1a.jpg
Notice I have Ref's dat file format info. This is our main guide.
The 4 bytes in BLUE are important!
You are going to see this alot so make sure you understand this part.
The data Inspecter tells us the info to come is 51 bytes long.
Count the GREEN area and it's 51 bytes.
If you delete Kashmir in the left window, you need to lower
the count in blue to match the new length.
Click on the 33, open tools and select Encode number,
and set it up like below
http://i108.photobucket.com/albums/n12/privateer_2006/Hex%20Edit/Lesson_1c.jpg
Click OK and you should see that the 33 00 00 00
is now 2C 00 00 00
:up:
Madox58
02-08-07, 04:48 PM
Make sure you save the file then open version 5 of Pack3d and open the file.
http://i108.photobucket.com/albums/n12/privateer_2006/Hex%20Edit/Lesson_1d.jpg
click on the left window and find address 80 as marked in yellow.
This is the start of this block of data.
select the numbers marked in blue and notice the data inspecter
We're looking at chunks now.
All chunks are like this:
01 00 00 00 = 1 ChunkType 4 bytes
65 00 00 00 = 100 Chunk Subtype/Version 4 bytes
CB 28 00 00 = 10443 chunk_size long (4 bytes) = Data (chunk_sizebytes)
The data chunk size is the same type info we changed in the header,
just telling us how big this block of data is.
RED is the ID the game engine uses to work with this block
which, in this case, is the actual 3d object of the mine.
All ID's are 8 bytes long.
Madox58
02-08-07, 05:17 PM
Now, select the NavalMine under this and note the location.
In the hex editer select address and set it up like this.
http://i108.photobucket.com/albums/n12/privateer_2006/Hex%20Edit/Lesson_1e.jpg
Hit OK and your right at the start of this block.
Change the name from NavaiMine to Mine and fix the size info
and save.
Re-open the dat in pack3d and check it.
if you've got it right you now know how to Re-name things anyway you like.
The next thing we'll do is Dis-arm the mine! :o
Madox58
02-09-07, 12:15 PM
Ok, today we'll work with the NavalMine.zon file.
It's nice and small so you won't get lost, will reinforce what we know already,
and has plenty of new areas we need to learn.
Opening NavalMine.zon with Pack3d 5 will show you several limitations
of Pack3d right off the bat. And I'll point them out as we go.
Now open the same file with Hex Editor and look at all the pretty numbers!
While I try to get some images up (Nets a bit iffy today) pickout what
you learned earlier as best you can.
We will dis-arm the mine by setting min and max areas = 0
Then we'll take the zon file apart, one piece at a time.
We are going to save the sections we remove as we will
re-assemble everything later on.
Madox58
02-09-07, 01:38 PM
http://i108.photobucket.com/albums/n12/privateer_2006/Hex%20Edit/Lesson_2a.jpg
1st, the 0A 00 00 00 should be all YELLOW, My goof.:oops:
But, Yellow tells us the type/subtype = 10/-1
Everything in RED is size, and we'll break this all down in a moment.
GREEN is this files ID number as Pack3d shows you.
Now the BLUE is the PARENT ID.
If you look at NavalMine.dat you'll see this same ID and what it belongs to.
So what this first chunk is telling the Game Engine goes like this.
I am a Type 10, SubType -1 (YELLOW)
28 bytes of information follows. (RED)
My name (ID) is AD FD 71 B8 E4 C0 71 9B (GREEN)
I belong to 9A 88 45 36 F1 24 3C B1 (BLUE)
I am an Explossive.
Madox58
02-09-07, 02:57 PM
Now we'll start tearing apart the zon file from the top down.
With the zon file open in Hex Editor, click the very 1st byte in the file,
click on edit then click Block mark.
We know 0A is the start of a new chunk so click on the 00 BEFORE the 0A.
Again click edit, Block mark and you should see this.
http://i108.photobucket.com/albums/n12/privateer_2006/Hex%20Edit/Lesson_2b.jpg
Click edit, select Clipboard, then Copy as hex string.
Now we open another Hex Editor.
Same one your using now just another instance of it.
Click on the 1st empty byte in this second Editor,
Click edit, select Clipboard, then Paste as hex string.
Save this as headerz.bin then close this second copy.
Back to the main part shown above,
click edit, select Block delete, and save the file.
We now have the header saved for later use and our zon file
is smaller and easier to work with.
Madox58
02-09-07, 05:52 PM
Do a block mark again at the 0A that should be at the start of our zon file now.
Following what we know so far this chunk is 28 bytes starting the count at
the 1st byte of the ID, which is the AD. Click on the AD.
Now, I don't want to count 28 bytes, and in bigger files we may need to move
1000's of bytes!
Select Address, then Jump width.
Set this to decimal, then enter 28, click OK.
Select Address again, Jump down and block mark this.
Do your copy and save just like before calling this introz.bin
Then Block delete, and save this file again.
We haven't lost anyone so far have we?
bigboywooly
02-09-07, 05:58 PM
:gulp:
Must keep ahead
:rotfl:
Still here mate
Though I must admit not the time to actually do the lesson yet
Damn GWX
:hmm:
But will have a go when have a free afternoon
Madox58
02-09-07, 06:12 PM
Not a problem BBW.
I'll also have all this setup as a downloadable Guide also.
It's being set up as a little book like program that allows you to
turn the pages, so to speak.
bigboywooly
02-09-07, 06:39 PM
WOW
Nice one
Even better
Madox58
03-08-07, 09:05 PM
Now, select the NavalMine under this and note the location.
In the hex editer select address and set it up like this.
http://i108.photobucket.com/albums/n12/privateer_2006/Hex%20Edit/Lesson_1e.jpg
Hit OK and your right at the start of this block.
Change the name from NavaiMine to Mine and fix the size info
and save.
Re-open the dat in pack3d and check it.
if you've got it right you now know how to Re-name things anyway you like.
The next thing we'll do is Dis-arm the mine! :o
Ok, to answer a question, If you have deleted Naval from NavalMine you have lost
5 bytes of info.
Go to the start of this chunk which is position 76373.
1st 4 bytes = 4
next 4 bytes = 100
The next 4 bytes are the size, reduce this by 5.
Pay attention to the lesson before this one as they show you how to do this.
thefretmaster
03-08-07, 09:10 PM
cool thanks alot :up:
Madox58
03-09-07, 12:48 AM
Learning to identify the parts of the dats is easy once you get these basics.
The final goal of working with these files will be
to build your own Barrage Balloon!
Open the Hex Editor, select Tools and put a check on data inspecter.
Open Tools again and select Options, then appearance.
set columns to 25
I work with text on the left but select the way that suits you.
select Data inspecter, I have the 1st 6 boxes on the left checked.
Select OK.
Now open the NavalMine.dat and you should see something like this image.
http://i108.photobucket.com/albums/n12/privateer_2006/Hex%20Edit/Lesson_1a.jpg
Notice I have Ref's dat file format info. This is our main guide.
The 4 bytes in BLUE are important!
You are going to see this alot so make sure you understand this part.
The data Inspecter tells us the info to come is 51 bytes long.
Count the GREEN area and it's 51 bytes.
If you delete Kashmir in the left window, you need to lower
the count in blue to match the new length.
Click on the 33, open tools and select Encode number,
and set it up like below
http://i108.photobucket.com/albums/n12/privateer_2006/Hex%20Edit/Lesson_1c.jpg
Click OK and you should see that the 33 00 00 00
is now 2C 00 00 00
:up:
Small addition: String "Skip the first 20 bytes they seem to be always the same"
must to be "Skip the first 12 bytes. It's file header and we pass it".
Next data block is usual data block (chunk?) Type 1000 it can to have a name "Author's Description" (for exemple). It is important for creation of the program of Pack 3D type.
Next it's data block (chunk?) Type 0, SubType (version) 0 and size = 0 (all 12 bytes).
It's marker-block of beginig of data interesting us.
In the end of a file we have a marker-block of the end of data interesting us.
It's data block Type 0, SubType (or Version) 1 and size = 0 (all 12 bytes).
P.S. What is it chunk?
In the programming language (for example C ++) it refers to the data block ...
Madox58
03-09-07, 11:35 AM
Thanks Anvart :up:
I'll change my reference files to match this info!
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.