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;
}
Thank you, but I can't understand. Can you tell me how to do it simply?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
My info is only useful to make a save editor/converter, you can't do it manually.Thank you, but I can't understand. Can you tell me how to do it simply?
thank you very muchMy 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.
with this tool you could convert the save data for sao hr nintendo switch?thank you very much
How is this tool used?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.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.
I don't know how to use it.with this tool you could convert the save data for sao hr nintendo switch?
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.
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.
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
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;
}
I could convert this save data from SAO HR pc to Switch, please, I could not do it.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 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 versionJust 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 isJust 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.
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?
}
It's all right.I still appreciate you very much.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.