npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@emdzej/ncsx-inpax-cabi-provider

v0.6.0

Published

CABI/CDH bridge for the inpax IPO interpreter — implements the 80+ CDH* functions NCSEXPER's A_*.ipo dispatchers call (statically linked in NCSEXPER.EXE). Signatures from CABI.H, behaviour ghidra-verified per docs/assumptions.md.

Readme

@emdzej/ncsx-inpax-cabi-provider

The CABI/CDH bridge — implements the 80+ CDH* functions NCSEXPER's A_*.ipo dispatchers call. Lets the inpax IPO interpreter run BMW's own coding scripts unchanged.

In NCSEXPER.EXE these functions are statically linked C code that the IPO calls via the 0x0D CALLE opcode — they own the cabd-parameter store, the binbuf scratchpad, the slot table for C_S_LESEN / C_S_SCHREIBEN, the FA byte walker, and the EDIABAS dispatch surface. We re-implement them on top of an EdiabasLike instance so the IPO runs in the browser identically to how it runs under NCS Expert.

Signatures from CABI.H. Behaviour Ghidra-verified per docs/assumptions.md.

Usage

import { CabiProvider } from "@emdzej/ncsx-inpax-cabi-provider";

const cabi = new CabiProvider({
  ediabas,                                // EdiabasLike
  chassis,                                // loaded Chassis bundle
  currentSgName: "KMB",
  currentCabd: "A_KMB46",
  currentCbd: "C08",                       // .Cxx variant
  currentCodierBaureihe: "E46",
  fa: identity.fa ?? null,                 // optional — IPO's FA walker reads this
});

// 1. Wire the CABI slot table into your inpax VM.
import { buildCabiSystemFunctions } from "./your-syscall-overrides";
const systemFunctions = buildCabiSystemFunctions(cabi, { defaultSgbd: "C_KMB46" });

const vm = new VM(ipo, { runtime, systemFunctions });

// 2. Drive the IPO's `cabimain` dispatcher.
await vm.runStartup();
await cabi.CDHSetCabdPar("JOBNAME", "CODIERDATEN_LESEN");
await vm.execute("cabimain", { pushString: "CODIERDATEN_LESEN" });

// 3. Read back what the IPO published.
const status = cabi.lastJobStatus;          // "OKAY" / "ERROR_*"
const sets = cabi.lastJobSets;              // raw EDIABAS result sets
const cabdPars = cabi.allCabdPars();        // every CDHSetCabdPar write

apps/web/src/lib/runtime.svelte.ts is the reference wiring — it builds the 99-entry syscall slot table from NCSEXPER_CABI_SLOTS and dispatches each one into the right CabiProvider method.

What's implemented

| Group | Coverage | |---|---| | EDIABAS bridge | CDHapiInit/End, CDHapiJob, CDHapiJobData, CDHapiResultText/Int/Digital/Analog/Sets, CDHapiCheckJobStatus, CDHapiResultBinary — load-bearing for every read/write. | | Slot table | CDHSetDataOrg, CDHSetNettoData, CDHGetApiJobData, CDHBinBufToNettoData — the read/write packet builder. NCSEXPER's MakeHeader (FUN_00443ec0) layout, word-mode + byte-mode, payload length / wordCount / wireAddr math all match. | | BinBuf | CDHBinBufCreate/Delete, CDHBinBufWriteByte/Word, CDHBinBufReadByte/Word, CDHBinBufToStr. | | CABD pars | CDHSetCabdPar, CDHGetCabdPar, CDHSetCabdWordPar, CDHGetCabdWordPar. Per-dispatch scratchpad (NCSEXPER clears at the start of every job per FUN_00402c70 / FUN_0044b880). | | System data | CDHSetSystemData, CDHGetSystemData — host-seeded values the IPO reads (FAHRGESTELL_NR, …). | | FA walker | CDHGetFaVersion, CDHGetAnzahlFaElemente, CDHGetFaElement — tokenises the FA string the constructor was given and serves it back per index. | | Error scratchpad | CDHSetError, CDHTestError, CDHResetError — IPO surfaces recoverable errors here, host reads via getLastCdhError(). | | ZCS / FSW lookup | CDHGetFswPswFromZcs, CDHGetFswPswFromCvt, CDHGetBaureiheFromZcs — currently throw CdhNotImplementedError. ZCS decoding via the chassis <BR>ZST.* tables is planned but not yet wired. | | Authentication | CDHCallAuthenticate, CDHAuthGetRandom — stubs. Requires BMW seed/key tables (not shipped). |

The slot table is cross-validated 68/68 against the 334k empirical CALL sys observations from the 915 CABI IPOs in NCSEXPER/SGDAT — see docs/ncsexper-syscall-table.md.

Diagnostic logging

Every load-bearing call logs its round-trip to the console:

[CDHapiJob] → ecu=C_KMB46 job=IDENT params(0)=[]
[CDHapiJob] ← job=IDENT JOB_STATUS=OKAY sets=1 set[0]{JOB_STATUS="OKAY", ID_COD_INDEX=8, …}
[CDHGetApiJobData] startAddr=0x20 maxData=12 → maxRecords=12 (WB=2)
[CDHapiJobData] ecu=C_KMB46 job=C_S_LESEN bufHandle=1 buf.size=38 bytes=0102…
[CDHapiJobData] ← job=C_S_LESEN JOB_STATUS=OKAY sets=1 set[0]{CODIER_DATEN=<bin:…>, JOB_STATUS="OKAY"}
[CDHapiResultText] FAHRGESTELL_NR[set=1] → "PM10277"
[CDHSetCabdPar] FAHRGESTELL_NR = "PM10277"

That makes it possible to diff against NCSEXPER's ABLAUF.TRC when something unexpected fails.

Exports

export { CabiProvider, CdhNotImplementedError };
export type { CdhContext, CdhResult };
export * from "./error-codes";   // COAPI_OK, COAPI_ERROR, COAPI_DIABAS_ERROR, …
export {
  NCSEXPER_CABI_SLOTS,
  getCabiSlot,
  type CabiSlot,
  type CabiParam,
  type CabiCategory,
};

Consumers

  • apps/web/src/lib/runtime.svelte.ts — builds the system-function table
    • drives cabimain.
  • apps/web/src/lib/process-ecu.ts — the orchestrators (processEcu / processReadCoding / processWriteCoding / processListJobs / processRunJob).