Skip to main content

Interact with .sdb (application compatibility shim database) files

Project description

sdbtool

A tool for converting Microsoft Application Compatibility Database (SDB) files to XML format.


PyPI - Version PyPI - License PyPI - Python Version
CI Publish Python Package codecov

Table of Contents

  1. Features
  2. Getting Started
  3. Contributing

Features

  • Parses SDB files used by Windows for application compatibility.
  • Converts SDB data into readable XML or JSON format.
  • Dump file attributes in SDB-recognizable format
  • Useful for analysis, migration, or documentation.
  • Pure Python and cross-platform - no native apphelp.dll dependency.

Getting Started

Installation

Sdbtool is available as sdbtool on PyPI.

Invoke sdbtool directly with uvx:

uvx sdbtool sdb2xml your.sdb                        # Convert the file 'your.sdb' to xml, and print it to the console
uvx sdbtool sdb2xml your.sdb --output your.xml      # Convert the file 'your.sdb' to xml, and write it to 'your.xml'
uvx sdbtool sdb2json your.sdb                       # Convert the file 'your.sdb' to json, and print it to the console
uvx sdbtool sdb2json your.sdb --output your.json    # Convert the file 'your.sdb' to json, and write it to 'your.json'
uvx sdbtool sdb2xml old.sdb --target-os 0501        # Resolve tag names as of Windows XP (for older databases)
uvx sdbtool attributes your.exe                     # Show the file attributes as recognized by apphelp in an XML-friendly format
uvx sdbtool info your.sdb                           # Show some details about the SDB file (version, description, ...)

Tag names and --target-os

Tag names are not constant across Windows versions: some are renamed (e.g. OS_PLATFORM became GUEST_TARGET_PLATFORM) and some are dropped (e.g. OS_SKU exists on XP but not on Windows 11). sdb2xml / sdb2json therefore accept --target-os <VERSION> to resolve names as of a particular Windows release; without it, names are resolved against the newest known table. An unknown tag is rendered as InvalidTag_0xXXXX, keeping its raw number visible.

Or install sdbtool with uv (recommended), pip, or pipx:

# With uv.
uv tool install sdbtool@latest  # Install sdbtool globally.

# With pip.
pip install sdbtool

# With pipx.
pipx install sdbtool

Updating an installed sdbtool to the latest version with uv:

# With uv.
uv tool upgrade sdbtool

# With pip.
pip install --upgrade sdbtool

# With pipx.
pipx upgrade sdbtool

Contributing

Contributions are welcome! Please open issues or submit pull requests.

Regenerating the tag tables

The tag-id → name tables live in sdbtool/apphelp/tags/tags.json as a base table plus per-version add / override / remove deltas. They are produced offline from every apphelp.dll version by tools/generate_tags.py, which calls the DLL's SdbTagToString export. This generator is author-only and is not shipped in the package.

Each DLL is read with Speakeasy (Mandiant's emulator): it parses and emulates the PE regardless of bitness, so one 64-bit run handles the x86 (XP / 2003) DLLs as well as DLLs the OS refuses to load natively (some Win7/8.1 apphelp.dll fail a real LoadLibrary with WinError 182). Speakeasy lives in the optional gen dependency group; emulating every export call is slow (minutes for the full set), which is fine for this offline step.

uv run --group gen python tools/generate_tags.py --data-dir path\to\apphelp\dlls

The data directory is expected to contain <version>/<arch>/apphelp.dll files (e.g. 0501/x86/apphelp.dll, 0A00-26200/x64-64/apphelp.dll); add more versions by dropping their apphelp.dll in and regenerating.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sdbtool-0.9.0.tar.gz (31.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sdbtool-0.9.0-py3-none-any.whl (35.9 kB view details)

Uploaded Python 3

File details

Details for the file sdbtool-0.9.0.tar.gz.

File metadata

  • Download URL: sdbtool-0.9.0.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sdbtool-0.9.0.tar.gz
Algorithm Hash digest
SHA256 ab4d9d71f985b68e177f0deaa739221d264f47267f78fbd7024a1a3f89e8585f
MD5 b2325f0789385a4291e80ddb12e8158d
BLAKE2b-256 8c307f9bf011d312af400a6cca3be0d8e3405b6db133d55b5b44ee843d5f10af

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdbtool-0.9.0.tar.gz:

Publisher: python-publish.yml on learn-more/sdbtool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sdbtool-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: sdbtool-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 35.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sdbtool-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a725f54e7620668a57475ce0104bf726623ed8db013f8530a516c0e0a8e3478
MD5 6726e077522002ba1acefdb2a06aadd5
BLAKE2b-256 71bdc00f30278c243d74a452551649f88cac3818b51addf1fec09254e647072c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sdbtool-0.9.0-py3-none-any.whl:

Publisher: python-publish.yml on learn-more/sdbtool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page