Oliver Hamlet daf229c1e9 Implement PE executable version parsing
Using only the standard library (i.e. without pelite).

This commit keeps the pelite dependency and uses it to check that the
new parser gives the same result. The next commit will remove pelite.

I've verified that both parsers give the same result for the following
files that are referenced in the masterlists' version conditions:

Starfield.exe
sfse_1_15_222.dll
SkyrimSE.exe
skse64_loader.exe
skseVR_loader.exe
ENBHelperSE.dll
d3d11.dll
EngineFixes.dll
QuickLootEE.dll
FalloutNV.exe
nvse_1_4.dll
nvse_1_4ng.dll
nvse_1_1.dll
Fallout3.exe
fose_1_7.dll
fose_1_7ng.dll
nvac.dll
Fallout4.exe
f4se_loader.exe
f4sevr_loader.exe
place.dll
obse_1_2_416.dll
TESV.exe
skse_loader.exe

The only referenced files that I couldn't test against were SkyrimVR.exe
and Fallout4VR.exe, because I don't own those games.
2025-12-03 18:39:27 +00:00
2025-08-01 18:07:36 +01:00
2025-08-01 18:07:36 +01:00
2025-12-03 18:11:53 +00:00
2024-04-30 22:45:59 +01:00
2025-10-14 03:01:37 +00:00
2018-10-05 20:21:14 +01:00

loot-condition-interpreter

CI Coverage Status

A library for parsing and evaluating LOOT's metadata condition strings. It provides:

  • Support for metadata syntax v0.26 condition strings.
  • Condition string parsing without evaluation, for checking syntax.
  • Evaluation of parsed condition strings.
  • Efficient and safe concurrent condition evaluation thanks to Rust's safety guarantees.
  • Caching of individual function evaluation results and calculated CRCs.
  • Executable version parsing without any external runtime dependencies.
  • Lots of tests, and benchmarks.
  • A C FFI library that wraps the Rust library.

Build

Make sure you have Rust installed.

To build the Rust and C FFI libraries, run:

cargo build --release --package loot-condition-interpreter-ffi

Use cbindgen to generate a C++ header file:

cbindgen ffi/ -o ffi/include/loot_condition_interpreter.h

Tests & Benchmarks

The tests and benchmarks need the testing-plugins and the LOOT API v0.13.8 Windows archives to be extracted and present in the repo root. See the GitHub Actions CI workflow for examples on what should be extracted where.

To run the Rust tests:

cargo test --workspace

To run the benchmarks:

cargo bench

There are also C++ tests for the FFI library, they require a C++ toolchain and CMake to be installed. To run the C++ tests:

mkdir ffi/build
cd ffi/build
cmake ..
cmake --build .
ctest
S
Description
No description provided
Readme MIT
833 KiB
Languages
Rust 97.2%
C++ 2.5%
CMake 0.3%