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

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

Built distribution (wheel)

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

Total release size: 69.2 kB

Release files / sltmodel-1.1.2.tar.gz

Download URL sltmodel-1.1.2.tar.gz
Size 44.1 kB
Tags Source
SHA-256 checksum
How to use checksums
40ba9baaf640283c6419470dce9689cb2155bdc2b2dc73a5c6dc74bd46d86b5e
BLAKE2b-256 checksum
How to use checksums
c22d40b64bd43b5ea16b4e5f75a17b46a315042e146ccea77c811a49bebb26df
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.2-py3-none-any.whl

Download URL sltmodel-1.1.2-py3-none-any.whl
Size 25.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43463f1240e32ae15cd750c06d66937ea1b213575fac0ce3d99263032d2613b0
BLAKE2b-256 checksum
How to use checksums
f2f0934f3d0cb15be4bbb6198ec3571d4e83047c756c5a5957052d22192f9084
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

This release

1.1.2 This release

2 release files

1.1.1

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