A package to decrypt, edit and encrypt EasySave files used in Unity games
Project description
es3-modifier
es3-modifier
is a Python package designed for handling stat files generated by Unity's Easy Save tool. With it, you can seamlessly open, modify, and save new stats. This project was created for use in es3-editor
Installation
To get started, you can easily install the package using pip:
pip install es3-modifier
Usage
Below is a practical demonstration of how to use this package. In this instance, we'll be working with the Phasmophobia
game save file, extracting key details, and adjusting specific player stats:
import os, re, json
from es3_modifier import ES3
def format_inventory_name(name):
"""Format the inventory name for better readability."""
name = re.sub(r'(?<=[a-z])([A-Z])', r' \1', name)
name = re.sub(r'(?<=[A-Z])([A-Z][a-z])', r' \1', name)
return name.replace('Inventory', '').rstrip()
# Define the path to the Phasmophobia save file
phasmophobia_path = f'{os.environ["USERPROFILE"]}\\AppData\\LocalLow\\Kinetic Games\\Phasmophobia\\SaveFile.txt'
# Initialize ES3 with the Phasmophobia save data
with open(phasmophobia_path, 'rb') as file:
es3 = ES3(file.read(), 't36gref9u84y7f43g')
try:
# Load and decrypt the save data
decrypted = es3.load()
# Display player stats
print(f'Money: ${decrypted["PlayersMoney"]["value"]:,}')
print(f'Legacy Level: {decrypted["Level"]["value"]}')
print(f'Level: {decrypted["NewLevel"]["value"]}')
print(f'Prestige: {decrypted["PrestigeIndex"]["value"]}')
# Display inventory
print('\n== Inventory ==')
for key, value in decrypted.items():
if 'Inventory' not in key:
continue
formatted_name = format_inventory_name(key)
amount = value['value']
print(f'{formatted_name}: {amount}')
# Modify save data values
decrypted['PlayersMoney']['value'] = 99999
decrypted['NewLevel']['value'] = 123
# Save the modified data
with open('new.txt', 'wb') as out_file:
out_file.write(es3.save(json.dumps(decrypted)))
except Exception as e:
print(e)
Remember to always create backups before editing your save files!
Prerequisites
This package uses pycryptodome
for AES, it will automatically be installed.
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
Hashes for es3_modifier-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 838843c4391e3b68cd66be34a8b9d2e203ba12cdc6776a587a3c0be1979b5d0d |
|
MD5 | cb1558b6c65570cd94d6a126cf41cb36 |
|
BLAKE2b-256 | 635a2f587453f89efa36301032dab5492245982e4961a54a2ca54c4740c8be16 |