No description
Find a file
2026-05-04 19:25:08 +02:00
.cargo fix(core): use range contains in eslify test, add cargo lint alias 2026-05-03 13:29:30 +02:00
.github ci: flatten ZIP layout for release artifacts 2026-05-04 17:03:55 +02:00
crates bump version to 0.3.1 2026-05-04 13:36:50 +02:00
docs docs: revise README and fix accuracy issues in adoc pages 2026-05-04 14:21:17 +02:00
tests bump version to 0.3.1 2026-05-04 13:36:50 +02:00
.gitattributes chore: initial commit — bethkit 0.1.0 2026-04-29 16:00:34 +02:00
.gitignore fix(ffi,core): harden FFI ownership and cache indexing 2026-05-04 13:35:30 +02:00
bethkit.code-workspace chore: initial commit — bethkit 0.1.0 2026-04-29 16:00:34 +02:00
Cargo.lock bump version to 0.3.1 2026-05-04 13:36:50 +02:00
Cargo.toml chore: initial commit — bethkit 0.1.0 2026-04-29 16:00:34 +02:00
cbindgen.toml fix(ffi,core): harden FFI ownership and cache indexing 2026-05-04 13:35:30 +02:00
LICENSE chore: initial commit — bethkit 0.1.0 2026-04-29 16:00:34 +02:00
README.md docs: mark Python bindings as released, link to bethkit.py repo 2026-05-04 19:25:08 +02:00
rustfmt.toml chore: initial commit — bethkit 0.1.0 2026-04-29 16:00:34 +02:00

bethkit

Build License Rust Version

⚠️ Beta — APIs may change before the first stable release.

A fast, zero-copy Rust library for reading and writing Bethesda game plugin and archive files. Callable from any language via a stable C ABI (bethkit-ffi).

What it does

  • Zero-copy plugin parsing — plugins are memory-mapped; records borrow bytes directly from the mapping without extra allocations
  • Record schemaSchemaRegistry::sse() covers all 126 SSE record types; SchemaRegistry::fo4() covers all 137 FO4 types. RecordView decodes subrecords into typed FieldValue variants: integers, floats, FormIDs, enums with resolved names, bit-flags, structs, and arrays. All schema data is &'static — zero heap allocation at runtime. Placement records (REFR, ACHR) are not schema-covered; complex multi-variant fields fall back to a raw byte slice.
  • BSA / BA2 archives — read and extract all major formats (BSA TES3/TES4/FO3/SSE, BA2 GNRL/DX10); write new archives with parallel compression
  • Streaming record replacePluginPatcher rewrites arbitrary records in-place; cost is O(edits), not O(plugin size)
  • Writer — build new plugins from scratch; eslify existing plugins; set the LOCALIZED flag
  • Localized strings — read, edit, and write .STRINGS / .DLSTRINGS / .ILSTRINGS files; apply translation patches without touching the plugin binary
  • Load-order utilitiesLoadOrder, GlobalFormId, PluginCache for winning-override lookups and EditorID search across multiple plugins
  • C ABIbethkit-ffi exposes ~110 extern "C" functions with a pre-generated bethkit.h included in the repository

Crates

  • bethkit-io — memory-mapped I/O, SliceCursor, zlib/LZ4 decompression
  • bethkit-core — ESP/ESL/ESM parser, writer, patcher, string tables, record schema
  • bethkit-bsa — BSA and BA2 archive reader and writer
  • bethkit-ffi — C ABI wrapper and bethkit.h header

Supported games

The parser, writer, and patcher work for all TES4-era games. The current focus is completing full schema coverage for Skyrim SE (126 types) and Fallout 4 (137 types). Schemas for other games (Oblivion, Fallout 3/NV, Starfield, Morrowind) are planned for later milestones.

Documentation

Compared to alternatives

bethkit sse-plugin-interface xEdit Mutagen
Language Rust + C ABI Python Delphi C#
License Apache-2.0 MIT MPL 2.0 GPL-3.0
Embeddable library GUI/CLI
Schema-typed record access runtime full compile-time
BSA / BA2 write read only
Streaming record replace
Conflict detection
C ABI for cross-language use

bethkit's niche is a fast, embeddable, language-agnostic library for direct binary access. xEdit is the authoritative reference tool with full conflict detection, a GUI, and schema definitions for every field across every game. Mutagen offers compile-time-typed record schemas for C# patcher authors, with the Synthesis framework on top; its GPL-3.0 licence restricts embedding in proprietary tools. sse-plugin-interface is minimal by design — purpose-built for SSE-Auto-Translator.

Status

Milestone Status
Parser + writer + tests (SSE)
String tables
Streaming rewrite (PluginPatcher)
BSA / BA2 reader + writer
PluginCache (winning override, EditorID lookup)
Record schema — SSE (126 types registered, deep coverage WIP) ⚠️ WIP
Record schema — FO4 (137 types registered, deep coverage WIP) ⚠️ WIP
C ABI (bethkit-ffi)
Python bindings — bethkit.py
Record schema — other games 🗓️ Planned

License

Apache-2.0