Skip to main content

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.

Metadata

Release files for es3-modifier 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for es3-modifier 0.1.0
File Size Uploaded Provenance Actions
es3-modifier-0.1.0.tar.gz 15.8 kB Without provenance Details for es3-modifier-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for es3-modifier 0.1.0
File Interpreter ABI Platform Actions
es3_modifier-0.1.0-py3-none-any.whl Python 3 none any Details for es3_modifier-0.1.0-py3-none-any.whl

Total release size: 32.2 kB

Release files / es3-modifier-0.1.0.tar.gz

Download URL es3-modifier-0.1.0.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
18cb3031f3fab19fab6bdd519c915a7f653a57f8dc1de11253de2069484970c8
BLAKE2b-256 checksum
How to use checksums
179d7c648d2852e220a36cbd51ab06e9cf750ff08b394749c18066e63ba1b7b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / es3_modifier-0.1.0-py3-none-any.whl

Download URL es3_modifier-0.1.0-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
838843c4391e3b68cd66be34a8b9d2e203ba12cdc6776a587a3c0be1979b5d0d
BLAKE2b-256 checksum
How to use checksums
635a2f587453f89efa36301032dab5492245982e4961a54a2ca54c4740c8be16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Security for es3-modifier 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page