Ren'Py New Ren'Py Token Check (when creating a save)

toni_rhcp

New Member
Aug 1, 2022
1
1
Worked like a charm! Thanks!

Just a minor thing, in my case the 4th step must be without the 3 (don't know why)
'python repack-savefile.py security_keys.txt 1-11-LT1.save'

Hello, I have a quick workaround for this
Here is a python script that can use your local tokens and overwrite the save signature to unlock it

How-to-use it

0) Make sure you have python3 installed and it accessible from console + install ecdsa using 'pip install ecdsa'
1) Unpack python script into your test folder.
2) You need to find your save location and copy "security_keys.txt" to folder with your script
3) copy savegame (1-11-LT1.save for instance into location with Your script)
4) run script 'python3 repack-savefile.py security_keys.txt 1-11-LT1.save' (where first should be your tokens textfile, second is name of savegame). Path can be absolute or relative - should work in both cases.
5) copy savegame file back to savegame location, override it.
Be Aware! this script override "signature" file in your savegame, please make backup before use it.

Tested on BigBrother and using
 
  • Red Heart
Reactions: Muramasa0

derfirm

Newbie
Jan 9, 2021
34
102
Worked like a charm! Thanks!

Just a minor thing, in my case the 4th step must be without the 3 (don't know why)
'python repack-savefile.py security_keys.txt 1-11-LT1.save'
Sure, but it looks like you patching inside of savegame folder, so please be accurate with it.
 

WuzzyFuzzy

Well-Known Member
Jan 23, 2020
1,559
3,163
Ok, again, let me reiterate what I've already stated.

I understand the threat and why the file check was created. It is there to act as a safeguard when one chooses to load a save file that someone else created. We good?

What I posted about, however, is manipulating my own files. I have never even thought about downloading someone else's save file let alone used one. But I do like to play around with some of the games I play, editing the save files I have created. An apple and an orange. Not the same.

Plus, I've never and will never have a webcam connected to any of my computers. :p
 
  • Like
Reactions: vilewe7570

Count Morado

Devoted Member
Respected User
Jan 21, 2022
8,117
15,627
And my posting of the video is because the title of the thread is ambiguous enough that people who are using others' saves will come to this thread looking for solutions and by posting the video, I've at least done my part to give them a warning that using a save file they got from some anonymous stranger may not be the best idea in the world.
 

WuzzyFuzzy

Well-Known Member
Jan 23, 2020
1,559
3,163
And my posting of the video is because the title of the thread is ambiguous enough that people who are using others' saves will come to this thread looking for solutions and by posting the video, I've at least done my part to give them a warning that using a save file they got from some anonymous stranger may not be the best idea in the world.
Understood and a reasonable response. Including your comment with the video (or something of a warning) would likely help with clarification.
 

PorkiDrifter

Member
Aug 20, 2021
427
321
Worked like a charm! Thanks!

Just a minor thing, in my case the 4th step must be without the 3 (don't know why)
'python repack-savefile.py security_keys.txt 1-11-LT1.save'
How do i know if the python scripted work? does it flash? like green anything that it worked? it says Invalid syntax line 1
1692375641002.png
1692375669326.png
 
Last edited:

PorkiDrifter

Member
Aug 20, 2021
427
321
Hello, I have a quick workaround for this
Here is a python script that can use your local tokens and overwrite the save signature to unlock it

How-to-use it

0) Make sure you have python3 installed and it accessible from console + install ecdsa using 'pip install ecdsa'
1) Unpack python script into your test folder.
2) You need to find your save location and copy "security_keys.txt" to folder with your script
3) copy savegame (1-11-LT1.save for instance into location with Your script)
4) run script 'python3 repack-savefile.py security_keys.txt 1-11-LT1.save' (where first should be your tokens textfile, second is name of savegame). Path can be absolute or relative - should work in both cases.
5) copy savegame file back to savegame location, override it.
Be Aware! this script override "signature" file in your savegame, please make backup before use it.

Tested on BigBrother and using
1692376480746.png when i run the script it pops that message
1692376509988.png im kinda noob in this but i run it also without the run script and nothing happened
The python i run is the latest 3.11.4 64bit
run script 'python3 repack-savefile.py security_keys.txt 1-1-LT1.save'
 
Last edited:

derfirm

Newbie
Jan 9, 2021
34
102
View attachment 2860790 when i run the script it pops that message
View attachment 2860791 im kinda noob in this but i run it also without the run script and nothing happened
The python i run is the latest 3.11.4 64bit
run script 'python3 repack-savefile.py security_keys.txt 1-1-LT1.save'
Hello, you should use python directly, without any renpy or another tools invocation
cmd should be same as provided, please remove "run script" cmd :)
 

stOrM!

Newbie
Sep 23, 2019
48
20
Hello, I have a quick workaround for this
Here is a python script that can use your local tokens and overwrite the save signature to unlock it

How-to-use it

