items.sav - 75% Reversed Engineered

This is for general discussion about Hidden & Dangerous 2, talk about what you liked or what you didn't like about the sequel. Talk about multiplayer games, setup matches etc.
(UGF} Corporal Desola
Corporal
Posts: 44
Joined: Sun Sep 28, 2008 6:36 am
Contact:

items.sav - 75% Reversed Engineered

Unread post by (UGF} Corporal Desola » Sun Sep 28, 2008 7:15 am

Hello,

First to answer a few questions that I found answers to in reverse engineering the file format of, and moddifying, the items.sav file, I will describe what I've observed items.sav to do for Hidden and Dangerous 2.

Description:

The file, items.sav, is used by Hidden and Dangerous 2 to work out which models have what ItemIDs, how much they weigh, which gun uses which ammunition, and what unifom has what headwear. It should also be noted that it looks to also includes the data to say that a model of an radio can in airstrikes and another record entry describes the same model, but this one has the abillity to call in artillery.

Put another way, the items.sav file litterly descibes the models and model aliases (other records that use the same model but have a different ItemID, like the Airstrike Radio and the Artillery Radio) to Hidden and Dangerous 2. It stores each description in what I call an Record, because I'm from the old BASIC and PASCAL period, when Object Orientated was defined by Databases and Data files with Records.

items.sav is also the file responsable for those hackers (one including myself, see below for my UGF disclaimer) who run arround with headwear like the Black Beret, but those who run arround with weapons when cheats are disabled and the maplist.txt file hasn't been edited, I would say thats probably hacking done though a WinSock or DirectPlay hacking program, thus being out of the scope of items.sav.

And I think the crashing errors caused by using the knitted cap and civilian clothes is caused by missing or mis-typed data in the items.sav file by the original development team (no disrespect meant), I might look into this.

items.sav File Format Description with Notes:

These notes and structures assumes that all arrays have
a base of zero not one, therefore, an array that has a
bound of 19 really has 20 elements, eg. char a[19];
sizeof(a) = 20

Summarized Description:
  No file header.
  Records are read straight from the start
  of the file.
  The number of bytes per record varies by
  the two types defined in each record's
  header, if the SizeType = 1 then the
  record is 508 bytes long (including
  header), if the SizeType = 0 and
  RecordType DOES NOT equal 0 then the
  record is 512 bytes long, and if the
  SizeType = 0 and RecordType = 0 then
  the record is 516 bytes long, see below
  for the currently revealed format of
  the record data.

Record Header Structure:

  DWORD dwRecordSizeType;  /* 0 = Long Record, 1 = Short Record */
  DWORD dwRecordType;

Short Record Structure (note: sizeof(RECORD_HEADER) + (SHORT_RECORD) = 508):

  char strName[19];
  char strImage[19];
  char strModel[19];
  char strUnknown[19];
  char strExpressedName[19];
  DWORD dwItemID;
  char bUnknownData[103];
  char strShortName[7];
  char bRecordData[283];

Long Record Structure (note: sizeof(RECORD_HEADER) + (LONG_RECORD) = 512):

  DWORD dwFlag;
  char strName[19];
  char strImage[19];
  char strModel[19];
  char strUnknown[19];
  char strExpressedName[19];
  DWORD dwItemID;
  char bUnknownData[103];
  char strShortName[7];
  char bRecordData[283];

Long Ammunition Record Structure (note: sizeof(RECORD_HEADER) + (LONG_AMMO_RECORD) = 516):

  DWORD dwFlag[1];
  char strName[19];
  char strImage[19];
  char strModel[19];
  char strUnknown[19];
  char strExpressedName[19];
  DWORD dwItemID;
  char bUnknownData[103];
  char strShortName[7];
  char bRecordData[283];

This data translated to Visual Basic 4.0/5.0/6.0:

  Type RECORD_HEADER
    dwRecordSizeType As Long
    dwRecordType As Long
  End Type

  Type SHORT_RECORD
    strName As String * 20
    strImage As String * 20
    strModel As String * 20
    strUnknown As String * 20
    strExpressedName As String * 20
    dwItemID As Long
    bHeaderData(103) As Byte                      ' 104 - 1 = 103
    strShortName As String * 8
    bRecordData(283) As Byte                      ' 284 - 1 = 283
  End Type

  Type LS3D_LONG_RECORD
    dwFlag As Long
    strName As String * 20
    strImage As String * 20
    strModel As String * 20
    strUnknown As String * 20
    strExpressedName As String * 20
    dwItemID As Long
    bHeaderData(103) As Byte                      ' 104 - 1 = 103
    strShortName As String * 8
    bRecordData(283) As Byte                      ' 284 - 1 = 283
  End Type

  Type LS3D_LONG_AMMO_RECORD
    dwFlag1 As Long
    dwFlag2 As Long
    strName As String * 20
    strImage As String * 20
    strModel As String * 20
    strUnknown As String * 20
    strExpressedName As String * 20
    dwItemID As Long
    bHeaderData(103) As Byte                      ' 104 - 1 = 103
    strShortName As String * 8
    bRecordData(283) As Byte                      ' 284 - 1 = 283
  End Type

