GRAF:3D Sex Villa BXP: Difference between revisions
imported>WATTO No edit summary |
imported>Ikskoks (→Games) |
||
| (52 intermediate revisions by 8 users not shown) | |||
| Line 1: | Line 1: | ||
{{GRAFPageHeader}} | |||
== BXP == | |||
{{GRAFPageMisc|Archive|Little-endian}} | |||
=== Format Specifications === | |||
=== Format Specifications === | {{GRAFPageFormat|1=<nowiki/> | ||
<font color="blue"> ''' // ARCHIVE HEADER ''' </font> <br> | <font color="blue"> ''' // ARCHIVE HEADER ''' </font> <br> | ||
: char {8} - Header <font color="purple">("BXP" + <font color="purple">(byte)</font>2 + "ARCH")</font> <br> | : char {8} - Header <font color="purple">("BXP" + <font color="purple">(byte)</font>2 + "ARCH")</font> <br> | ||
| Line 80: | Line 78: | ||
:: uint32 {4} - <font color="red"> '' Unknown <font color="purple">(1)</font> '' </font> <br> | :: uint32 {4} - <font color="red"> '' Unknown <font color="purple">(1)</font> '' </font> <br> | ||
:: byte {X} - File Data <br> | :: byte {X} - File Data <br> | ||
:: byte {X} - null Padding to a multiple of 32 bytes < | :: byte {X} - null Padding to a multiple of 32 bytes | ||
< | }} | ||
=== Notes and Comments === | |||
:''This was [http://wiki.xentax.com/index.php?title=Template:GRAFTemplate1&diff=5459&oldid=3996 originally] [http://wiki.xentax.com/index.php?title=Template:GRAFTemplate1&diff=5482&oldid=5462 posted] on [[Template:GRAFTemplate1]] by [[User:85.92.55.33|85.92.55.33]] ([[Special:Contributions/85.92.55.33|contribs]]); I don't know for sure if this is the page they meant to post to (though I'm pretty sure it is) or if the information is accurate.'' | |||
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 // see 6. | |||
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. | |||
6. "uint32 {4} - Unknown (1)" is a switch: 0="file is not compressed" 1="file is compressed"; compression method is zlib (*.gz). The same switch is in the "BXP.FILE" section. | |||
I suguest that to modify the structure of "BXP.SDIR" to: | |||
{ | |||
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} - A switch indicating if the file is compressed. 0=no, 1=yes //compression method: zlib (*.gz) | |||
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 | |||
} | |||
} | |||
7. First 32 bytes of each file if "File Data" is a header of checksum, which is not necessary for file extraction. | |||
{ | |||
// FILE DATA | |||
char {8} - Header ("BXP" + (byte)2 + "DATA") | |||
uint64 {8} - Total Length Of File Data (length of everything in "// for each file") | |||
uint64 {8} - Padding (88,39,255,135,206,225,196,1) | |||
uint64 {8} - null | |||
for (each file) | |||
{ | |||
char {8} - Header ("BXP" + (byte)2 + "FILE") | |||
uint64 {8} - File Length (length of "X - File Data" only) [+30] | |||
uint64 {8} - CRC? | |||
uint32 {4} - null | |||
uint32 {4} - A switch indicating if the file is compressed. 0=no, 1=yes //compression method: zlib (*.gz) | |||
byte (16) - A header or check-sum? | |||
byte (16) - For uncompressed file the same as previous byte (16), for copressed different. Maybe check-sum of decompressed file? | |||
byte {X} - File Data | |||
byte {X} - null Padding to a multiple of 32 bytes | |||
} | |||
} | |||
*** by Gregory | |||
=== MultiEx BMS Script === | |||
Not written yet | |||
=== Supported by Programs === | |||
* [[Game Extractor|Game Extractor]] | |||
=== Documentation === | |||
None | |||
=== Games === | |||
* 3D Sex Villa *.bxp | |||
<br><br> | |||
{{DEFAULTSORT:{{PAGENAME}}}} | |||
[[Category:No BMS]] | |||
[[Category:Complete Almost Done]] | |||
[[Category:PC formats]] | |||
[[Category:XOR encryption]] | |||
[[Category:File Format]] | |||
Latest revision as of 14:20, 4 April 2021
Back to index | Edit this page
BXP
- Format type: Archive
- Endianness: Little-endian
Format Specifications
// ARCHIVE HEADER
- char {8} - Header ("BXP" + (byte)2 + "ARCH")
- uint64 {8} - Archive Length [+32]
- uint64 {8} - Padding (88,39,255,135,206,225,196,1)
- uint64 {8} - null
// ARCHIVE INDEX
- char {8} - Header ("BXP" + (byte)2 + "INDX")
- uint64 {8} - Unknown
- uint64 {8} - Padding (88,39,255,135,206,225,196,1)
- uint64 {8} - null
- byte {16} - CRC?
- byte {16} - CRC? (same as above field)
// FOLDER TREE
- char {8} - Header ("BXP" + (byte)2 + "TREE")
- uint64 {8} - Offset to the "// FILE DATA" [+128] (ie relative to "// DIRECTORIES")
- uint64 {8} - Padding (88,39,255,135,206,225,196,1)
- uint64 {8} - null
// DIRECTORIES
- // for each directory
- 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
- char {8} - Header ("BXP" + (byte)2 + "SDIR")
- // for each sub-directory in this directory
- uint32 {4} - null
- uint32 {4} - Relative Offset To This Directory? (32) (relative to the start of this subDirEntry)
- uint32 {4} - Hash?
- char {X} - Sub-Directory Name
- byte {1} - null Sub-Directory Name Terminator
- byte {X} - null Padding to a multiple of 32 bytes
- uint32 {4} - null
- // for each sub-directory in this directory
- // for each file in this directory
- 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)
- 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)
- uint64 {8} - Filename Offset (relative to the start of the filename directory)
- // for each file in this directory
- // repeat for each sub-directory (repeat from "// for each directory")
- // repeat for each sub-directory (repeat from "// for each directory")
- byte {32} - CRC?
// FILENAME DIRECTORY
- // for each file
- char {X} - Filename
- byte {1} - null Filename Terminator
- char {X} - Filename
- byte {X} - null Padding to a multiple of 32 bytes
// FILE DATA
- char {8} - Header ("BXP" + (byte)2 + "DATA")
- uint64 {8} - Total Length Of File Data (length of everything in "// for each file")
- uint64 {8} - Padding (88,39,255,135,206,225,196,1)
- uint64 {8} - null
- // for each file
- char {8} - Header ("BXP" + (byte)2 + "FILE")
- uint64 {8} - File Length (length of "X - File Data" only) [+30]
- uint64 {8} - CRC?
- uint32 {4} - null
- uint32 {4} - Unknown (1)
- byte {X} - File Data
- byte {X} - null Padding to a multiple of 32 bytes
- char {8} - Header ("BXP" + (byte)2 + "FILE")
Notes and Comments
- This was originally posted on Template:GRAFTemplate1 by 85.92.55.33 (contribs); I don't know for sure if this is the page they meant to post to (though I'm pretty sure it is) or if the information is accurate.
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 // see 6.
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.
6. "uint32 {4} - Unknown (1)" is a switch: 0="file is not compressed" 1="file is compressed"; compression method is zlib (*.gz). The same switch is in the "BXP.FILE" section. I suguest that to modify the structure of "BXP.SDIR" to:
{
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} - A switch indicating if the file is compressed. 0=no, 1=yes //compression method: zlib (*.gz)
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
}
}
7. First 32 bytes of each file if "File Data" is a header of checksum, which is not necessary for file extraction.
{
// FILE DATA
char {8} - Header ("BXP" + (byte)2 + "DATA")
uint64 {8} - Total Length Of File Data (length of everything in "// for each file")
uint64 {8} - Padding (88,39,255,135,206,225,196,1)
uint64 {8} - null
for (each file)
{
char {8} - Header ("BXP" + (byte)2 + "FILE")
uint64 {8} - File Length (length of "X - File Data" only) [+30]
uint64 {8} - CRC?
uint32 {4} - null
uint32 {4} - A switch indicating if the file is compressed. 0=no, 1=yes //compression method: zlib (*.gz)
byte (16) - A header or check-sum?
byte (16) - For uncompressed file the same as previous byte (16), for copressed different. Maybe check-sum of decompressed file?
byte {X} - File Data
byte {X} - null Padding to a multiple of 32 bytes
}
}
- by Gregory
MultiEx BMS Script
Not written yet
Supported by Programs
Documentation
None
Games
- 3D Sex Villa *.bxp