How macabeus/urnadecomp works
UrnaDecomp reconstructs the TSE voting simulator’s VOTA C++ and verifies that a rebuild matches the published WebAssembly module byte for byte. The principal workflow uses the asmlift-wasm toolkit to inspect target functions, produce and rank compilable C++ candidates, and verify matches through the splat build; the web playground exposes function inspection and match-progress views. The tree and README support the broad workflow, while some tool and application internals were not sampled, so uncertain connections are omitted.
Main entry points: vota_web_wasm.js Target module · App.tsx Web app shell · Playground.tsx Function playground · parse.ts Module parser
Components 27
Web views
- Web app shell
asmlift-wasm/playground/src/App.tsx - Function playground
asmlift-wasm/playground/src/pages/playground/Playground.tsx - Progress meter
asmlift-wasm/playground/src/pages/progress/Progress.tsx - Urna simulator view
asmlift-wasm/playground/src/pages/urnaemu/UrnaEmu.tsx - URL state
asmlift-wasm/playground/src/shared/utils/url-state.ts
Wasm analysis
- Module parser
asmlift-wasm/src/parse.ts - LEB decoder
asmlift-wasm/src/leb.ts - Function disassembler
asmlift-wasm/src/disasm.ts - Function normalizer
asmlift-wasm/src/normalize.ts - C++ lifter
asmlift-wasm/src/lift.ts - Candidate ranking
asmlift-wasm/src/rank.ts - Function readout
asmlift-wasm/src/readout.ts
Match verification
- Function census
asmlift-wasm/src/census.ts - Function ledger
asmlift-wasm/src/ledger.ts - Symbol mapping
asmlift-wasm/src/splat-symbols.ts - Splat build
asmlift-wasm/src/splat.ts - Body remapping
asmlift-wasm/src/splat-remap.ts - Piece substitution
asmlift-wasm/src/splat-sub.ts - Match review
asmlift-wasm/src/splat-review.ts
VOTA reconstruction
- Reconstructed C++
src/uenux2 - EcoUrna library
src/ecourna - ASN.1 runtime
src/asn1/asn1.h - Election schemas
src/asn1/modules/ModuloTiposEleitorais.h - Application entry
src/app/main.cpp
Other components
- Engineer
- Target module
target/vota_web_wasm.js - Verified module
Connections 29
- Engineer → Web app shell: opens
asmlift-wasm/playground/src/App.tsx - Web app shell → Function playground: routes to
asmlift-wasm/playground/src/App.tsx - Web app shell → Progress meter: routes to
asmlift-wasm/playground/src/App.tsx - Web app shell → Urna simulator view: routes to
asmlift-wasm/playground/src/App.tsx - Function playground → URL state: reads state
asmlift-wasm/playground/src/pages/playground/Playground.tsx - Function playground → Target module: inspects functions
- Progress meter → Function ledger: shows matches
README.md - Target module → Module parser: parsed by
README.md - Module parser → LEB decoder: decodes integers
asmlift-wasm/src/parse.ts - Module parser → Function disassembler: supplies module
asmlift-wasm/src/lift.ts - Function disassembler → Function normalizer: normalizes instructions
asmlift-wasm/src/normalize.ts - Function disassembler → C++ lifter: lifts functions
asmlift-wasm/src/lift.ts - C++ lifter → Candidate ranking: ranks candidates
README.md - Target module → Function readout: read by function
README.md - Target module → Function census: censused
README.md - Target module → Function ledger: records attribution
README.md - Target module → Symbol mapping: mapped against
asmlift-wasm/src/splat-symbols.ts - Symbol mapping → Body remapping: provides mappings
asmlift-wasm/src/splat-remap.ts - Target module → Splat build: split for matching
README.md - Splat build → Piece substitution: applies matches
asmlift-wasm/src/splat-review.ts - Piece substitution → Match review: supplies piece bodies
asmlift-wasm/src/splat-review.ts - Body remapping → Match review: provides remapped bytes
asmlift-wasm/src/splat-review.ts - Match review → Verified module: checks hash
asmlift-wasm/src/splat-review.ts - Reconstructed C++ → Application entry: linked into app
- EcoUrna library → Application entry: linked into app
- ASN.1 runtime → Election schemas: supports schema types
src/asn1/modules/ModuloTiposEleitorais.h - Reconstructed C++ → Verified module: rebuilt byte for byte
README.md - EcoUrna library → Verified module: rebuilt byte for byte
README.md - Application entry → Verified module: included in rebuild
src/app/main.cpp