I present to the Fallout 3 community version 1.0 of libfos, a library for reading and writing ESP and ESM files from Fallout 3. (support for save files is next on the todo list)
It can be downloaded from http://cncmods.net/files/libfos.zip
It has been tested (and shown to work) on the fallout3.esm and DLC esm files from the Steam Fallout 3 GOTY edition as well as a bunch of mods I have in my Fallout 3 folder.
It is significantly more comprehensive and accurate than the info at https://github.com/WrinklyNinja/fopdoc/tree/master/Fallout3or the fo3edit source code or the Wyre Flash source code. (for example it contains a basically complete decoding of the ImageSpaceModifier data which has previously never been decoded to name one example of the amount of work that has gone into this library)
Work involved hours of deep level reverse engineering of the GECK and writing hundreds of lines of code.
It is intended to be something people who want to manipulate fallout 3 data files can use as a base and also something to completly document the format of the fallout 3 data files.
The following pieces of data are currently unknown or have yet to be figured out: (although they ARE correctly read and parsed and written out again)
the INAM subrecord in the WTHR record.
one unknown field in the DNAM subrecord in the WEAP record.
a few unknown fields in the DATA subrecord in the WATR record.
one unknown field in the DATA subrecord of the RGDL record.
the FGGS, FGGA, FGTS, and SNAM subrecords in the RACE record.
one unknown field in the PTDT and PTD2 subrecords in the PACK record.
one unknown field in the PKW3 subrecord in the PACK record.
2 unknown fields in the PKDD subrecord in the PACK record.
the FGGS, FGGA, FGTS, and SNAM subrecords in the NPC_ record.
the NAM0, NAM1, NAM2, NAM3, NAM4, NAM5, NAM6, NAM7, NAM8 and NAM9 subrecords from the MESG record.
a few fields in the DNAM subrecord in the IMGS record.
certain data in the texture hash information associated with the model data.
one unknown field in the SLSD subrecord of various records that contain scripts.
one unknown field in the SCHR subrecord of various records that contain scripts.
one unknown field in the XNDP subrecord of CELL/REFR/ACHR/ACRE/PMIS/PGRE/PBEA/PFLA records.
2 unknown fields in the XLCK subrecord of CELL/REFR/ACHR/ACRE/PMIS/PGRE/PBEA/PFLA records.
the XLOD, XCET and XCMT subrecords of CELL/REFR/ACHR/ACRE/PMIS/PGRE/PBEA/PFLA records.
one unknown field in the TRDT subrecord of DIAL records.
one unknown field in the DNAM subrecord of ADDN records.
And before you ask, no this does not support Fallout New Vegas since I dont own that game. The way to get me to add New Vegas support is to buy/gift me a copy of Fallout New Vegas Ultimate Edition on Steam
Please let me know what you think of my code and let me know if I should continue working on it (i.e. save file support etc). Any questions about the functioning of the code, how it works etc, post them here and I will do my best to explain things.