mbbsemu:development:btrieve_file_format
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
mbbsemu:development:btrieve_file_format [2020/11/14 21:06] – created tuday | mbbsemu:development:btrieve_file_format [2023/10/06 23:41] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 3: | Line 3: | ||
MajorBBS/ | MajorBBS/ | ||
- | In this article we'll be discussing the Btrieve File Format as reverse engineered in the course of developing MBBSEmu. | + | In this article we'll be discussing the Btrieve File Format as reverse engineered in the course of developing MBBSEmu. There is also an excellent book titled [Btrieve Complete, by Jim Kyle](https:// |
# Assumptions | # Assumptions | ||
* MajorBBS/ | * MajorBBS/ | ||
- | * MajorBBS/ | ||
* MajorBBS/ | * MajorBBS/ | ||
Line 53: | Line 52: | ||
----------|------|------------| | ----------|------|------------| | ||
Duplicates | `1` | Allow duplicate key values | Duplicates | `1` | Allow duplicate key values | ||
- | Modifiable | `1 << 1` | Value can be modified | + | Modifiable | `1 << 1` | Key Value can be modified |
- | Old Style Binary | ` 1 << 2 ` | Unknown | + | Old Style Binary | `1 << 2` | Used when `UseExtendedDataType` is not set. If true, binary blob, otherwise string. |
- | Null0 | `1 << 3` | Unknown | + | NullAllSegments |
SegmentedKey | `1 << 4` | If the given key has any Segments | SegmentedKey | `1 << 4` | If the given key has any Segments | ||
- | NumberedACS | ` 1 << 5` | Unknown | + | NumberedACS | ` 1 << 5` | Whether the string type uses the ACS table |
DescendingKeySegment | ` 1 << 6` | Key is stored in descending Sort Order | DescendingKeySegment | ` 1 << 6` | Key is stored in descending Sort Order | ||
- | SupplementalKey | + | RepeatingDuplicatesKey |
+ | UseExtendedDataType | `1 << 8` | Whether the key uses the key data types listed below, otherwise type is defined by `Old Style Binary`. | ||
+ | NullAnySegment | `1 << 9` | Whether the key supports null values. Any segmented key with this value set indicates the entire key could be null. | ||
### Key Data Types | ### Key Data Types | ||
Line 94: | Line 95: | ||
Page Type | Definition | | Page Type | Definition | | ||
----------|------------| | ----------|------------| | ||
+ | FCR | Contains metadata about the entire database | ||
+ | ACS Page | Contains the ACS table used by the database | ||
Key Page | Contains the absolute offset in the Btrieve file for the specified Key value | Key Page | Contains the absolute offset in the Btrieve file for the specified Key value | ||
- | Key Constraint Page | Unused by MBBSEmu | ||
Data Page | Contains record data | Data Page | Contains record data | ||
+ | Variable Record Data Page | Contains variable record data | ||
While enumerating through the pages, the best method we've been able to employ to identify Page types is the following: | While enumerating through the pages, the best method we've been able to employ to identify Page types is the following: | ||
Line 103: | Line 106: | ||
Page Type | How to Identify | | Page Type | How to Identify | | ||
----------|------------| | ----------|------------| | ||
+ | `FCR` | Always first page | ||
+ | `ACS Page` | Always second page if exists. Starts with 0x000001000000AC | ||
`Key Pages` | Value `0xFFFFFFFF` at offset `0x8` | `Key Pages` | Value `0xFFFFFFFF` at offset `0x8` | ||
- | `Key Constraint Pages` | Value `0xAC` at offset `0x6` | ||
`Data Pages` | Bit 7 set in the byte at offset `0x5` | `Data Pages` | Bit 7 set in the byte at offset `0x5` | ||
+ | `Variable Record Data Pages` | No identifying information. Referenced via pointers inside the `Data Pages` | ||
# Understanding How MajorBBS/ | # Understanding How MajorBBS/ | ||
Line 152: | Line 157: | ||
It would return the `Previous` record, which in our query would mean the user with the _second_ highest `userId` | It would return the `Previous` record, which in our query would mean the user with the _second_ highest `userId` | ||
</ | </ | ||
+ | n> |
mbbsemu/development/btrieve_file_format.1605387968.txt · Last modified: 2023/10/06 23:40 (external edit)