Subject Might be off topic - about on disk structure
Author cprund
I'm working on a little something to grab data out of a corrupted
database using "direct access" to the database (ie: no firebird
engine, just me and my bytes).

I've ran into a problem. When I encounter a fragmented record (a
record with the "incomplete" flag), the value I get out of the
rhdf_f_page field makes no sense. It looks like garbidge!

Here's a hex-dump of a "incomplete" record.

1F 01 00 00 00 00 00 00 00 00 08 00 01 16 14 FE
6E 16 00 00 22 00 16 10 EE 00 00 46 4B 5F 43 58
5F 44 41 54 45 5F 42 55 47 45 54 5F 32 F3 20 0D
43 58 5F 44 41 54 45 5F 42 55 47 45 54 EE 20 01
03 F3 00 01 01 FB 00 06 50 4B 5F 41 43 54

And here's how I'm trying to make sense of it:

1F 01 00 00 <- rhdf_transaction
00 00 00 00 <- rhdf_b_page
00 00 <- rhdf_b_line
08 00 <- rhdf_flags (08 == "incomplete")
01 <- rhdf_format
16 14 FE 6E <- rhdf_f_page / next gragment page
16 00 <- rhdf_f_line / next fragment line

All the "rdf's" are out of ods.h

There are a few issues here:
(1) Does this belong to the "devel" list? With OS projects I never
know where to draw the line...
(2) This is from a working database. Fresh out of a "restore".
(3) Everything up to "rhdf_f_page" makes perfect sense.
(4) The value at rhdf_f_page makes absolutely no sense to me! This is
a small database, just 8800 pages...

Thanks, and please excuse me if this doesn't belong here.