Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save class usage #48

Open
shadow2560 opened this issue Aug 7, 2021 · 5 comments
Open

Save class usage #48

shadow2560 opened this issue Aug 7, 2021 · 5 comments

Comments

@shadow2560
Copy link

I have a problem to understand how the save class work. I have a code like that (SYSTEM partition is already mounted, the save file exists and Minerva is used):

save = readsave("bis:/save/8000000000000050")
save_file = save.read("file")

When the "save.read("file")" command is executed, the script exit with an error so I think I don't understand how the path in the save work so I need your help... again.

@suchmememanyskill
Copy link
Owner

save.read's first argument always starts with a /. Thus if a file called file existed on the root of the save, then /file would work

@shadow2560
Copy link
Author

OK, this seems to be my issue.

Now second problem, I want to modify the save to replace the byte in position 0x29484 of the "/file" file of the save (this is used to bypass the first configuration menu) but again I think I miss something.

save = readsave("bis:/save/8000000000000050")
save_file = save.read("/file")
byte_test = ["BYTE[]",0x01]
save_file[0x29484] = byte_test[0]
save.write("/file", save_file)
save.commit()
save = 0
save_file = 0

Even when I remove the line "save_file[0x29484] = byte_test[0]" (I don't know if I use it correctly here) the save doesn't work and the console doesn't launch anymore; but without this line this should rewrite the save with the same content so I don't understand something again.

@suchmememanyskill
Copy link
Owner

Looking at the output, it corrupts the save. I currently don't have a lot of time, but i'll take a proper look when i do

@suchmememanyskill
Copy link
Owner

looking further into this, the error happens here https://github.com/suchmememanyskill/TegraExplorer/blob/master/source/script/saveClass.c#L34

Seemingly save_data_file_write cannot take the amount of bytes being written to it (which is about 0.5mb)

@shadow2560
Copy link
Author

OK, thanks for the info, I will wait a fix if this can be fixed cause I'm not enough experimented to fix it by myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants