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

Gamerxxx

Well-Known Member
OP
Member
Joined
Oct 18, 2018
Messages
326
Trophies
0
Age
46
XP
1,203
Country
Chile
Is it possible to transfer a save data of sword art online hollow realization deluxe edition from pc to nintendo switch?
 

DrYoshi

Well-Known Member
Newcomer
Joined
May 1, 2019
Messages
82
Trophies
0
Age
27
XP
477
Country
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.
 
  • Like
Reactions: Gamerxxx

Falo

Well-Known Member
Member
Joined
Jul 22, 2012
Messages
680
Trophies
2
XP
2,627
Country
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,

wangch

Well-Known Member
Member
Joined
Apr 12, 2019
Messages
132
Trophies
0
Age
30
XP
429
Country
United States
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
Thank you, but I can't understand. Can you tell me how to do it simply?
 

Falo

Well-Known Member
Member
Joined
Jul 22, 2012
Messages
680
Trophies
2
XP
2,627
Country
Germany
Thank you, but I can't understand. Can you tell me how to do it simply?
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.
 

wangch

Well-Known Member
Member
Joined
Apr 12, 2019
Messages
132
Trophies
0
Age
30
XP
429
Country
United States
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.
thank you very much
 

Gamerxxx

Well-Known Member
OP
Member
Joined
Oct 18, 2018
Messages
326
Trophies
0
Age
46
XP
1,203
Country
Chile
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.
How is this tool used?
 

DrYoshi

Well-Known Member
Newcomer
Joined
May 1, 2019
Messages
82
Trophies
0
Age
27
XP
477
Country
United States
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.
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.
 

wangch

Well-Known Member
Member
Joined
Apr 12, 2019
Messages
132
Trophies
0
Age
30
XP
429
Country
United States
with this tool you could convert the save data for sao hr nintendo switch?
I don't know how to use it.

--------------------- MERGED ---------------------------

[引用=“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.
 

Falo

Well-Known Member
Member
Joined
Jul 22, 2012
Messages
680
Trophies
2
XP
2,627
Country
Germany
How is this tool used?

I don't know how to use it.
When I open this tool, he will show me to press any key to exit.

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...



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.

If the save is 0x80400 byte, then it should be no problem to convert it to pc/switch.
 
  • Like
Reactions: migles and Xnuxer

GothicIII

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
830
Trophies
0
Age
36
XP
2,225
Country
Gambia, The
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

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 :)
 

Falo

Well-Known Member
Member
Joined
Jul 22, 2012
Messages
680
Trophies
2
XP
2,627
Country
Germany
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 :)

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,

Gamerxxx

Well-Known Member
OP
Member
Joined
Oct 18, 2018
Messages
326
Trophies
0
Age
46
XP
1,203
Country
Chile
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".
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,

wangch

Well-Known Member
Member
Joined
Apr 12, 2019
Messages
132
Trophies
0
Age
30
XP
429
Country
United States
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...





If the save is 0x80400 byte, then it should be no problem to convert it to pc/switch.
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
 

Falo

Well-Known Member
Member
Joined
Jul 22, 2012
Messages
680
Trophies
2
XP
2,627
Country
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.
 
  • Like
Reactions: Xnuxer

DrYoshi

Well-Known Member
Newcomer
Joined
May 1, 2019
Messages
82
Trophies
0
Age
27
XP
477
Country
United States
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...





If the save is 0x80400 byte, then it should be no problem to convert it to pc/switch.
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.
 

Attachments

  • sword art online hollow realization vita save.zip
    29 KB · Views: 284

Falo

Well-Known Member
Member
Joined
Jul 22, 2012
Messages
680
Trophies
2
XP
2,627
Country
Germany
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.

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,
  • Like
Reactions: Xnuxer

wangch

Well-Known Member
Member
Joined
Apr 12, 2019
Messages
132
Trophies
0
Age
30
XP
429
Country
United States
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.
It's all right.I still appreciate you very much.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: I'm back