mirror of
https://github.com/codestation/mhtools
synced 2024-11-10 05:44:17 +00:00
KirkCypher: rollback the hash calculation for now.
This commit is contained in:
parent
0dd3d0518a
commit
ff05c55874
2 changed files with 3 additions and 10 deletions
|
@ -36,13 +36,11 @@ public class KirkCypher extends MHUtils implements GameKeys {
|
|||
fd.seek(0);
|
||||
System.out.println("Decrypting savedata (KIRK engine): " + byte_bt.length + " bytes");
|
||||
System.out.println("Gamekey: " + getHex(gamekey));
|
||||
byte hash[] = new byte[0x10];
|
||||
byte out[] = new CryptoEngine().DecryptSavedata(byte_bt, byte_bt.length, gamekey, 0, hash);
|
||||
byte out[] = new CryptoEngine().DecryptSavedata(byte_bt, byte_bt.length, gamekey, 0);
|
||||
fd.write(out);
|
||||
fd.setLength(out.length);
|
||||
fd.close();
|
||||
System.out.println("Finished (" + out.length + " bytes)");
|
||||
System.out.println("Hash: " + getHex(hash));
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -2395,7 +2395,7 @@ public class CryptoEngine {
|
|||
return retsize;
|
||||
}
|
||||
|
||||
public byte[] DecryptSavedata(byte[] inbuf, int size, byte[] key, int mode, byte hash[]) {
|
||||
public byte[] DecryptSavedata(byte[] inbuf, int size, byte[] key, int mode) {
|
||||
// Setup the crypto and keygen modes and initialize both context structs.
|
||||
int sdEncMode = 0;
|
||||
int sdGenMode = 2;
|
||||
|
@ -2426,11 +2426,6 @@ public class CryptoEngine {
|
|||
hleSdRemoveValue(ctx2, outbuf, alignedSize - 0x10);
|
||||
hleSdSetMember(ctx1, outbuf, alignedSize - 0x10);
|
||||
|
||||
if(hash != null) {
|
||||
byte buf[] = new byte[0x10 + 0x14];
|
||||
hleSdGetLastIndex(ctx2, hash, buf);
|
||||
}
|
||||
|
||||
return outbuf;
|
||||
}
|
||||
|
||||
|
@ -2564,4 +2559,4 @@ public class CryptoEngine {
|
|||
// Call the SD functions.
|
||||
hleDrmBBCipherFinal(pgdCipherContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue