Skip to content
cdal-devPublic

About

Crimson Desert Address Library: versioned address database for mods, script extender and Lua runtime

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

CDAL: Crimson Desert Address Library

CDAL gives Crimson Desert mods a permanent number, an ID, for every place in CrimsonDesert.exe they need: functions, hook sites, globals, vtables and struct offsets. A mod asks for WorldSystem::sInstance and gets the right address for whatever game build is running, so mods keep working across game updates from one shared database update. On top of CDAL sit BSX, a plugin loader with game events, and BSX Lua, which runs Lua scripts as mods.

Status: 0.8.1 is the current release (CDAL 0.8.1 & CDAL Studio 0.8.1 Public Beta, BSX & BSX Lua 0.4.0 Public Alpha, Experimental default-off BSX Overlay). Browse the CDAL & BSX Hub for guides, Lua API docs, examples, game builds and enrolled mods, or join the CDAL Discord.

Development: CDAL 0.8.1 and BSX 0.4.0 on main. Release history is in CHANGELOG.md.

Browse the docs index, browse every ID in docs/reference/ids.md, or point an AI coding agent at AGENTS.md.

What is in this repository

Piece What it is State
CDAL Address library: header-only C++17 API, C ABI, and cdal.dll shared runtime (db/ database + signature fallback). Public Beta (0.8.1)
Hook manager Part of cdal.dll. Function hooks stack in priority chains; mid hooks and byte patches report conflicts (interop). Public Beta (hooks API 2)
Database db/: IDs, signatures and per-build values (builds list). Updated after each game patch
Tools cdal_tools (Python) and tools/ scripts for patch day, ID requests, site packs, bug reports and updates (reference). Released
BSX BlackSpace Extender (BSX.asi): loads BSX/plugins/*.dll, checks required IDs first and delivers game events. Public Alpha (0.4.0, plugin API 3)
BSX Lua BSX plugin (BSX.Lua.dll) running sandboxed Lua scripts, zero-code tweaks.json v5 packs and Visual Flow mods (game.vfx v2 is Experimental Test). Public Alpha (0.4.0, Lua API 1-8)
BSX Overlay Optional in-game F10 status window, Lua console and 2D/3D draw layer. Shipped in the BSX zip, off by default. Experimental, off by default
CDAL Studio Desktop app and cdal-studio CLI to port .asi mods, build BSX/Lua/Visual Flow mods, inspect live tables or enroll mods. Public Beta (0.8.1)

Guides

For players

Install CDAL once next to CrimsonDesert.exe, run CDAL\Update CDAL.cmd (or CDAL\Keep CDAL updated.cmd) after game patches, and use CDAL\Collect report.cmd if something breaks:

For mod authors and agents

Guides in other languages

English is the reference (TRANSLATING.md). Translated player and author guides:

Language Player Quickstart Game Updates Porting Guide Enroll CDAL Studio
Français QUICKSTART GAME_UPDATES PORTING_GUIDE ENROLL STUDIO
Deutsch QUICKSTART GAME_UPDATES PORTING_GUIDE ENROLL STUDIO
Español QUICKSTART GAME_UPDATES PORTING_GUIDE ENROLL STUDIO
简体中文 QUICKSTART GAME_UPDATES PORTING_GUIDE ENROLL STUDIO
日本語 QUICKSTART GAME_UPDATES PORTING_GUIDE ENROLL STUDIO
한국어 QUICKSTART GAME_UPDATES PORTING_GUIDE ENROLL STUDIO

Maintainers and project

MAINTAINING.md (patch day, CLI & tool reference, releases, CI) | STATUS_SITE.md | FORMAT.md | Pitfalls register | SECURITY.md | ROADMAP.md | CHANGELOG.md

Layout

include/cdal/      C++17 header-only API (cdal.hpp), C ABI (cdal.h), hooks, generated IDs
src/               shared runtime (cdal.dll), including the hook manager
examples/          sample plugins (hello_cdal, shared_hooks)
bsx/               BSX loader (BSX.asi), BSX Lua (bsx/lua/), BSX Overlay (bsx/overlay/), examples
studio/            CDAL Studio: core/ (Rust shared crate), cli/ (cdal-studio), app/ (Tauri 2 + Svelte 5)
tools/             patch-day, request, pack, diagnostics, updater and packaging scripts
python/cdal_tools  resolver, validator, compiler, request/pack/port-scan, audit, repair and site tools
db/                symbols/, builds/, candidates/, ids.lock.json, mods/ (enrolled), compat/ (Nexus scans)
tests/             C++, C and Python tests on a synthetic PE image
docs/              all guides sorted by reader (docs/README.md is the index)
AGENTS.md          instructions for AI coding agents
CONTRIBUTING.md    contributor guide and fork workflow

Building

cmake -S . -B build && cmake --build build && ctest --test-dir build

Needs Python 3 to generate the synthetic test image. The hook manager fetches SafetyHook 0.7.0 and Zydis at configure time and requires CMake 3.28 and C++23 std::expected (MSVC 2022, GCC 12+, or Clang 19+); pass -DCDAL_BUILD_HOOKS=OFF to build without it (cdal.hpp stays C++17 either way). -DCDAL_BUILD_BSX_LUA=ON adds BSX Lua and -DCDAL_BUILD_BSX_OVERLAY=ON adds BSX Overlay. Run Python tests with cd python && python -m pytest, and Studio tests with cargo test --workspace (STUDIO.md).

Contributing

Anyone can open bug reports, request IDs, enroll mods and send pull requests from a fork; the maintainer reviews, approves, merges and publishes releases. See CONTRIBUTING.md.

Credits

The design follows meh321's Address Library for SKSE and CommonLibSSE's REL::Relocation. The hook manager is built on cursey's SafetyHook, which uses Zydis and Zycore, and optional components embed LuaJIT, Dear ImGui, ReShade and FidelityFX SDK headers (THIRD_PARTY_NOTICES.md). Individual mod and signature credits are recorded in docs/reference/credits.md and in each entry under db/symbols/.

License

CDAL and BSX use CDAL and BSX Source-Available License 1.0 (not OSI open source). Source is available for inspection, private builds and contributions, and mods/plugins/scripts/compatible tools may use the SDK, adapted examples and unmodified official databases under their own licence, provided required notices are kept (What to ship). Modified builds, fork releases, repackaged distributions and bundling the runtime into another product require written permission. Third-party notices are in THIRD_PARTY_NOTICES.md.

About

Crimson Desert Address Library: versioned address database for mods, script extender and Lua runtime

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages