commit: 74be4d2eabdfb8a9aa63dfa2f8df88b6a1c4655f
parent 2127c12739b1b6bf3ea4980cb8d4ba99d1306882
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Mon, 11 Dec 2023 19:15:58 +0100
Add support for Python 3.12 bytecode
Diffstat:
5 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/deblob.1 b/deblob.1
@@ -47,7 +47,7 @@ Erlang BEAM files
.It
Java Class files and Archives (JAR)
.It
-Python 2.7 & 3.8/3.9/3.10/3.11 bytecode files, typically
+Python 2.7 & 3.8/3.9/3.10/3.11/3.12 bytecode files, typically
.Sq *.pyc
.It
Python pickle files, used to serialize Python objects
diff --git a/main.ha b/main.ha
@@ -33,6 +33,7 @@ const magic: [_][]u8 = [
[0x61, 0x0D, '\r', '\n'], // (3425i litte-endian) Python 3.9
[0x6F, 0x0D, '\r', '\n'], // (3439i litte-endian) Python 3.10
[0xA7, 0x0D, '\r', '\n'], // (3495i litte-endian) Python 3.11
+ [0xCB, 0x0D, '\r', '\n'], // (3531i litte-endian) Python 3.12
// Python pickle object data, similarly to Perl Storage it's dangerous enough to cause code execution
[0x80, 0x02], // Protocol 2 + start of frame
[0x80, 0x03], // Protocol 3 + start of frame
diff --git a/test/fixtures/pyc/hello.checked_hash.cpython-312.pyc b/test/fixtures/pyc/hello.checked_hash.cpython-312.pyc
Binary files differ.
diff --git a/test/fixtures/pyc/hello.timestamp.cpython-312.pyc b/test/fixtures/pyc/hello.timestamp.cpython-312.pyc
Binary files differ.
diff --git a/test/fixtures/pyc/hello.unchecked_hash.cpython-312.pyc b/test/fixtures/pyc/hello.unchecked_hash.cpython-312.pyc
Binary files differ.