mirror of
https://github.com/codestation/mhtools
synced 2024-12-05 01:19:28 +00:00
Dump savedata hash to file
This commit is contained in:
parent
d88317ebd2
commit
de17430656
1 changed files with 7 additions and 1 deletions
|
@ -67,11 +67,17 @@ public class KirkCypher implements GameKeys {
|
||||||
fd.seek(0);
|
fd.seek(0);
|
||||||
System.out.println("Encrypting savedata (KIRK engine): " + byte_bt.length + " bytes");
|
System.out.println("Encrypting savedata (KIRK engine): " + byte_bt.length + " bytes");
|
||||||
System.out.println("Gamekey: " + getHex(gamekey));
|
System.out.println("Gamekey: " + getHex(gamekey));
|
||||||
byte out[] = new CryptoEngine().EncryptSavedata(byte_bt, byte_bt.length, gamekey, 0);
|
CryptoEngine ce = new CryptoEngine();
|
||||||
|
byte out[] = ce.EncryptSavedata(byte_bt, byte_bt.length, gamekey, 0);
|
||||||
fd.write(out);
|
fd.write(out);
|
||||||
fd.setLength(out.length);
|
fd.setLength(out.length);
|
||||||
fd.close();
|
fd.close();
|
||||||
System.out.println("Finished (" + out.length + " bytes)");
|
System.out.println("Finished (" + out.length + " bytes)");
|
||||||
|
byte hash[] = ce.UpdateSavedataHashes(out, out.length, 0);
|
||||||
|
RandomAccessFile hashfd = new RandomAccessFile("hash.bin", "rw");
|
||||||
|
hashfd.write(hash);
|
||||||
|
hashfd.close();
|
||||||
|
System.out.println("Hash saved to hash.bin");
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
Loading…
Reference in a new issue