United Gamers Federation Hacking Disclaimer:

It should be noted that hacking to gain an gaming advantage goes against the core beliefs of the gaming society of which I created and belong to, but this was not hacking to gain an gaming advantage, it was reverse engineering in which required experimental hacking, and the reason for this reverse engineering was to help the H&D2 modders, the few that are out there.

Also having a Black Beret instead of an Red one, is almost like swapping skins in IL-2 Sturmovik, and provides no real gain, except that of the vanity of the user which in my case was me.
Watch my personal text, it reveals how many days or how many kilobytes of code may pass before I'm seen on the forum and what I'm doing on those days; It's being as Zoolander would say "InFourMaTave in a small small way".

User avatar
Jason
Administrator
Posts: 1895
Joined: Thu Sep 02, 2004 7:26 pm
Location: Perth, Australia
Contact:

Re: items.sav - 75% Reversed Engineered

Unread post by Jason » Sun Sep 28, 2008 2:43 pm

Thank you for your research and detailed information thup01
A new day, a new beginning

Fixing H&D2 Multiplayer tutorial

User avatar
-ViTaMiHnM203-
SAS Soldier
Posts: 1347
Joined: Wed May 11, 2005 7:52 am
Location: Classified
Contact:

Re: items.sav - 75% Reversed Engineered

Unread post by -ViTaMiHnM203- » Sun Sep 28, 2008 4:10 pm

Too bad that black beret ain't actually black.
Eight, 8, the burning eight; between Sunday and Monday exists a day so great, it will devastate. :twisted:

(UGF} Corporal Desola
Corporal
Posts: 44
Joined: Sun Sep 28, 2008 6:36 am
Contact:

Re: items.sav - 75% Reversed Engineered

Unread post by (UGF} Corporal Desola » Mon Sep 29, 2008 12:28 am

Glad I could help you guys.

Also, the Black Beret, ItemID: 103 and High ItemID: 1103, not Black?
Then why does it have the Royal Marine ensignia on it, the globe badge that is, and looks black, or am I imagining things and color blind - Oh no, I knew too much hex editing was bad, I knew it.

And, I looked into the reason why the Knitted Cap doesn't apear and when you try to discard it, it crashes H&D2, the model name specified in items.sav is b_en_kulich when it should be B_en_kulich1, when you change it apears, and does not crash H&D2 when you discard, but by discovering this error I found an way, which I don't want to explain, to cause everyone to disconnect from an online server and there isn't a thing the admin can do about it unless they kick or ban you, if they think your responsable.

Guys can you look at my second topic in the H&D2 Modding section please, as I have absolutly no idea how these new non-RAR .DTA files work!
Watch my personal text, it reveals how many days or how many kilobytes of code may pass before I'm seen on the forum and what I'm doing on those days; It's being as Zoolander would say "InFourMaTave in a small small way".

User avatar
Jason
Administrator
Posts: 1895
Joined: Thu Sep 02, 2004 7:26 pm
Location: Perth, Australia
Contact:

Re: items.sav - 75% Reversed Engineered

Unread post by Jason » Mon Sep 29, 2008 7:08 am

but by discovering this error I found an way, which I don't want to explain, to cause everyone to disconnect from an online server and there isn't a thing the admin can do about it unless they kick or ban you, if they think your responsable.
:lol: yes please keep that one to yourself, the multiplayer community is already fragile enough

I find it interesting how people obsess about the beret, it doesn't stop a built  but it does look COOL, if only we could make it bullet-proof funny01
A new day, a new beginning

Fixing H&D2 Multiplayer tutorial

(UGF} Corporal Desola
Corporal
Posts: 44
Joined: Sun Sep 28, 2008 6:36 am
Contact:

Re: items.sav - 75% Reversed Engineered

Unread post by (UGF} Corporal Desola » Mon Sep 29, 2008 10:02 am

