Skip to main content

uppercut-gba-rom-verify

Checks a Game Boy Advance ROM's cartridge header and the devkitARM ELF it was built from, then reports the ROM's SHA-256. The header checks are the logo, title, game code, maker code, fixed byte 0x96, the complement byte at 0xBD (computed, not hard-coded), the 32 MB size limit and 4-byte alignment. The ELF checks are ELF32, little-endian, ARM EABI5, an executable type, and an entry point inside an executable PT_LOAD segment. Standard library only.

The package takes the cartridge identity (title, game code, maker code) as parameters, so one copy serves every game.

pip install uppercut-gba-rom-verify

Command line

uppercut-gba-rom-verify game.gba game.elf --title "EXAMPLE GAME" --game-code EXMP --maker-code 01

The identity can come from a JSON file instead, and flags override it:

{ "title": "EXAMPLE GAME", "game_code": "EXMP", "maker_code": "01" }
uppercut-gba-rom-verify game.gba game.elf --config cartridge.json
python -m uppercut_gba_rom_verify game.gba game.elf --config cartridge.json --expect-sha256 <64 hex digits>

Each check prints PASS ... to stdout or FAIL ... to stderr. The exit code is 0 when everything passes, 1 when a check fails and 2 for a usage error, such as a missing identity or a title longer than 12 characters.

Python

from uppercut_gba_rom_verify import RomConfig, ValidationError, validate_elf_file, validate_rom_file

config = RomConfig(title="EXAMPLE GAME", game_code="EXMP", maker_code="01")

try:
    rom = validate_rom_file("game.gba", config)
    elf = validate_elf_file("game.elf")
except ValidationError as error:
    for detail in error.errors:
        print("FAIL", detail)
else:
    print(rom.sha256, rom.complement, elf.load_segment_count)

Functions

Function Returns
validate_rom_file(path, config, *, expected_sha256=None) RomInfo
validate_rom_bytes(rom, config, *, expected_sha256=None) RomInfo
validate_elf_file(path) ElfInfo
validate_elf_bytes(elf) ElfInfo
calculate_header_complement(rom) the complement byte for a ROM's header
main(argv=None) the exit code, as the command line does

RomConfig(title, game_code, maker_code) checks its own values: the title is 1 to 12 ASCII characters and is NUL-padded to 12 bytes in the header, the game code is exactly 4 ASCII characters and the maker code exactly 2.

Every failed check is collected into ValidationError.errors. A missing or unreadable file raises ValidationError naming the artifact.

Notes

  • The Nintendo logo is the 156-byte block the GBA BIOS checks. It is the same for every cartridge.
  • The ELF checks target devkitARM output (ET_EXEC, EM_ARM, EABI5 flags).
  • Checks the GBA BIOS and gbafix also treat as fixed (main unit code, device type, reserved bytes, software version) are not enforced; the header is validated for the fields listed above only.

License

MIT

Metadata

Release files for uppercut-gba-rom-verify 0.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 uppercut-gba-rom-verify 0.1.0
File Size Uploaded Provenance Actions
uppercut_gba_rom_verify-0.1.0.tar.gz 11.8 kB Without provenance Details for uppercut_gba_rom_verify-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for uppercut-gba-rom-verify 0.1.0
File Interpreter ABI Platform Actions
uppercut_gba_rom_verify-0.1.0-py3-none-any.whl Python 3 none any Details for uppercut_gba_rom_verify-0.1.0-py3-none-any.whl

Total release size: 23.3 kB

Release files / uppercut_gba_rom_verify-0.1.0.tar.gz

Download URL uppercut_gba_rom_verify-0.1.0.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
07c8a35a8db50a53da4eb7d5212b13a5df0c8d8725e53290a9b5a24964de2ffa
BLAKE2b-256 checksum
How to use checksums
82286ebbbe125fa11e3ce0cf31c332adb548387d26490285a6d7f4c37efe6fd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / uppercut_gba_rom_verify-0.1.0-py3-none-any.whl

Download URL uppercut_gba_rom_verify-0.1.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2919a22539a4421d43e028d6c08c942f6f7570fb96b2070306be89c927386a3
BLAKE2b-256 checksum
How to use checksums
53adbee8f55d24bbe5d2803345966457e9a871e301324481623b88b4db803352
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for uppercut-gba-rom-verify 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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