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.0

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.0
File Size Uploaded
sltmodel-1.1.0.tar.gz 44.1 kB Details

Built distribution (wheel)

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

Total release size: 69.2 kB

Release files / sltmodel-1.1.0.tar.gz

Download URL sltmodel-1.1.0.tar.gz
Size 44.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4e0b8f321cc79da298d7abf51e4dcc6345c6c2b1e9a9a9fda16982a80c42206f
BLAKE2b-256 checksum
How to use checksums
aafe5eb23d8a2763f0bb09bc826367c75015e8dc483b4a3c3d57c78384a31de4
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.0-py3-none-any.whl

Download URL sltmodel-1.1.0-py3-none-any.whl
Size 25.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1248889e3528c217dea87212f9bebe4b51e9298094df084b7663f433e3ee001
BLAKE2b-256 checksum
How to use checksums
13fd7923e445cc6e0d6fea9b0f68aca5bdced96e664232d78188dbbc4e6aeef6
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

1.1.1

2 release files

This release

1.1.0 This release

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