private byte[] calculateBlockKey(int blk, NPD npd) { byte[] baseKey = (npd.getVersion() <= 1) ? (new byte[0x10]) : npd.getDevHash(); byte[] result = new byte[0x10]; ConversionUtils.arraycopy(baseKey, 0, result, 0, 0xC); result[0xC] = (byte)(blk >> 24 & 0xFF); result[0xD] = (byte)(blk >> 16 & 0xFF); result[0xE] = (byte)(blk >> 8 & 0xFF); result[0xF] = (byte)(blk & 0xFF); return(result); }
private byte[] calculateBlockKey(int blk, NPD npd) { byte[] src = (npd.getVersion() <= 1L) ? new byte[0x10] : npd.getDevHash(); byte[] dest = new byte[0x10]; ConversionUtils.arraycopy(src, 0, dest, 0L, 12); dest[12] = (byte)((blk >> 0x18) & 0xff); dest[13] = (byte)((blk >> 0x10) & 0xff); dest[14] = (byte)((blk >> 8) & 0xff); dest[15] = (byte)(blk & 0xff); return(dest); }
private byte[] getKey(NPD npd, EDATData data, byte[] devKLic, byte[] keyFromRif) { byte[] output = null; if ((data.getFlags() & FLAG_SDAT) != 0L) { output = new byte[0x10]; ToolsImpl.XOR(output, npd.getDevHash(), EDATKeys.SDATKEY); return(output); } if (npd.getLicense() == 3L) { return(devKLic); } if (npd.getLicense() == 2L) { output = keyFromRif; } return(output); }
private byte[] getKey(NPD npd, EDATData data, byte[] devKLic, byte[] keyFromRif) { byte[] result = null; if ((data.getFlags() & FLAG_SDAT) != 0) { //Case SDAT result = new byte[0x10]; ToolsImpl.XOR(result, npd.getDevHash(), EDATKeys.SDATKEY); } else { //Case EDAT if (npd.getLicense() == 0x03) { result = devKLic; } else if (npd.getLicense() == 0x02) { result = keyFromRif; } } return(result); }
private byte[] getKey(NPD npd, EDATData data, byte[] devKLic, byte[] keyFromRif) { byte[] output = null; if ((data.getFlags() & FLAG_SDAT) != 0L) { output = new byte[0x10]; ToolsImpl.XOR(output, npd.getDevHash(), EDATKeys.SDATKEY); return output; } if (npd.getLicense() == 3L) { return devKLic; } if (npd.getLicense() == 2L) { output = keyFromRif; } return output; }
private byte[] calculateBlockKey(int blk, NPD npd) { byte[] src = (npd.getVersion() <= 1L) ? new byte[0x10] : npd.getDevHash(); byte[] dest = new byte[0x10]; ConversionUtils.arraycopy(src, 0, dest, 0L, 12); dest[12] = (byte) ((blk >> 0x18) & 0xff); dest[13] = (byte) ((blk >> 0x10) & 0xff); dest[14] = (byte) ((blk >> 8) & 0xff); dest[15] = (byte) (blk & 0xff); return dest; }