-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e879377
commit 5544b5b
Showing
4 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# SPDX-FileCopyrightText: © 2024 Decompollaborate | ||
# SPDX-License-Identifier: MIT | ||
|
||
from __future__ import annotations | ||
|
||
import ipl3checksum | ||
|
||
# We want this buffer to be small so it triggers an exception | ||
b = bytes([0,0,0,0]) | ||
|
||
try: | ||
checksum = ipl3checksum.CICKind.CIC_6102_7101.calculateChecksum(b) | ||
|
||
print(f"This code shouldn't run") | ||
print(f"{checksum[0]:08X} {checksum[1]:08X}") | ||
raise RuntimeError() | ||
|
||
except ipl3checksum.exceptions.BufferNotBigEnough as e: | ||
print("We triggered and succesfully catched an exception!") | ||
print(f" e: {e}") |