CONSCRIPT

CONSCRIPT

Not enough ratings
Extracting Randomized Codes From Saves
By Dante
A small python script to extract things like the picture/music/journal code, or the dog tag code, etc, from your save file.
   
Award
Favorite
Favorited
Unfavorite
How to Use This
This was made on Python 3.8, but later versions probably work. YMMV.
  • Save the code below to any file with a `py` extension.
  • Run the script with the path to the save file as the first argument.
    If you have Python installed and associated with `py` files, you can just drag/drop the file onto the py file itself.
  • Viola. Just read the output window.
Example output text:
Chapter 1 Front Line Trench (Abandon Post) Code: 3081 Chapter 3 Prison Camp Code: 6771 Chapter 6 Fort Vaux Lion Door Code: 7682 Chapter 6 Weapon Storage Locker 1 (Left) Code: 3765 Chapter 6 Weapon Storage Locker 3 (Right) Code Part 1 (Symbols): 1043 Chapter 6 Weapon Storage Locker 3 (Right) Code Part 2 (Last Journal Code): 2418

For the last code, the journal/picture code, 0 is the musical note. Move the dials numerically with that in mind.
Save File Location
%LOCALAPPDATA%\CONSCRIPT\Steam
The Script
import binascii import json import msvcrt import pathlib import sys import zlib # Save location: # %LOCALAPPDATA%\CONSCRIPT\Steam try: import pydevd DEBUGGING = True except ImportError: DEBUGGING = False if len(sys.argv) < 2: print("Error: Missing file argument.") exit() saveFile = pathlib.Path(sys.argv[1]) txtFile = pathlib.Path(sys.argv[1]).with_suffix(".txt") with open(saveFile, "rb") as file: saveBytes = file.read() contents = zlib.decompress(saveBytes) contents = contents.decode("utf-8").strip() contents = contents[:-1] # Strip null terminator. contents = binascii.unhexlify(contents) contents = contents[16:len(contents)] # Strip first 16 bytes. #print(contents) #with open(txtFile, "wb") as file: # file.write(contents) # print(f"\nContents written as: {txtFile}\n") class SaveData(object): def __init__(self, j): # `[1]` because the first array entry is `roomData` and we can ignore that. # Even on new games, `roomData` will always be present even if empty. self.__dict__ = json.loads(j)[1] data = SaveData(contents) print(f"Chapter 1 Front Line Trench (Abandon Post) Code: {int(data.introBattleCode)}") print(f"Chapter 3 Prison Camp Code: {int(data.campLockCode)}") print(f"Chapter 6 Fort Vaux Lion Door Code: {int(data.isolementCode)}") print(f"Chapter 6 Weapon Storage Locker 1 (Left) Code: {int(data.tagLockerCode)}") print(f"Chapter 6 Weapon Storage Locker 3 (Right) Code Part 1 (Symbols): {int(data.pierreCodeVal1)}{int(data.pierreCodeVal2)}{int(data.pierreCodeVal3)}{int(data.pierreCodeVal4)}") print(f"Chapter 6 Weapon Storage Locker 3 (Right) Code Part 2 (Last Journal Code): {int(data.pierreBoxCode)}") if not DEBUGGING: print("Press any key to continue.") msvcrt.getch()
11 Comments
Очень Жаль 17 Jun @ 3:52pm 
Thank you. You saved me, as I didn't write down the code for the symbols.
Skybsky 10 Dec, 2024 @ 4:43pm 
thanks, man, take my points
Dandy 27 Oct, 2024 @ 11:10pm 
This was such a lifesaver for me when I couldn't remember the locker code after I had discarded the dogtag...
Sagara 6 Oct, 2024 @ 11:13pm 
:nkMad: omfg such a pain in the ass managed to get it to work.... fuck this part of the game is getting on my nerves
Sagara 6 Oct, 2024 @ 11:01pm 
shit dont work for me
if len(sys.argv) < 2:
NameError: name 'sys' is not defined

dragging onto dont do shit and whatever else
this is a absurdly stupid as fuck hassle to get that ch6 fuckin locker code bullshit... making me want to quit and leave for a while again with this nonsense
Hey Alright. 19 Sep, 2024 @ 11:39pm 
I hope this works to you guys as well.

Steps I did to fix the 'Error: Missing file argument.'

1. You need to download python of course.
2. Open notepad then copy the script above.
3. Save the file as 'conscript.py' or <any>
4. Move the conscript.py on your save folder [%LOCALAPPDATA%\CONSCRIPT\Steam]
-> Win + R then paste the save folder path then hit Enter
--> All your savefile#.bin and conscript.py should be on the same folder now
5. Click on the address bar of your file explorer then type 'cmd'
-> A new command prompt should show up on the current directory
6. type in 'python conscript.py savefile1.bin' [python <script name> <savefile name>]

Sample screenshot [imgur.com]
719099738 8 Sep, 2024 @ 2:45am 
Chapter 1 Front Line Trench (Abandon Post) Code: 6436
Chapter 3 Prison Camp Code: 8902
Chapter 6 Fort Vaux Lion Door Code: 5529
Chapter 6 Weapon Storage Locker 1 (Left) Code: 7560
Chapter 6 Weapon Storage Locker 3 (Right) Code Part 1 (Symbols): 3210
Chapter 6 Weapon Storage Locker 3 (Right) Code Part 2 (Last Journal Code): 4633
Press any key to continue.


wait, it works, LOVE YOU =W=
I made a mistake, guys, just 3 steps
1. download 【python 3.8】 or whatever
2. create a txt, copy all codes above, change Filename Extension txt to py
3. drag your game save ONTO the py file you just create itself 【fuxk me, I was so entangled with "argument"】
Dante  [author] 7 Sep, 2024 @ 6:00pm 
Re-read step 2. You didn't give it any arguments.
719099738 7 Sep, 2024 @ 2:06pm 
=== RESTART: C:\Users\Administrator\AppData\Local\CONSCRIPT\Steam\savefile.py ==
Error: Missing file argument.


help~ I create a new txt file copying all code above in exact %LOCALAPPDATA%\CONSCRIPT\Steam, then change Filename Extension txt to py, when I run it , come up the error above, why? because 【if len(sys.argv) < 2:】 ? how to fix it ?
Dante  [author] 2 Sep, 2024 @ 9:01am 
I'm not making a video. If someone wants to do it, let me know and I can link it here, but I'm not making one.

And if you can't get drag/drop working... as I also mentioned, just run it with the save file being the first arg. There's plenty of generic tutorial video out there for running python scripts in cmd like this already.