XVI32 Notes: Tips on XVI32 Hex editing
Get XVI32 at: Christian Maas's Website

This page describes how to use XVI32 especially with EAW files.
(republished 4/2007 from my 2003 version)

Well first I tell how to set the XVI:
1.When u click on a file there will be a setup for the right click in Windows Explorer: send to : XVI32 that is what I use to open a file with it.

2.The XVI hex editor doesn't make a change saved to a file unless you save it.Some hex editors do whenever you open it.That can be most bad, as soon as you open in those type it changes the filedate!!!:(

3.Always make a new filename save when editing!Or you will get lost quickly!I add a number to the end of the name,etc.I keep track this way.

4.At first hex editing very hard to follow. After a few days you will feel it is so easy!


5. Open XVI with a file: The next step is to get the window showing the number of "columns" you want.By default it shows i think 17:
Select "tools" from menu,then: "options",then: "appearance", then set the "number of Columns" that is the width of the window.Ignore the rows, it won't matter much.
I use 16 Columns usually.This makes a good line up for most files.Much of the data for EAW is 32 byte sections to edit.So this makes it easy to see 2 rows will contain that area. Sometimes,like for griddata.dat I prefer to use only 8 "columns".It just depends what u find u like.Keep it a even number and you will see it is easier to look at a file.
Maybe also increase the font size to see better.
Example:

The columns set for 16, which I use.get to this window from the "tools" menu,then: "options",then: "appearance".
6.Other settings: You won't need to know much or touch these usually, they are set good by default.Except the editing functions and the "address" : "jump width".
7."Address" this is where you go to in the hex file.
Normally we would start with cursor at beginning of file,

But in this case we skip the first 4 header bytes (which contain 2E 01 followed by 00 00) and start at the 5th byte of the Targets.dat file.
(Use the arrows on your keyboard to move the cursor)

-Open "address" menu, then "jump width" leave it on "decimal" button; as mostly the notes will tell you decimal (regular) numbers for an address: Just enter the number,o.k.!Then u press F5 to go there and Shift+F5 to go back (or use scroll,etc.)

*XVIJWid.jpg:
The XVI32 "Address" menu (the file Targets.dat is open also) and the "Jump Width" being ready to be selected.



The "Enter Jump Width" window. I have already entered the Targets.dat address for Brussels in the window and the selector button is on "Decimal" (the addresses listed in most files are decimal); I just have to click "O.K." and the jump address will be entered.. after this I'm ready to jump by pushing F5 on my keyboard.
Example of "Address"
From Dom's EAWK3.wdb document (converted to HTML by me as the EAWK3wdb.html)


Shows the EAWK3wdb.html document at the Targets.dat address area for Brussels - 4640-4671,(starts at 4640 and contains 32 bytes including 4671).This would be the the address to jump to from where the cursor was at the 5th byte (thus skipping the header bytes): 4640.
Also seen to the left of the address is the 8 byte coordinates of Brussels in the EAW World.