I just want to be known as the first one in the history of H&D2 to have a hack that has that power, it helps certify my belief it myself as I never thought I could hack anything before now.

But please do take note that THERE ARE INCORRECT MODEL FILENAMES IN THE items.sav file, and this very well be the reason some mods server or client side, may be unstable, I would release a patch but I tried once to contact Illusion Softworks saying how cool H&D2 was and if they could let me know if a new simmilar product of theres is comming out (H&D3 for instance) and they didn't even bother to reply.

So if I did bring out a patch I don't think anyone would download it because they would probably reguard it as an mod not an patch, because I doubt Illusion Softworks would officialize it for me.
Watch my personal text, it reveals how many days or how many kilobytes of code may pass before I'm seen on the forum and what I'm doing on those days; It's being as Zoolander would say "InFourMaTave in a small small way".

User avatar
-ViTaMiHnM203-
SAS Soldier
Posts: 1347
Joined: Wed May 11, 2005 7:52 am
Location: Classified
Contact:

Re: items.sav - 75% Reversed Engineered

Unread post by -ViTaMiHnM203- » Mon Sep 29, 2008 5:57 pm

(UGF} Corporal Desola wrote: Also, the Black Beret, ItemID: 103 and High ItemID: 1103, not Black?
Then why does it have the Royal Marine ensignia on it, the globe badge that is, and looks black, or am I imagining things and color blind
Yeh, you are, it's not, it's a Navy Blue. That is not the Royal Marines' insignia on it. no_02
(UGF} Corporal Desola wrote: but by discovering this error I found an way, which I don't want to explain, to cause everyone to disconnect from an online server and there isn't a thing the admin can do about it unless they kick or ban you, if they think your responsable.
(UGF} Corporal Desola wrote: I just want to be known as the first one in the history of H&D2 to have a hack that has that power
Heh, I don't hate to burst your bubble, but I have seen that before. I assumed some one was messing with some file, but never tried to recreate it. Just because you have not seen something before or heard of it doesn't make you the first. I wouldn't be surprised if twelve people know of the "hack" you are talking about, they just kept their mouths shut about it. :mrgreen:
(UGF} Corporal Desola wrote: it should be B_en_kulich1, when you change it apears, and does not crash H&D2 when you discard
Just tried this, doesn't work for me. It still crashes and doesn't appear.
Last edited by -ViTaMiHnM203- on Mon Sep 29, 2008 6:17 pm, edited 1 time in total.
Eight, 8, the burning eight; between Sunday and Monday exists a day so great, it will devastate. :twisted:

(UGF} Corporal Desola
Corporal
Posts: 44
Joined: Sun Sep 28, 2008 6:36 am
Contact:

Re: items.sav - 75% Reversed Engineered

Unread post by (UGF} Corporal Desola » Tue Sep 30, 2008 9:42 am

Yes, well I thought I was the first to crash a server in this way because I have never seen it, sorry to whoever's fire I stole.

Anyways, it should be noted that seeing all string values are of the ZString-type (or Null-Terminated Strings), the name MUST end with a null character/byte, that is why they are 20 bytes in size, yet you only get 19 bytes to play with.
(so it needs to be, B_kulich_en[null byte/character 0]).

Also I have made updates to the specification I gave above, now I have found the weight parameter of the item, and made it into an .txt document, but I am affaid of wasting forum space by double-postiong.

(.dta files are almost an Catch 22).
Watch my personal text, it reveals how many days or how many kilobytes of code may pass before I'm seen on the forum and what I'm doing on those days; It's being as Zoolander would say "InFourMaTave in a small small way".

User avatar
Jason
Administrator
Posts: 1895
Joined: Thu Sep 02, 2004 7:26 pm
Location: Perth, Australia
Contact:

Re: items.sav - 75% Reversed Engineered

Unread post by Jason » Tue Sep 30, 2008 2:26 pm

I would release a patch but I tried once to contact Illusion Softworks saying how cool H&D2 was and if they could let me know if a new simmilar product of theres is comming out (H&D3 for instance) and they didn't even bother to reply.

So if I did bring out a patch I don't think anyone would download it because they would probably reguard it as an mod not an patch, because I doubt Illusion Softworks would officialize it for me.
I use to email a guy from IS/2k Czech but now it's all silent, my guess is they are really busy with Mafia 2 and their other unofficial game "Moscow Rhapsody" (which looks good, theirs a post in the other games forum thread). I don't blame 2k Czech for not replying at this point in time, no doubt something to do with Take2. They tend to favour Czech websites also :cry:
A new day, a new beginning