0) Make sure you have python3 installed and it accessible from console + install ecdsa using 'pip install ecdsa'
1) Unpack python script into your test folder.
2) You need to find your save location and copy "security_keys.txt" to folder with your script
3) copy savegame (1-11-LT1.save for instance into location with Your script)
4) run script 'python3 repack-savefile.py security_keys.txt 1-11-LT1.save' (where first should be your tokens textfile, second is name of savegame). Path can be absolute or relative - should work in both cases.
5) copy savegame file back to savegame location, override it.
Be Aware! this script override "signature" file in your savegame, please make backup before use it.

Tested on BigBrother and using
derfirm
Hey,
I need some help with 2) on my whole machine there is no "security_keys.txt" I've searched in the save location and anywhere else. I'm using Renpy 8.1.1 on OSX Ventura, so my save path should be in ~/Library/Renpy/Game-Name/ which I can confirm.

Not sure that I understand the problem at all, I assume the games creating kind of a signature nowadays which will be added to the save files and later validated from the game? If that's the case, is there a fixed location inside any game where the validation take place? I also wonder why any game where I modified a save file presenting me a dialog notifying me of a modification but ignoring my choice if I say yes load it, kinda useless dialog.
 

dotjeal

New Member
Nov 16, 2020
1
20
If the keys are what's bothering, you can solve it in a few steps.
Beware it permanently revokes security keys. Do at your own risk
Buckle-up it might be rocket science for some.

1 - Open the security_keys.txt (%appdata%\roaming\renpy\tokens) and remove both the keys contents (not their header, only the characters string).
2 - Save
3 - make the file read-only (right-click, properties, read-only checkbox, OK).
5 - Run your game and load your savegame
6 - Facepalm (optional)
7 - Enjoy
 
Last edited:

WuzzyFuzzy

Well-Known Member
Jan 23, 2020
1,559
3,163
I failed to mention this earlier, but another good tool to manipulate your variables and play around in game without using a save editor is 0x52's Universal Ren'Py mod. It can be found here: Universal Ren'Py mod

Thanks for all the replies.
 
  • Like
Reactions: dotjeal

derfirm

Newbie
Jan 9, 2021
34
102
derfirm
Hey,
I need some help with 2) on my whole machine there is no "security_keys.txt" I've searched in the save location and anywhere else. I'm using Renpy 8.1.1 on OSX Ventura, so my save path should be in ~/Library/Renpy/Game-Name/ which I can confirm.

Not sure that I understand the problem at all, I assume the games creating kind of a signature nowadays which will be added to the save files and later validated from the game? If that's the case, is there a fixed location inside any game where the validation take place? I also wonder why any game where I modified a save file presenting me a dialog notifying me of a modification but ignoring my choice if I say yes load it, kinda useless dialog.
Hello - by default Renpy use specific path to store tokens `renpy.__main__.path_to_saves(renpy.config.gamedir, "tokens")`, so please try to find what path is related to MacOS and token should be here.

Each game trying to create secure token by default and sign savegame with it, this is why editors "corrupt" savefile and renpy won't work with this files anymore.
 
  • Like
Reactions: stOrM!

stOrM!

Newbie
Sep 23, 2019
48
20
Ok, thanx for explanation, that's what I thought. Still can't find any tokens on this machine, but I don't bother, will use the console in future that should work for sure.
 

WuzzyFuzzy

Well-Known Member
Jan 23, 2020
1,559
3,163
I have edited the OP to reflect information I have learned from your posts and my research.
 

Pinsel

Active Member
Dec 25, 2019
821
729
my solution was this:




In the game folder, where you can find the exe. There is a other folder "renpy".
Open it, search for the "savetoken.py" open it with the simple texteditor, and then look for this:


def verify_data(data, signatures, check_verifying=True):
"""
Verifies that `data` has been signed by the keys in `signatures`.
"""

for i in signatures.splitlines():
kind, key, sig = decode_line(i)

if kind == "signature":

if key is None:
continue

if check_verifying and key not in verifying_keys:
continue

try:
vk = ecdsa.VerifyingKey.from_der(key)
if vk.verify(sig, data):
return True
except Exception:
continue

return False



chance the last entry to "True" save , restart the game and then your edited save will work. Testet this with the
The Builder [Ep.5 B2] [LewdRobotics]
 
Last edited:

Seeps

New Member
Jan 3, 2020
3
17
If the keys are what's bothering, you can solve it in a few steps.
Beware it permanently revokes security keys. Do at your own risk
Buckle-up it might be rocket science for some.

1 - Open the security_keys.txt (%appdata%\roaming\renpy\tokens) and remove both the keys contents (not their header, only the characters string).
2 - Save
3 - make the file read-only (right-click, properties, read-only checkbox, OK).
5 - Run your game and load your savegame
6 - Facepalm (optional)
7 - Enjoy
Legend!
 
  • Like
Reactions: vilewe7570

sakuzuda

Member
Nov 24, 2021
129
134
small question, how about people who using joiplay to play renpy games that doesn't had android version?