TeamBG

Hex Editing F.A.Q.


F.A.Q.
Introduction
Greetings to all welcome to FAQ Page.
These pages were brought to you by Thalic, GMAN, Graf, Seroki, and Suryiel. Thank them!
AND don't forget to thank Ken and TeamBG for these editors
They don't get paid for this!
Remember it is not a sin nor a bad thing to read the references at the top of the Struct List. A lot of Questions can be answered quickly there.
Now lets start

Q: I want to Hex Edit but I'm a Newbie, Help!
A:
1. You will want to join the mailing list (preferred method) or download the Struct List from Dh'arlo'me's Keep under files and review the references at the top of it.
2. Get a hex editing tool (A.X.E. is a good one)
3. Familiarize yourself with all of these materials
4. Use biffstripper to extract SW1H01.ITM and rename file to tutorial.itm .
    for info on how to do this go to TeamBG Utilities FAQ
5. Start walk through

What is Hexadecimal Editing
(Familiarization)
ITM file structure Adding a Struct
Walk through #1
Adding an Extended Header
Walk through #2
Misc.

 
 
 
 
TeamBG Home Page
TeamBG Utilities
Message Board
Hex Editing Message Board

 
 
 
 
 
What is Hexadecimal Editing
(Familiarization) back to top

Click here for all of the Knowledge in the world.

 
    back to top

 
ITM file structureback to top
Values taken from
SW1H01.ITM
00000000 49 54 4D 20 56 31 20 20 F6 19 00 00 51 1A 00 00
00000010 4D 49 53 43 35 36 00 00 2C 00 00 00 14 00 80 D7
00000020 4C 40 53 31 00 00 0B 00 00 00 00 00 00 00 00 00
00000030 00 00 00 00 19 00 00 00 01 00 49 53 57 31 48 30
00000040 31 00 00 00 47 53 57 31 48 30 31 00 0A 00 00 00
00000050 52 1A 00 00 FF FF FF FF 43 53 57 31 48 30 31 00
00000060 00 00 00 00 72 00 00 00 01 00 AA 00 00 00 00 00
00000070 03 00
This is a Header. A Header is 72h (114d) bytes long and contains general information like weight, price, text references and much more.
00000000 01 00 01 00 49 53 57 31 48 30 31 00 01 00 01 00
00000010 00 00 08 00 00 00 04 00 02 00 00 00 03 00 00 00
00000020 03 00 00 00 02 00 03 00 00 00 01 00 32 00 32 00
00000030 00 00 00 00 00 00 00 00
This is an ExtHeader. An ExtHeader contains information like damage (if it's a weapon), range, graphical effects and such a stuff.
00000000 07 00 02 00 05 00 00 00 15 00 00 00 02 00 00 00
00000010 00 00 64 00 00 00 00 A4 14 24 00 04 00 00 00 00
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
This is a FeatureBlock, simply called a struct. Structs are used to define what a special item does.

For detalied information on each offset go here

Made by Graf Hohfels

    back to top

 
 
Adding a Struct
Walk through #1 back to top
Tutorial

We want to make a new item, it will be a bastard sword +2, +4d4 cold damage.
The first thing to do is to open an existing bastard sword with an Hex Editor.
You'll get them from using BiffstripperL.exe. NOTE: Make sure you saved the item
under different name, for example tutorial.itm.

Here we go:

Tutorial made by Graf Hohfels

 

    back to top

 
Adding an Extended Header
Walk through #2 back to top
Tutorial#2

Now we will try to make some more difficult changes: we want to create
Bastard Sword +2, 4d4 cold damage unless save vs. spell with the
special ability to cast an ice ball (range: 50m, 4d4+4 cold damage unless
save vs. wand (then 2d4+2). Whenever this ability is used, the wielder
suffers 1d6+1 cold damage. But now it's a mighty weapon, so we will have to build
in a penalty: constitution and strength are decreased by 1 while the
weapon is equipped. And not enough, we're going to change the icons.

Here we go:

Tutorial made by Graf Hohfels

 

    back to top

 
Misc. -
Q: Can i change the experience for my creatures?
A: Yes, It's not too dificult to discover such values:
(1) CLUAConsole:CreateCreature("DOOMGU")
(2) KILL IT
(3) write down the XP gained (2000)
(4) convert it to Hex (D007)
(5) open DOOMGU.CRE with a HexEditor
(6) find the value (D007)
(7) you'll get offset 0x014 (length 4 bytes)
(8) change the value D0 07 00 00 to A0 86 01 00
(9) save this modified creature into your override
(A) CLUAConsole:CreateCreature("DOOMGU")
(B) Kill it
(C) Feel experienced (100000XP)For the sake of experience,der Graf