From de17430656827cfcaf8e04b5d60c8bd7dd648504 Mon Sep 17 00:00:00 2001 From: codestation Date: Sun, 24 Jul 2011 13:24:02 -0430 Subject: [PATCH] Dump savedata hash to file --- src/crypt/KirkCypher.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/crypt/KirkCypher.java b/src/crypt/KirkCypher.java index 59b9862..bcbe708 100644 --- a/src/crypt/KirkCypher.java +++ b/src/crypt/KirkCypher.java @@ -67,11 +67,17 @@ public class KirkCypher implements GameKeys { fd.seek(0); System.out.println("Encrypting savedata (KIRK engine): " + byte_bt.length + " bytes"); 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.setLength(out.length); fd.close(); 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) { e.printStackTrace(); } catch (IOException e) {