private static bool GetAsciiKey(NANDReader reader, int offset, out string key) { Debug.SendDebug("Grabbing ASCII Key @ 0x{0:X}", offset); key = null; reader.Lba = (uint)(offset / 0x4000); if (offset % 0x4000 > 0) { reader.Seek(offset % 0x4000, SeekOrigin.Current); } //reader.Seek(offset, SeekOrigin.Begin); var tmp = reader.ReadBytes(0x10); try { key = Encoding.ASCII.GetString(tmp); try { CpukeyUtils.VerifyCpuKey(key); return(true); } catch (X360UtilsException ex) { Debug.SendDebug(ex.ToString()); return(false); } } catch { return(false); } }
private static bool GetByteKey(NANDReader reader, int offset, out byte[] key) { Debug.SendDebug("Grabbing Byte Key @ 0x{0:X}", offset); reader.Lba = (uint)(offset / 0x4000); if (offset % 0x4000 > 0) { reader.Seek(offset % 0x4000, SeekOrigin.Current); } //reader.Seek(offset, SeekOrigin.Begin); key = reader.ReadBytes(0x10); try { CpukeyUtils.VerifyCpuKey(ref key); return(true); } catch (X360UtilsException ex) { Debug.SendDebug(ex.ToString()); return(false); } }