Has anyone been able to get Hyne to work with final fantasy 8 remastered?

Discussion in 'Switch - ROM Hacking, Saves, Translations & Tools' started by doomtrigger, Sep 3, 2019.

  1. AnalogMan

    AnalogMan ultraSuMoFramework Dev

    Member
    12
    Apr 20, 2007
    United States
    For anyone who is comfortable using python I wrote a python 3 script to automate the process:
    Code:
    #!/usr/bin/env python3
    # Author: AnalogMan
    # Modified Date: 2019-09-08
    # Purpose: Injects or extracts FF8 save data to Switch save
    
    import sys, os, argparse
    
    def main():
        print('\n======== FF8 NSW Save Tool ========\n\n')
    
        if sys.version_info <= (3,1,0):
            print('Python version 3.1.x+ needed to run this script.\n\n')
            return 1
    
        # Arg parser for program options
        p = argparse.ArgumentParser(description='Inject or extract FF8 save data to Nintendo Switch save')
        g = p.add_mutually_exclusive_group(required=True)
        p.add_argument('nsw_file', help='Path to Switch save')
        p.add_argument('ff8_file', help='Path to FF8 save')
        g.add_argument('-i', '--inject', action='store_true', help='Inject FF8 save into Switch save')
        g.add_argument('-e', '--extract', action='store_true', help='Extract FF8 save from Switch save')
        # Check passed arguments
        args = p.parse_args()
    
        # Check if required files exist
        if os.path.isfile(args.nsw_file) == False:
            print('Switch save cannot be found\n\n')
            return 1
    
        if args.extract == True:
            try:
                with open(args.nsw_file, 'rb') as nsw:
                    save_len = int.from_bytes(nsw.read(4), byteorder='little')
                    ff8_data = nsw.read(save_len)
                with open(args.ff8_file, 'wb') as ff8:
                    ff8.write(ff8_data)
                print('FF8 save file extracted successfully.\n\n')
            except:
                print('Save could not be extracted.\n\n')
     
        if args.inject == True:
            if os.path.isfile(args.ff8_file) == False:
                print('FF8 save cannot be found\n\n')
                return 1
            try:
                with open(args.ff8_file, 'rb') as ff8:
                    ff8_data = ff8.read()
                with open(args.nsw_file, 'rb+') as nsw:
                    nsw.write((len(ff8_data)).to_bytes(4, byteorder='little'))
                    nsw.write(ff8_data)
                print('FF8 save file injected successfully.\n\n')
            except:
                print('Save could not be injected.\n\n')
     
    if __name__ == "__main__":
        main()
    
    Example usage:
    Extract Switch save with Edizon or Checkpoint (ie. ff8slot00). Place extracted save in same folder as the script.

    Run the script with the following command to extract the FF8 save data:
    Code:
    python nsw2ff8.py -e ff8slot00 save.ff8
    Once you have the save.ff8 file, open it in Hyne and edit it. Or you could use an already existing FF8 save from the PC version or from wherever. When ready to inject it back into the Switch save run
    Code:
    python nsw2ff8.py -i ff8slot00 save.ff8
    Once injected, use Checkpoint or Edizon to import the modified ff8slot00 back into your Switch and enjoy.

    I've tested this out on a few different saves of varying sizes and had no issues. If someone finds a save that fails to import on the Switch, let me know.
     
    Last edited by AnalogMan, Sep 9, 2019
    fizyboy likes this.
  2. fizyboy

    fizyboy Member

    Newcomer
    2
    Nov 4, 2013
    Malaysia
    Pajam
  3. AnalogMan

    AnalogMan ultraSuMoFramework Dev

    Member
    12
    Apr 20, 2007
    United States
    It's a python 3 script. Since Mac's come with python 2 by default to run it as a python 3 script use
    Code:
    python3 nsw2ff8.py -e ff8slot00 save.ff8
     
    fizyboy likes this.
  4. alxrite

    alxrite Member

    Newcomer
    2
    Nov 11, 2018
    United States
    More people are helping out with scripts and such. If you guys are not comfortable with anything and still need help. I can convert PC to Switch or the other way around. Just PM me and I will get back to you!

    @badman112 Here is a NEW save with 100 of each item and cards, except character cards. (Rename from ff8slot00 100itmes to ff8slot00)
    https://drive.google.com/file/d/1NTENbKwju-cz8HkC_VMaIpHvDIR1geSc/view?usp=sharing

    Go to byte 04 (your 2B) Right click and select "Select Block" In the Length box, type 82F. This should select a lot of data and end with a number followed by a lot of 00 00 00 00s
    If not, select all the data up to the beginning of the 00 00 00 00s

    That is your save file. Copy and paste that into a new file. Save it as ff8slot00.ff8. Open and edit it with Hyne, save it. Now open it again in HxD and Select all the info in the ff8slot00.ff8 file. Go back to your ff8slot00 file and paste it into the old file on top of where all the old info was when you did Select Block.

    If done correctly, you will load the file. If the file says the save is damaged then the total save file length is too far off. Come back and I can help.
     
  5. ChristianFlrenss

    ChristianFlrenss Newbie

    Newcomer
    2
    Oct 7, 2012
    Norway
    Ive attached PS4 vrsion of the save. It seems to have a little different structure than the switch one.


    Note that most PS4 saves are in reversed order of hex (little endian). I assume this is no different, and could cause it to be more of a hassle to fix?
     

    Attached Files:

  6. alxrite

    alxrite Member

    Newcomer
    2
    Nov 11, 2018
    United States
    Falo said the following on PS4 saves.

     
  7. ChristianFlrenss

    ChristianFlrenss Newbie

    Newcomer
    2
    Oct 7, 2012
    Norway
    My attached save is decrypted using Save Wizard. I can manually edit it by cross checking stats from pc saves etc, but to make hyne read it is diff. My save is 8kb large. The other one shared was 3.5mb (compressed ps4 format). So you.l find it very decrypted:)
     
  8. alxrite

    alxrite Member

    Newcomer
    2
    Nov 11, 2018
    United States
    Very cool! Good on you! Are you able to import other's PS4 saves into Save Wizard and decrypt them?

    EDIT: I see the file size of the save in your file. But, the whole format is very different.
     
    Last edited by alxrite, Sep 8, 2019
  9. ChristianFlrenss

    ChristianFlrenss Newbie

    Newcomer
    2
    Oct 7, 2012
    Norway
    Not to such an extent. It would have to be decrypted by themselves, as its locked to X number of users per license.
     
  10. AnalogMan

    AnalogMan ultraSuMoFramework Dev

    Member
    12
    Apr 20, 2007
    United States
    Does this look like your file?
    Screen Shot 2019-09-08 at 6.30.55 PM.
     
  11. luigui300

    luigui300 Member

    Newcomer
    1
    Jun 19, 2018
    Mexico
    Thanks my friend for help me out
     
  12. badman112

    badman112 GBAtemp Regular

    Member
    5
    Apr 9, 2008
    Any chance of adding all GF accept odin and 100 of every spell including apocalypse.
     
    Last edited by badman112, Sep 9, 2019
  13. alxrite

    alxrite Member

    Newcomer
    2
    Nov 11, 2018
    United States
    badman112 likes this.
  14. AnalogMan

    AnalogMan ultraSuMoFramework Dev

    Member
    12
    Apr 20, 2007
    United States
    There are more spells in the game than one character can hold, so you’d need to choose some to leave out.
     
    badman112 likes this.
  15. Artemis21

    Artemis21 Member

    Newcomer
    1
    Mar 7, 2018
    Italy
    Theese are my steam saves, I tried to convert them for Switch but in the python script I get "Invalid argument" even though all the files are in the same directory. I'm not used to run pythonn scripts so I might be doing sometching wrong...
     

    Attached Files:

  16. ChristianFlrenss

    ChristianFlrenss Newbie

    Newcomer
    2
    Oct 7, 2012
    Norway
    Thats the one.
    Would be awesome if that could then be reconfigured back to ps4 again, but that might be a hassle?
     
    Last edited by ChristianFlrenss, Sep 9, 2019
  17. AnalogMan

    AnalogMan ultraSuMoFramework Dev

    Member
    12
    Apr 20, 2007
    United States
    We can test. Anything you want me to mod on it? Then I’ll give you the file and you can try putting it back on your PS4.
     
  18. ChristianFlrenss

    ChristianFlrenss Newbie

    Newcomer
    2
    Oct 7, 2012
    Norway
    All items, max stats, Apocalyptica (or whatever the magic is) for Squall. Those should be in different sections enough to be good enough tested :)
     
  19. fizyboy

    fizyboy Member

    Newcomer
    2
    Nov 4, 2013
    Malaysia
    Pajam
    Works perfect! Thank you so much!
     
  20. AnalogMan

    AnalogMan ultraSuMoFramework Dev

    Member
    12
    Apr 20, 2007
    United States
    Here you go. I renamed it for save slot 2, feel free to rename it back if you want.
     

    Attached Files:

Quick Reply
Draft saved Draft deleted
Loading...