![]() |
Hex Edit 101
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:
|
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 |
weve talked about this already
Quote:
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 |
I have no idea, and I’d like to learn so I don’t have to bother people asking them for files.
|
Nice one
Great idea Count me in |
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/delph...vi32/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: |
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: |
Quote:
|
Quote:
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. |
Hi
Hi,
What uses in order to modify the boxes in .zon file? Work in hex? BEST REGARDS UBOAT234 |
Quote:
I have got a program I'm working on that will let us do it in a 3d enviroment. |
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/n.../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/n.../Lesson_1c.jpg Click OK and you should see that the 33 00 00 00 is now 2C 00 00 00 :up: |
Make sure you save the file then open version 5 of Pack3d and open the file.
http://i108.photobucket.com/albums/n.../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. |
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/n.../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, 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. |
http://i108.photobucket.com/albums/n.../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. |
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/n.../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. |
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? |
All times are GMT -5. The time now is 03:19 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.