Here it is at Brussels address.. I pressed F5 on my keyboard.(I started of course at the 5th byte of the beginning of the Targets.dat so I am at the correct address as listed in EAWK3wdb.html; I can confirm this also by looking at the 8 bytes starting at where the cursor is; as you can see the EAW World coordinate address is shown just as listed in the EAWK3wdb.html.

(In Moggy's Notes, the document; "techtarget.htm" tells us that the first 8 bytes in a record here in Targets.dat are the EAW coordinates.)

--What about the address on the left?Those are the end of the previous record.Because of the way I prefer to show the use of XVI32 with 16 columns shown and using a Targets.dat WITHOUT the header stripped it will look like this.If I were to have "stripped" (removed) the first 4 bytes of the file, it would all line up nice with the columns.But personally I prefer it this way.I don't recommend stripping the header.It also is easy to see where I'm at anyway.You will get used to it! -If you want to keep jumping once you there in the file it will "jump" from where you are.So if i was looking at Brussels in Targets.dat and wanted to go easy to the next Target I would then open the "jump address" box again and set "32" that would put me at Grimbergen's target address.

Note; You have to open and say "ok" every time you change a jump width.Or if you close and open XVI.

8.About bytes: and Hexidecimal: and various EAW notes;
-Usually some people's notes will use the convention when taking about the actual bytes of the data to edit is (for example a 32 byte block) 0-31.
This is confusing.(Just remember its a way of talking due to their "hex brains" ..lol)32 bytes is 32 bytes.
if you wanted to see, and they say "then at byte 7" be advised that they may be saying "7: of 0-31"
actually it would be "8" if you count 1-32, like i do!So i always doublecheck.If i write notes i will say "byte 8 of 32" this tells exactly where!!!
-About Bytes:
Each space you see in XVI is a byte,(on the left side main window,the Hexnumbers/00 to FF: ignore the right side window;you will not be wise to edit from letters on right side window,there is too much complications to explain) in the default mode.
-Hexidecimal:
The numbers 00 -FF (256: 0-255) in hex.Learn a little about hex. system.Mostly you need to know little.Each space in the XVI is a byte.To convert to hex just use Windows Calculator.Install it from Windows setup if u don't have it.Then select the "scientific" mode.Then you can convert Hexidecimal to Decimal easy, etc.
-The numbers in hexidecimal are ALWAYS Hexidecimal.It just so happens that numbers 0-9 in deciaml are the same on hexidecimal.0=0 1=1, etc.until you get to 10 decimal.10 decimal is "0A" or simply "A".a zero will always go in front of single numbers.00=0 01=1, etc.hexidecimal always has 2 characters in each the byte to edit. So "F0C" is really 0F 0C : 0F in one byte,0C in another.FOC would be 3852 in decimal.Really is should be spelled 0F0C.

9."Offset" what is it?
If you ever see "offset" or a number like F0C:08 what the heck is that?
That is Stupids, being stupidier.. lol.There is no Hexidecimal number like that!!If you wanted to find it you would go to F0C (0F0C) address (3852) then look at the 8 byte once you get to that row.Remember that in some peoples notes, they may be saying 8 of 0-31..lol.. really it is 9 of 1-32...
they are really saying: "Of the 3852th record look for this record there" It is useful if looking at millions of records of bytes.

10.Confused yet??
hehe.. just find the proper location of the data you look for... Then the number to be entered in those spaces.Then type it in when cursor over it.Save as new filename.Then "poof" , test!

Warning!!!!!
NEVER ever push the backspace in XVI !!! it will screw up the "columns" you see.Like the file has shrunk!If you do by mistake close the file!!Be most careful about this.Or you find strange mistakes in edits...lol! Use the arrow keys to move the cursor!!


More notes: --About the Tardata.dat file header; (Tip by Moggy);
(The tardata.dat header is F20E).
((for a default size one- the Tardata can be customized and additional entries added, the header would have to be recalculated to show correctly the new record size-- for instance in my OAW mission 1 the tardata is larger - ;)Tip by RAF_Roy))
This data format is however back to front and should be read as "0EF2", the decimal equivalent of which is 3826, which is the number of records.)
--((Targets.dat ; never change the header or size.))


Tutorial misc.
About the "Jump Address" :
The jump address will remain the same in XVI32 until I change it; so if I pressed F5 again, I would jump 4640 again.

About using the jump when I'm already at an address :
Since I might want to jump to the next record in the file from where aI'm at and I know that each record is 32 bytes long in this file, I could enter 32 as a new "Jump Address" and then press F5 and then I'd jump 32.

How to jump up? :
Shift + F5 (or use the menu with the mouse)

Help:
There are help files in XVI32.

Why does the Targets.dat shown here look different than the EAW default one?
Because shown here is the Targets.dat from OAW Mission1.It is customized, but the address here is the same as a default, though you might notice that some other data has been changed.. like for instance the number of targets at the location and the location pointer address for Tardata.dat has been moved; (it now points to where I added on record area in that file and not the original address..
Isn't learning this EAW editing great?!!! ;)