NULL

Question Is it possible to transfer a save data of "SAO HR DE" from pc to nintendo switch?

Discussion in 'Switch - ROM Hacking, Saves, Translations & Tools' started by Gamerxxx, May 7, 2019.

  1. Gamerxxx
    OP

    Gamerxxx Advanced Member

    Newcomer
    2
    Oct 18, 2018
    Chile
    Is it possible to transfer a save data of sword art online hollow realization deluxe edition from pc to nintendo switch?
     
  2. wangch

    wangch Member

    Newcomer
    1
    Apr 12, 2019
    United States
    I tried, but it didn't seem to work.
     
  3. DrYoshi

    DrYoshi Member

    Newcomer
    1
    May 1, 2019
    United States
    I'm interested too. But in my case it would be the US vita version save file trying to work with the switch version. Though I was waiting for the US version of the game to be released this month. I figured there would be more of a chance of it being successful with the US version and not the Asia version.
     
    Gamerxxx likes this.
  4. Falo

    Falo GBAtemp Fan

    Member
    7
    Jul 22, 2012
    Germany
    It is possible, savegames are identical, but the hash values are different.

    system.bin has only 1 hash, sha1 from 0x0 - 0x124, with the first 0x14 byte overwritten with 0x00
    gameXX.bin has 2 hashs

    0x0 = sha1
    0x78F10 = custom hash algo

    the first hash is identical to system.bin, but 0x0 - 0x14 and 0x78F10 - 0x78F18 need to be overwritten with 0x00

    the second hash is a simple xor+multiply algo:

    C# sample code:
    Code:
           private ulong CalculateHash2(byte[] data, ulong init, ulong multiplier)
            {
                var hash = init;
    
                for (int i = 0; i < data.Length; i++)
                {
                    hash = multiplier * (hash ^ data[i]);
                }
    
                return hash;
            }
    Switch:
    init = 0xA7E58677CC302AF8u
    multiplier = 0xD85FCD9BE08D1u

    PC:
    init = 0xD2355296BBD59289u
    multiplier = 0x1B9C3B918F638Fu
     
    Last edited by Falo, May 8, 2019
    migles, Xnuxer, Ericthegreat and 4 others like this.
  5. wangch

    wangch Member

    Newcomer
    1
    Apr 12, 2019
    United States
    Thank you, but I can't understand. Can you tell me how to do it simply?
     
  6. Falo

    Falo GBAtemp Fan

    Member
    7
    Jul 22, 2012
    Germany
    My info is only useful to make a save editor/converter, you can't do it manually.

    But since it's so easy to make a simple tool:
    https://www.dropbox.com/s/ljm8siqhi9g4gsd/SAO_HR_SaveConverter.zip?dl=0

    Usage:
    SaveConverter.exe pc <path_to_gameXX.bin>
    SaveConverter.exe switch <path_to_gameXX.bin>

    It works both, as save converter and hash calculator, so you can edit the save via hex editor.

    Note: I did only test this on PC, not on Switch, i'm not wasting my time with the asia version, when the english version is almost here.
     
    migles, Xnuxer, Ericthegreat and 3 others like this.
  7. wangch

    wangch Member

    Newcomer
    1
    Apr 12, 2019
    United States
    thank you very much
     
  8. Gamerxxx
    OP

    Gamerxxx Advanced Member

    Newcomer
    2
    Oct 18, 2018
    Chile
    with this tool you could convert the save data for sao hr nintendo switch?
     
  9. Gamerxxx
    OP

    Gamerxxx Advanced Member

    Newcomer
    2
    Oct 18, 2018
    Chile
    How is this tool used?
     
  10. DrYoshi

    DrYoshi Member

    Newcomer
    1
    May 1, 2019
    United States
    That's what I figured also. The US release would probably be easier to deal with. If I were to dump my vita save could you take a look at it at some point and see if it could be converted to the US switch version when it is released? Sorry for the trouble.
     
  11. wangch

    wangch Member

    Newcomer
    1
    Apr 12, 2019
    United States
    I don't know how to use it.

    — Posts automatically merged - Please don't double post! —

    [引用=“Falo,POST:8628803,会员:310561”]我的信息只用于制作一个保存编辑器/转换器,您不能手动完成。

    But since it's so easy to make a simple tool:
    https://www.dropbox.com/s/ljm8siqhi9g4gsd/SAO_HR_SaveConverter.zip?dl=0

    Usage:
    SaveConverter.exe pc <path_to_gameXX.bin>
    SaveConverter.exe switch <path_to_gameXX.bin>

    It works both, as save converter and hash calculator, so you can edit the save via hex editor.

    Note: I did only test this on PC, not on Switch, i'm not wasting my time with the asia version, when the english version is almost here.[/QUOTE]
    How to use this tool When I open this tool, he will show me to press any key to exit.
     
  12. Falo

    Falo GBAtemp Fan

    Member
    7
    Jul 22, 2012
    Germany
    Just like any other console style application...

    You open a cmd prompt and enter:
    "SaveConverter.exe pc <path>"
    or
    "SaveConverter.exe switch <path>"
    where <path> is the path to "game00.bin "
    and then the tool will update the hashs...

    If you can't do that, then don't try to modify save games...

    [​IMG]

    If the save is 0x80400 byte, then it should be no problem to convert it to pc/switch.
     
    migles and Xnuxer like this.
  13. GothicIII

    GothicIII GBAtemp Advanced Fan

    Member
    5
    Jan 4, 2015
    Gambia, The
    How did you find that out? I know maths but reverse engineering just with the results is very difficult (many many results needed). Did you use a debugger/re software?

    I would to know this for future projects :)
     
  14. Falo

    Falo GBAtemp Fan

    Member
    7
    Jul 22, 2012
    Germany
    Impossible to figure out just from looking at values.
    IDA Pro + my own tool to convert switch nso's to elf + reverse engineering.

    the hash calculation is in sub_5A6D50 and the pseudo code looks like this:

    Code:
            v40 = 0x803FCLL;
            v41 = 0xA7E58677CC302AF8LL;
            while ( 1 )
            {
              v43 = 0xD85FCD9BE08D1LL
                  * (0xD85FCD9BE08D1LL * (0xD85FCD9BE08D1LL * (v41 ^ *(v39 - 3)) ^ *(v39 - 2)) ^ *(v39 - 1));
              if ( !v40 )
                break;
              v42 = *v39;
              v39 += 4;
              v41 = 0xD85FCD9BE08D1LL * (v43 ^ v42);
              v40 -= 4LL;
            }
    
    finding this function was easy, a sub function of this loads a script command called "SaveLoad".
     
    Last edited by Falo, May 9, 2019
  15. Gamerxxx
    OP

    Gamerxxx Advanced Member

    Newcomer
    2
    Oct 18, 2018
    Chile
    I could convert this save data from SAO HR pc to Switch, please, I could not do it.
    https://drive.google.com/file/d/1XzqMHrGtEVhEnF3UPbeatTjEURHVSgro/view
     
    Last edited by Gamerxxx, May 9, 2019
  16. wangch

    wangch Member

    Newcomer
    1
    Apr 12, 2019
    United States
    I used your method and the tool display turned out to be successful.But switch still doesn't seem to recognize.I'm sorry I'm so dumb.Maybe it's because I'm the Asian version
     
  17. Falo

    Falo GBAtemp Fan

    Member
    7
    Jul 22, 2012
    Germany
    Ok i made some mistakes, i was under the impression, that the savegames are actually identical, this is NOT the case.
    There are some differences.

    PC checks if 0x62408 is >=3, Switch checks if 0x623C8 is >=2
    PC Hash2 is at 0x78F10, Switch Hash2 is at 0x78ED0
    There is a difference of 0x40 byte and i don't know yet what is different.

    You have to wait until the international version releases on the 24.
     
    Xnuxer likes this.
  18. DrYoshi

    DrYoshi Member

    Newcomer
    1
    May 1, 2019
    United States
    I don't know how to check that, I'm pretty much a noob at that at the moment. My vita save is this. Could I trouble you to check if the save is
    0x80400 byte? Sorry for the trouble.
     

    Attached Files:

  19. Falo

    Falo GBAtemp Fan

    Member
    7
    Jul 22, 2012
    Germany
    Both Vita Save and Switch Asia save are identical, they are both Save Version 2.
    PC is Version 3 and has some extra values, here the exact difference: (010 Editor code)

    Code:
    local int version = 0;
    
    if(ReadUInt(0x623C8) == 2)
        version = 2;
    else if(ReadUInt(0x62408) == 3)
        version = 3;
    else
        return;
    
    FSeek(0x42724);
    if(version == 2) //Switch (Asia) or Vita
    {
        ubyte Unk0x42724[0x28]; //-44 byte
        ubyte Unk0x4274C[0x550];
        ubyte Unk0x42C9C[0x50];
        ubyte Unk0x42CEC[0x28];
        ubyte Unk0x42D14[0x3DE0];
        ubyte Unk0x46AF4[0x84]; //padding?, +4 byte
    }
    else //PC
    {
        ubyte Unk0x42724[0x6C];
        ubyte Unk0x42790[0x550];
        ubyte Unk0x42CE0[0x50];
        ubyte Unk0x42D30[0x28];
        ubyte Unk0x42D58[0x3DE0];
        ubyte Unk0x46B38[0x80]; //padding?
    }
    otherwise the saves match.
     
    Last edited by Falo, May 10, 2019
    Xnuxer likes this.
  20. wangch

    wangch Member

    Newcomer
    1
    Apr 12, 2019
    United States
    It's all right.I still appreciate you very much.
     
Loading...