Skip to main content

StructLayoutToolkitModel

StructLayoutToolkitModel (distribution name sltmodel) is a standalone, GUI-independent model library that handles StructLayout definitions and binary decoding. It provides the structure engine used by StructLayoutToolkitGui and is intended for reuse by other clients such as a CLI.

Installation

python -m pip install sltmodel

API

from sltmodel import CaptureDocument, PayloadStructDef
from sltmodel.resources import load_pcap_layout

capture = CaptureDocument.from_bytes(capture_bytes)
pcap_layout = load_pcap_layout()

The package provides capture parsing and IP fragment reassembly, conditional payload StructLayout definitions, StructInstance value helpers, InfoSize conversion helpers, bundled PCAP/PCAPNG/PE/ELF layouts, and Lua plugin hooks. It does not import or depend on Tkinter.

Built-in layouts

from sltmodel.resources import (load_elf_layout, load_pcap_layout,
                                load_pcapng_layout, load_pe_layout)

pe_layout = load_pe_layout()
elf_layout = load_elf_layout()

Lua plugins

LuaPluginManager loads *.lua files from a caller-supplied directory and applies their optional decode(instance) and encode(instance) hooks to StructInstance values. The manager has no GUI dependency; it requires Lupa when Lua plugins are loaded.

from sltmodel.lua_plugins import LuaPluginManager

plugins = LuaPluginManager(plugin_directory)
display_instance = plugins.apply_decode(decoded_instance)
encoded_instance = plugins.apply_encode(display_instance)

Development

uv sync
uv run pytest -q
uv run pytest --cov=sltmodel --cov-branch --cov-report=term-missing -q
uv build

Generate a browsable HTML coverage report in htmlcov/:

uv run pytest --cov=sltmodel --cov-branch --cov-report=html -q

Open htmlcov/index.html to inspect uncovered lines and branches.

To bump the package version, run one of these scripts from the repository root. Each script resolves pyproject.toml and uv.lock relative to its own location.

.\bump_major.ps1
.\bump_minor.ps1
.\bump_patch.ps1

The scripts update the sltmodel version in both pyproject.toml and uv.lock.

Metadata

Release files for sltmodel 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sltmodel 1.1.1
File Size Uploaded
sltmodel-1.1.1.tar.gz 44.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sltmodel 1.1.1
File Interpreter ABI Platform
sltmodel-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 69.2 kB

Release files / sltmodel-1.1.1.tar.gz

Download URL sltmodel-1.1.1.tar.gz
Size 44.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a9eca0510bed3379601a0585d70d0e31b5ac212a4ceee6b737fa574ad760f2d1
BLAKE2b-256 checksum
How to use checksums
3cbda7bf350058ba1026d5c02229a205749e6f2a3198e6d7035437519a90ba33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / sltmodel-1.1.1-py3-none-any.whl

Download URL sltmodel-1.1.1-py3-none-any.whl
Size 25.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d7dd7be4c4716fc62b7d1d54344c3276d42bde041fa749909fdf648d5f4adc1
BLAKE2b-256 checksum
How to use checksums
b80ec87d86a52f8901050c82cef8da805c1f26be234eee56a2d24ae393c20d8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

1.1.2

2 release files

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page