View Issue Details

IDProjectCategoryView StatusLast Update
0000663fileGeneralpublic2025-05-31 15:42
Reporterdarktohka Assigned Tochristos  
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
PlatformLinuxOSArch LinuxOS Version2025/05/31
Product Version5.46 
Fixed in VersionHEAD 
Summary0000663: Add Panda3D game engine format support (BAM, MF)
DescriptionThis patch adds support for two binary Panda3D game engine formats. One of them is the BAM format, which is used to represent 3D models inside the Panda3D game engine. The other is the MF format, which is a game archive that can hold game assets similar to a ZIP file.
    
Both formats are documented on the internet. Test files for Panda3D multifiles can be found at https://github.com/toonjoey/toontown-project-bikehorn or at https://github.com/darktohka/panda3d-encryption-demo/raw/refs/heads/master/phase_1.ef, while test files for Panda3D BAM files can be found at https://github.com/Toontown-Open-Source-Initiative/Toontown-School-House/tree/master/resources/phase_3.5/models/gui.
Steps To ReproduceFor BAM files:
1. `wget https://github.com/Toontown-Open-Source-Initiative/Toontown-School-House/raw/refs/heads/master/resources/phase_3.5/models/gui/QT_buttons.bam`
2. `file QT_buttons.bam`

```
QT_buttons.bam: Panda3D BAM file version 6.24, little-endian vertex data, single-precision floats
```

For Multifile files:
1. `wget https://github.com/darktohka/panda3d-encryption-demo/raw/refs/heads/master/phase_1.ef`
2. `file phase_1.ef`

```
phase_1.ef: Panda3D Multifile archive version 1.1, created: Tue Feb 23 12:16:47 2021
```
Additional InformationAn older version of this patch was posted to the mail archive, but wasn't acknowledged; this version of the patch handles future versions as well
TagsNo tags attached.

Activities

darktohka

2025-05-31 10:56

reporter  

0001-games-Add-Panda3D-game-engine-formats.patch (2,572 bytes)   
From 29ed80eaf047b20d01882858d30a4ad4fbc94258 Mon Sep 17 00:00:00 2001
From: Derzsi Daniel <daniel@tohka.us>
Date: Thu, 22 May 2025 20:54:29 +0300
Subject: [PATCH] games: Add Panda3D game engine formats

This patch adds support for two binary Panda3D game engine formats. One of them is the BAM format, which is used to represent 3D models inside the Panda3D game engine. The other is the MF format, which is a game archive that can hold game assets similar to a ZIP file.

Both formats are documented on the internet. Test files for Panda3D multifiles can be found at https://github.com/toonjoey/toontown-project-bikehorn, while test files for Panda3D BAM files can be found at https://github.com/Toontown-Open-Source-Initiative/Toontown-School-House/tree/master/resources/phase_3.5/models/gui.
---
 magic/Magdir/games | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/magic/Magdir/games b/magic/Magdir/games
index e07ad60f..942cec4f 100644
--- a/magic/Magdir/games
+++ b/magic/Magdir/games
@@ -669,3 +669,42 @@
 0	string	RGSSAD\0
 >7	byte	x	RPG Maker RGSSAD asset archive. version %u
 !:ext rgssad/rgss2a/rgss3a
+
+# Panda3D BAM model format
+# From: Derzsi Daniel <daniel@tohka.us>
+# URL:  https://gist.github.com/rdb/13cb936f41e0339a9a9cf9651ea2b09f
+0	string	pbj\0\n\r	Panda3D BAM file
+>10	ubyte	x	version %u
+>12	ubyte	x	\b.%u
+# Version >= 5.0 has little-endian and big-endian formats
+>10	ubyte	>4
+>>14	ubyte	0	\b, big-endian vertex data
+>>14	ubyte	1	\b, little-endian vertex data
+>10	ubyte	<5	\b, little-endian vertex data
+# Version >= 6.27 has single-precision and double-precision floats
+>10	ubyte	=6
+>>12	ubyte	>26
+>>>15	ubyte	0	\b, single-precision floats
+>>>15	ubyte	1	\b, double-precision floats
+>>12	ubyte	<27	\b, single-precision floats
+>10	ubyte	>6
+>>15	ubyte	0	\b, single-precision floats
+>>15	ubyte	1	\b, double-precision floats
+>10	ubyte	<6	\b, single-precision floats
+
+# Panda3D Multifile archive format
+# From: Derzsi Daniel <daniel@tohka.us>
+# URL:  https://tohka.us/p/exploring-encrypted-multifiles-a-technical-overview
+0	string	pmf\0\n\r	Panda3D Multifile archive
+>6	uleshort	x	version %u
+>8	uleshort	x	\b.%u
+# Version >= 1.1 has creation date information, missing if set to zero
+>6	uleshort	=1
+>>8	uleshort	>0
+>>>14	uledate	=0	\b, unknown creation date
+>>>14	uledate	!0	\b, created: %s
+>>8	uleshort	<1	\b, unknown creation date
+>6	uleshort	>1
+>>14	uledate	=0	\b, unknown creation date
+>>14	uledate	!0	\b, created: %s
+>6	uleshort	<1	\b, unknown creation date
-- 
2.49.0

christos

2025-05-31 15:42

manager   ~0004257

Added, thanks!

Issue History

Date Modified Username Field Change
2025-05-31 10:56 darktohka New Issue
2025-05-31 10:56 darktohka File Added: 0001-games-Add-Panda3D-game-engine-formats.patch
2025-05-31 15:42 christos Assigned To => christos
2025-05-31 15:42 christos Status new => assigned
2025-05-31 15:42 christos Status assigned => resolved
2025-05-31 15:42 christos Resolution open => fixed
2025-05-31 15:42 christos Fixed in Version => HEAD
2025-05-31 15:42 christos Note Added: 0004257