A package for editing DOOM 3 BFG Edition profile.bin
Project description
DOOM 3 BFG Edition Profile
DOOM 3 BFG Edition includes a profile.bin file in the users save data. This file includes (presumably) default console variable (CVar) settings, along with some additional data which appears to be default input mappings.
The file contains two checksums calculated from the contents of the data, so you cannot simply edit the file without knowing how to re-calculate the checksums otherwise the game will detect the file as corrupt on start-up and create a new profile.bin.
This Python package allows you to open a profile.bin file, make changes to it, and then write it back to disk with the correct checksums.
But why?
I wanted to experiment with changing settings on console versions of the game, where access to the in-game console is not readily available. In the PlayStation 4 version of the game the profile.bin file is located within the users encrypted PS4 save data. With a jailbroken PS4 you can decrypt the save, edit the profile.bin file with this Python package and then re-encrypt the save data. The modified settings are now loaded by the game.
Installation
pip install doom3-bfg-profile
Typical Usage
- Create a
BFG_Profileobject by loading and parsing an existingprofile.bin - Add/change/remove console variable settings
- Save the new
profile.binby callinggenerate_profile()
Limitations
I was only interested in editing the console variables section of the profile.bin file. I have not investigated the section which appears to be default input mappings, so any profile.bin which contains such a section will have it re-created in the updated file as it originally was (identified as 'Extra Data' in the profile.bin data structure).
Usage Examples
Create a BFG_Profile object and add the com_showFPS = 1 console variable
import doom3_bfg_profile as d3
profile = d3.BFG_Profile('profile.bin')
profile.add_config_item(d3.Config_Item('com_showFPS', '1'))
profile.generate_profile()
A demo application is included in src/demo.py.
Reference
Profile.bin Structure
| Data | Size | Description |
|---|---|---|
| Checksum 1 | 4 bytes | MD5 based checksum of all subsequent data (written big endian) |
| Checksum 2 | 4 bytes | MD5 based checksum of all subsequent data (written big endian) |
| Header | 5 bytes | 80 94 CC A1 04 |
| Config Data Count | 1 byte | Total number of key pair values in Config Data |
| Config Data | Variable | NULL terminated key pair valuescom_showFPS\x00 1\x00 |
| Config Footer | 19 bytes | 17x 00 + C8 01 |
| Padding | 206 bytes | 205x 00 + 01 |
| Extra Data | Variable | Possibly default key bindings |
Development
All commands after step 1 should be run from the root of the git repo
1. Clone the repo
git clone git@github.com:andshrew/DOOM3-BFG-Profile.git
2. Create and load a virtual python environment
python -m venv .venv
source .venv/bin/activate
3. Upgrade pip
pip install --upgrade pip
4. Install the package in editable mode
pip install -e ".[test]"
5. Build the final package
pip install build
python -m build
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file doom3_bfg_profile-1.0.0.tar.gz.
File metadata
- Download URL: doom3_bfg_profile-1.0.0.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9e8619631da04dc0179fbd8463c5f83c0d7f52642a2201ded78a96d26d35f7d
|
|
| MD5 |
03aee7508e900d33b6110e2822ef3e67
|
|
| BLAKE2b-256 |
6694d02ad5f25eb9f25e66b1891b54a98cb242402391e1ac473f5d74ff3f0cff
|
Provenance
The following attestation bundles were made for doom3_bfg_profile-1.0.0.tar.gz:
Publisher:
publish-to-pypi.yml on andshrew/DOOM3-BFG-Profile
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
doom3_bfg_profile-1.0.0.tar.gz -
Subject digest:
c9e8619631da04dc0179fbd8463c5f83c0d7f52642a2201ded78a96d26d35f7d - Sigstore transparency entry: 833819909
- Sigstore integration time:
-
Permalink:
andshrew/DOOM3-BFG-Profile@831b5e13ad3f487cdec9b146cbe54c5b68912f8f -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/andshrew
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@831b5e13ad3f487cdec9b146cbe54c5b68912f8f -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file doom3_bfg_profile-1.0.0-py3-none-any.whl.
File metadata
- Download URL: doom3_bfg_profile-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a405af255b4a1b02a1b6feb48df6b91c436a6dfad57d8553d6f09188b61098f
|
|
| MD5 |
c17b3afe5153e18459bd0f1a7c68d6b7
|
|
| BLAKE2b-256 |
ad8959a5bd04db46652924906dc96b3578aedf83b229ce0ec5a06d655be8737e
|
Provenance
The following attestation bundles were made for doom3_bfg_profile-1.0.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on andshrew/DOOM3-BFG-Profile
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
doom3_bfg_profile-1.0.0-py3-none-any.whl -
Subject digest:
9a405af255b4a1b02a1b6feb48df6b91c436a6dfad57d8553d6f09188b61098f - Sigstore transparency entry: 833819911
- Sigstore integration time:
-
Permalink:
andshrew/DOOM3-BFG-Profile@831b5e13ad3f487cdec9b146cbe54c5b68912f8f -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/andshrew
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@831b5e13ad3f487cdec9b146cbe54c5b68912f8f -
Trigger Event:
workflow_dispatch
-
Statement type: