GRAF:3D Sex Villa BXP: Difference between revisions

From XentaxWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
PLEASE READ THE http://wiki.xentax.com/index.php/Talk:DISCUSSION
Fileformat is (C)thriXXX. thriXXX game licenses strictly forbid reverse engineering.
 
{{GRAFTemplate1|
file_extension=<font color="blue">B<font color="blue">X<font color="blue">P</font></font></font>|
format_type=Archive|
endian_order=Little Endian|
date_posted=01:08, 4 Jan 2006|
format_specifications=<font color="blue"> ''' // ARCHIVE HEADER ''' </font> <br>
: char {8}&nbsp;&nbsp;&nbsp;&nbsp; - Header <font color="purple">("BXP" + <font color="purple">(byte)</font>2 + "ARCH")</font> <br>
: uint64 {8}&nbsp;&nbsp; - Archive Length <font color="darkgreen">[+32]</font> <br>
: uint64 {8}&nbsp;&nbsp; - Padding <font color="purple">(88,39,255,135,206,225,196,1)</font> <br>
: uint64 {8}&nbsp;&nbsp; - null <br>
<br>
<font color="blue"> ''' // ARCHIVE INDEX ''' </font> <br>
: char {8}&nbsp;&nbsp;&nbsp;&nbsp; - Header <font color="purple">("BXP" + <font color="purple">(byte)</font>2 + "INDX")</font> <br>
: uint64 {8}&nbsp;&nbsp; - <font color="red"> '' Unknown '' </font> <br>
: uint64 {8}&nbsp;&nbsp; - Padding <font color="purple">(88,39,255,135,206,225,196,1)</font> <br>
: uint64 {8}&nbsp;&nbsp; - null <br>
: byte {16}&nbsp;&nbsp;&nbsp; - <font color="red"> '' CRC? '' </font> <br>
: byte {16}&nbsp;&nbsp;&nbsp; - <font color="red"> '' CRC? <font color="purple">(same as above field)</font> '' </font> <br>
<br>
<font color="blue"> ''' // FOLDER TREE ''' </font> <br>
: char {8}&nbsp;&nbsp;&nbsp;&nbsp; - Header <font color="purple">("BXP" + <font color="purple">(byte)</font>2 + "TREE")</font> <br>
: uint64 {8}&nbsp;&nbsp; - Offset to the "// FILE DATA" <font color="darkgreen">[+128]</font> <font color="purple">(ie relative to "// DIRECTORIES")</font> <br>
: uint64 {8}&nbsp;&nbsp; - Padding <font color="purple">(88,39,255,135,206,225,196,1)</font> <br>
: uint64 {8}&nbsp;&nbsp; - null <br>
<br>
<font color="blue"> ''' // DIRECTORIES ''' </font> <br>
: <font color="blue"> ''' // for each directory ''' </font> <br>
:: char {8}&nbsp;&nbsp;&nbsp;&nbsp; - Header <font color="purple">("BXP" + <font color="purple">(byte)</font>2 + "SDIR")</font> <br>
:: uint64 {8}&nbsp;&nbsp; - <font color="red"> '' Unknown Length/Offset '' </font> <br>
:: byte {16}&nbsp;&nbsp;&nbsp; - null <br>
:: uint32 {4}&nbsp;&nbsp; - Number Of Sub-Directories in this directory <br>
:: uint32 {4}&nbsp;&nbsp; - Number Of Files in this directory <br>
:: uint64 {8}&nbsp;&nbsp; - Length Of Filename Directory Component <font color="purple">(length of subDirName+null + fileNames+nulls)</font> <br>
:: byte {16}&nbsp;&nbsp;&nbsp; - null <br>
<br>
:: <font color="blue"> ''' // for each sub-directory in this directory ''' </font> <br>
::: uint32 {4}&nbsp;&nbsp; - null <br>
::: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Relative Offset To This Directory? <font color="purple">(32)</font> <font color="purple">(relative to the start of this subDirEntry)</font> '' </font> <br>
::: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Hash? '' </font> <br>
::: char {X}&nbsp;&nbsp;&nbsp;&nbsp; - Sub-Directory Name <br>
::: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - null Sub-Directory Name Terminator <br>
::: byte {X}&nbsp;&nbsp;&nbsp;&nbsp; - null Padding to a multiple of 32 bytes <br>
<br>
:: <font color="blue"> ''' // for each file in this directory ''' </font> <br>
::: uint64 {8}&nbsp;&nbsp; - Filename Offset <font color="purple">(relative to the start of the filename directory)</font> <br>
::: uint64 {8}&nbsp;&nbsp; - null <br>
::: byte {16}&nbsp;&nbsp;&nbsp; - <font color="red"> '' CRC? '' </font> <br>
::: uint32 {4}&nbsp;&nbsp; - null <br>
::: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Unknown <font color="purple">(1)</font> '' </font> <br>
::: uint64 {8}&nbsp;&nbsp; - null <br>
::: uint64 {8}&nbsp;&nbsp; - <font color="red"> '' File Length <font color="purple">(not including the file header fields?)</font> '' </font> <br>
::: uint64 {8}&nbsp;&nbsp; - File Offset <font color="purple">(relative to the start of the file data)</font> <br>
<br>
:: <font color="blue"> ''' // repeat for each sub-directory (repeat from "// for each directory") ''' </font> <br>
<br>
: byte {32}&nbsp;&nbsp;&nbsp; - <font color="red"> '' CRC? '' </font> <br>
<br>
<font color="blue"> ''' // FILENAME DIRECTORY ''' </font> <br>
: <font color="blue"> ''' // for each file ''' </font> <br>
:: char {X}&nbsp;&nbsp;&nbsp;&nbsp; - Filename <br>
:: byte {1}&nbsp;&nbsp;&nbsp;&nbsp; - null Filename Terminator <br>
<br>
: byte {X}&nbsp;&nbsp;&nbsp;&nbsp; - null Padding to a multiple of 32 bytes <br>
<br>
<font color="blue"> ''' // FILE DATA ''' </font> <br>
: char {8}&nbsp;&nbsp;&nbsp;&nbsp; - Header <font color="purple">("BXP" + <font color="purple">(byte)</font>2 + "DATA")</font> <br>
: uint64 {8}&nbsp;&nbsp; - Total Length Of File Data <font color="purple">(length of everything in "// for each file")</font> <br>
: uint64 {8}&nbsp;&nbsp; - Padding <font color="purple">(88,39,255,135,206,225,196,1)</font> <br>
: uint64 {8}&nbsp;&nbsp; - null <br>
<br>
: <font color="blue"> ''' // for each file ''' </font> <br>
:: char {8}&nbsp;&nbsp;&nbsp;&nbsp; - Header <font color="purple">("BXP" + <font color="purple">(byte)</font>2 + "FILE")</font> <br>
:: uint64 {8}&nbsp;&nbsp; - File Length <font color="purple">(length of "X - File Data" only)</font> <font color="darkgreen">[+30]</font> <br>
:: uint64 {8}&nbsp;&nbsp; - <font color="red"> '' CRC? '' </font> <br>
:: uint32 {4}&nbsp;&nbsp; - null <br>
:: uint32 {4}&nbsp;&nbsp; - <font color="red"> '' Unknown <font color="purple">(1)</font> '' </font> <br>
:: byte {X}&nbsp;&nbsp;&nbsp;&nbsp; - File Data <br>
:: byte {X}&nbsp;&nbsp;&nbsp;&nbsp; - null Padding to a multiple of 32 bytes|
notes=<i>These were copied from the template, I'm not sure if they're on the right page.</i>
 
'''Notes by Gregory''':
 
1.
In the version 24, the file names are encrypted as XOR 0xBE.
 
2.
"BXP" + (byte) in all headers: In the version 24, the (byte)=3. 
 
3.
// ARCHIVE INDEX
    char {8}    - Header ("BXP" + (byte)2 + "INDX")
    uint64 {8}  - Unknown  '''<-----  this shuld be relative offset to the first "BXP.FILE"'''
I have used folloxing piece of C++ code:
  ArchiveOffset = 0x00;
  IndexOffset = 0x20;
  TreeOffset = 0x60;
  DirOffset = 0x80;
  DataOffset = DirOffset + (__int64*) &buffer[TreeOffset + 8];
  FileOffset = DirOffset + (__int64*) &buffer[IndexOffset + 8];
 
4.
There are some directories containing both files and sub-directories. In such case, the files are listed prior to the sub-directories.
I guess that the structure of directory is:
  {
    char {8}    - Header ("BXP" + (byte)2 + "SDIR")
    uint64 {8}  - Unknown Length/Offset
    byte {16}    - null
    uint32 {4}  - Number Of Sub-Directories in this directory
    uint32 {4}  - Number Of Files in this directory
    uint64 {8}  - Length Of Filename Directory Component (length of subDirName+null + fileNames+nulls)
    byte {16}    - null
    for (each file)
    {
      uint64 {8}  - Filename Offset (relative to the start of the filename directory)
      uint64 {8}  - null
      byte {16}    - CRC?
      uint32 {4}  - null
      uint32 {4}  - Unknown (1)    // or (0) - a switch?
      uint64 {8}  - null
      uint64 {8}  - File Length (not including the file header fields?)
      uint64 {8}  - File Offset (relative to the start of the file data)
    }
    for (each sub-directory)
    {
      uint32 {4}  - null  // Filename Offset (relative to the start of the filename directory)
      uint32 {4}  - Relative Offset To This Directory? (32) (relative to the start of this subDirEntry)
    }
    for (each entry)            // entry is file or sub-directory
    {
      uint32 {4}  -  Hash? 
    }
    for (each entry)
    {
      char {X}    - Filename                        // XOR 0xBE      in version 24
      byte {1}    - null Filename Terminator        // 0xBE          in version 24
    }
  }
 
5. I have successfuly extracted all files from the archive. Sound (*.ogg) files play well, however some other files (scripts) seems to be encrypted. Further I am wholly confused with CRCs, HASHs and Paddings for now, so I can not build an modified archive.|
bms_script=Not written yet|
programs=* [[Game Extractor|Game Extractor]]|
documentation=None|
}}
 
[[Category:No BMS]] [[Category:Almost Done]] [[Category:Archive]] [[Category:PC]]

Revision as of 09:16, 1 August 2006

Fileformat is (C)thriXXX. thriXXX game licenses strictly forbid reverse engineering.