Fixing H&D2 Multiplayer tutorial

User avatar
-ViTaMiHnM203-
SAS Soldier
Posts: 1347
Joined: Wed May 11, 2005 7:52 am
Location: Classified
Contact:

Re: items.sav - 75% Reversed Engineered

Unread post by -ViTaMiHnM203- » Tue Sep 30, 2008 7:24 pm

(UGF} Corporal Desola wrote: Yes, well I thought I was the first to crash a server in this way because I have never seen it, sorry to whoever's fire I stole.
I don't think there is any fire to steal! I was just saying don't start getting excited yet!
(UGF} Corporal Desola wrote: (so it needs to be, B_kulich_en[null byte/character 0]).
Hey? Guess what? I'm confused, did you "fix it" or not? Must it be a "B" and not a "b" and drop the "1" now?

That didn't work either.
Last edited by -ViTaMiHnM203- on Tue Sep 30, 2008 7:45 pm, edited 1 time in total.
Eight, 8, the burning eight; between Sunday and Monday exists a day so great, it will devastate. :twisted:

(UGF} Corporal Desola
Corporal
Posts: 44
Joined: Sun Sep 28, 2008 6:36 am
Contact:

Re: items.sav - 75% Reversed Engineered

Unread post by (UGF} Corporal Desola » Wed Oct 01, 2008 1:41 am

I fixed it, but remember I only fixed the Knitted Cap NOT the civilian uniform it belongs to, and no, that was a mis-type, it's supposed to be B_en_kulich1[null byte/0 character].

I should probably note that I only have H&D2 not H&D2 SS, man, not having SS is really starting to suck if anything I fix for H&D2 cannot be applied to Sabre Squadron.
Watch my personal text, it reveals how many days or how many kilobytes of code may pass before I'm seen on the forum and what I'm doing on those days; It's being as Zoolander would say "InFourMaTave in a small small way".

User avatar
-ViTaMiHnM203-
SAS Soldier
Posts: 1347
Joined: Wed May 11, 2005 7:52 am
Location: Classified
Contact:

Re: items.sav - 75% Reversed Engineered

Unread post by -ViTaMiHnM203- » Wed Oct 01, 2008 4:51 pm

The civilian uniform has a separate fix. I just got it to work now. Who made it that awful color? Gonna have to change that... Desaturated and reduced colors; think it's right. :mrgreen:

What I did wrong was start ahead of it, I needed to replace it and then add the 00 to the end. You don't need the B to be capitalized, just add the 31 00 to the end.

Bad news... Even this minor modification to the items.sav breaks or destabilizes all the maps with SS items on them. Most of the maps load fine. It removed the flare gun from the set up. The two Sicily maps crash on loading in coop, didn't test single. Burgundy3 crashes right away in singleplayer. With Libya1 coop, as soon as I clicked on the crate with the AT weapons, it crashed. Obviously because of the Panzerschrek that is in it. The Libyan Guerrillas all had bare heads, ya know their turbans were missing.

This is really messed up, because I have been wanting this item in game for years. lol frown01 angry01 :sad: :cry:

I also noticed a few days ago, that correcting Harald Freiberg to Gunter Freiberg in the HumanStore broke the "P.O.W." that identifies the captured SAS team on Burgundy3. They read instead "MP 6".

They really just wanted to push this game out ASAP. They put the pieces to gather in a way that it was playable, but if you tried to improve upon it, it would come crashing down. I have known this for a long time, sadly. Even sadder is that this is my favorite game. lol
Last edited by -ViTaMiHnM203- on Wed Oct 01, 2008 7:31 pm, edited 1 time in total.
Eight, 8, the burning eight; between Sunday and Monday exists a day so great, it will devastate. :twisted:

(UGF} Corporal Desola
Corporal
Posts: 44
Joined: Sun Sep 28, 2008 6:36 am
Contact:

Re: items.sav - 75% Reversed Engineered

Unread post by (UGF} Corporal Desola » Thu Oct 02, 2008 6:34 am

Yes! You got it, but the color is starting to grow on me, but I suppose it was like that because they thought it would only be used once in the whole game, the first mission, on the C-47's load master's head, I call it the Vaasgo raid, but it's called something else by the actual game.

And the game apears to me, as if it started out going okay, but in the end they had to rush it to get it on the self, thats why I suppose not one uniform uses the 'Black Beret'.

And tell me, Vitamin, how did the community decide it was Navy Blue, and the reason I came to the conclusion that it was a Royal Marine Beret was the fact the beret looks black to me and it's insignia has the oak leaf crest arround it.

And the truth is I originally set out to edit the items.sav file so I could get the Knitted Cap myself, but when you try to find one in real life, they are actually the Pattern 1937, Scaf or Cap, Comforter, but it is true that it's an one-end-open double knitted scaf, not an actual cap.

Which file is that, that your trying to edit, and I'll see, if it isn't a 'TEXTY Pro file', if my installation has a copy of it and will try to reverse it properly for you, so then that MP 6 returns to P.O.W. hopefully.
Last edited by (UGF} Corporal Desola on Thu Oct 02, 2008 6:38 am, edited 1 time in total.
Watch my personal text, it reveals how many days or how many kilobytes of code may pass before I'm seen on the forum and what I'm doing on those days; It's being as Zoolander would say "InFourMaTave in a small small way".

User avatar
-ViTaMiHnM203-
SAS Soldier
Posts: 1347
Joined: Wed May 11, 2005 7:52 am
Location: Classified
Contact:

Re: items.sav - 75% Reversed Engineered

Unread post by -ViTaMiHnM203- » Thu Oct 02, 2008 8:41 pm

Well I thought the "Black Beret" was added with SS, if you are playing HD2 with the 1.11 or 1.12 patch that is why you would have it. It is used in the Burgundy3 mission, on a soldier from another team.

As for "the community" funny02, deciding it was Navy Blue; I never stated what the community thinks, most of the community could care less about detail.

The beret never looked black to me, it is navy. If you take the Beret and drop it on the floor next to some other black clothing you will see very clearly. I supposed it can be a "colloquial black", but it really isn't. The official black berets worn by the British during the war were really black. I think maybe after the war when the armored regiments sealed the black beret for themselves only, the other units might have adopted a very deep navy blue and just called it black. :mrgreen:

As for the insignia, it looks like a flower pin if anything. Something like this - http://img367.imageshack.us/img367/2373/43bde1zk6.jpg - the insignia on the beret goes full round. The Royal Marines insignia breaks at the top. It would be like spotting a piece of dog shit and calling it swirl cake. You can pretend it is whatever you want I guess. Furthermore didn't RM Commandos wear a green beret starting in 1942?

'TEXTY Pro file'? My texty has been modified to hell over the years, correcting a hell of a lot of mistakes. There is a "P.O.W." in the texty, but it does not attach to the "P.O.W."s on Burgundy1. Just like the entry there for Freiberg doesn't go to him. I have had "P.O.W." renamed to "Prisoner of War" for awhile now, and I don't think I have ever seen it in game.

The HumanStore definitions file where it grabs Freiberg's name from, you know when targeting him, is Harald Freiberg. It is like this in the Spanish and Italian language textys, but not the others. If you change it to Gunter, it works fine in game, but like I said I noticed it killed some of the other names and characters. Same issue with the items.sav. There must be corresponding files in the SS dtas that get pushed around when their corresponding HD2 files are modified. As for "MP 6", I have not found that in the textys or in the HumanStore, if it is in there it is not written plainly in ascii.
Eight, 8, the burning eight; between Sunday and Monday exists a day so great, it will devastate. :twisted:

(UGF} Corporal Desola
Corporal
Posts: 44
Joined: Sun Sep 28, 2008 6:36 am
Contact:

Re: items.sav - 75% Reversed Engineered

Unread post by (UGF} Corporal Desola » Fri Oct 03, 2008 4:36 am

So it's the humanstore.def file, well I'll look in to it, and everything is ASCII, bytes on Intel compatible computers are displayed in ASCII, otherwise we'd probably look at binary (not decimal numbers) without it, and the Army Commandos wore Green Berets, thus the name, but believe it or not Black was the standard for the other Army Units and Royal Marines, I only recall Australian Army engineers starting to wear Dark-Blue Berets in the mid 1960s. (The UN stuff is Bright Blue in comparison.)

(Yes, most word processing programs, such as Notepad, Word and Wordpad have a plain ASCII encoding, but that only serves to annoy you, and in all likleyness was invented as an selling point for Hex Editors as they 'Show the Hidden Bits, ooooo!'.)
Watch my personal text, it reveals how many days or how many kilobytes of code may pass before I'm seen on the forum and what I'm doing on those days; It's being as Zoolander would say "InFourMaTave in a small small way".

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 55 guests