Skip to content

Parsing files... Have question(s)

Hi to all. I'm working on parsing files. And right now stunned with CHITIN.KEY Bif Entries offset 0x000a. IESDP says something about "The 16 bits of this field are used individually to mark the location of the relevant file." But I don't understand in clearly. When I parse file with ma program, I get something like this from these two bytes: b'\x01\x00' or b'A\x00' or even b'@\x00' and so on. I can not compare this data with the rest of IESDP notice: "(MSB) xxxx xxxx ABCD EFGH (LSB) Bits marked A to F determine on which CD the file is stored (A = CD6, F = CD1)
Bit G determines if the file is in the \cache directory
Bit H determines if the file is in the \data directory"
There is more than 8 variants of data in this offset...
Please, help to understand...

Comments

  • Saigon1983Saigon1983 Member Posts: 157
    Nobody? ((
  • qwerty123456qwerty123456 Member Posts: 67
    edited December 2016
    Like I mentioned elsewhere, you don't want to parse IE files on your own. Use Weidu. It's taken some dozen years of development. It's not that hard for someone who mastered python.
  • argent77argent77 Member Posts: 3,478
    This field can be used as pointer where to look for BIF files. As mentioned by IESDP each bit indicates where the game should look for it.

    Bit 0: Root folder of the installed game (IESDP is not entirely correct on this one)
    Bit 1: "cache" directory (or maybe CD0 directory. I don't think I encountered this bit yet in a game.)
    Bit 2: CD1 directory
    Bit 3: CD2 directory
    Bit 4: CD3 directory
    Bit 5: CD4 directory
    Bit 6: CD5 directory
    Bit 7: CD6 directory
    Bit 8: Most likely CD7 directory (I never encountered this bit either.)

    The "data" subfolder is usually part of the BIF filename found in the BIF entry structures of chitin.key.

    These bits are pretty much only relevant for the original IE games. The actual CD locations are defined in the baldur.ini (and their counterparts in IWD, PST, ...).
  • Saigon1983Saigon1983 Member Posts: 157
    @qwerty123456, the point is to improve python skills first of all, and gaining game info is the second matter.
  • Saigon1983Saigon1983 Member Posts: 157
    @argent77, thanks, Most of all, yes, there is only one bit, But sometimes parsing these bits gives me such sequences: "10011100" or "10011110"...
  • argent77argent77 Member Posts: 3,478
    It means that the BIF file may exist in all of those locations. Although I wouldn't rely on this info alone. A number of BIF files were present on several discs to reduce disc swapping back in the days.
  • Saigon1983Saigon1983 Member Posts: 157
    @argent77, understood. Thanks. So... next question)) IESDP gives three kinds of BIFF signatures: BIFFV1, BIFCV1.0 and BIFCV1, but I found in my data folder 'PK' ('PK\x03\x04') signature with '\x14\x00\x00\x00' versions for biffs 'tb#gen15.bif', 'tb#gen16.bif', 'tb#gen17.bif' (It is very custom BWP =)) What is this and how I must parse them? (BTW, Merry Christmas! if you celebrate this date)
  • ArdanisArdanis Member Posts: 1,736
    I found in my data folder 'PK' ('PK\x03\x04') signature with '\x14\x00\x00\x00' versions for biffs 'tb#gen15.bif', 'tb#gen16.bif', 'tb#gen17.bif' (It is very custom BWP =)) What is this and how I must parse them?

    Judging by the prefix, these were created with http://www.shsforums.net/topic/39238-generalized-biffing/ Which incidentally happens to be in WeiDU ;)

    BTW, Merry Christmas! if you celebrate this date
    Merry Christmas to you as well :)
  • argent77argent77 Member Posts: 3,478
    Btw, 'PK\x03\x04' sounds more like the signature of a zip archive. Are you certain this is the content of your BIF files?
Sign In or Register to comment.