Skip to content

Instantly share code, notes, and snippets.

@elmoiv
Created March 18, 2021 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elmoiv/a62436046e07ec75249a5353a2c657c2 to your computer and use it in GitHub Desktop.
Save elmoiv/a62436046e07ec75249a5353a2c657c2 to your computer and use it in GitHub Desktop.
Read Dead Redemption 2 Snapmatics Convertor
import os
OFFSET = 300
# Chnage this according to your SaveGame location
RDR2_DIR = 'Path\\to\\SaveGame'
RDR2_SAVE = os.path.expanduser('~') + '\\Desktop\\RDR2_SNAPMATICS'
J = os.path.join
B = os.path.basename
def convert(snapmatic):
"""
Converts RDR2 Snapmatics to JPEG files
"""
raw = open(snapmatic, 'rb').read()[OFFSET:]
json_offset = raw.find(b'JSON')
raw = raw[:json_offset].rstrip(b'\x00')
open(J(RDR2_SAVE, B(snapmatic) + '.jpg'), 'wb').write(raw)
os.makedirs(RDR2_SAVE, exist_ok=True)
for d, _, fs in os.walk(RDR2_DIR):
for f in fs:
path = J(d, f)
if B(path).startswith('PRDR'):
convert(path)
print('Converted:', B(path), 'at', path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment