public virtual int sceNpDrmEdataSetupKey(int edataFd) { // Return an error if the key has not been set. // Note: An empty key is valid, as long as it was set with sceNpDrmSetLicenseeKey. if (!NpDrmKeyStatus) { return(SceKernelErrors.ERROR_NPDRM_NO_K_LICENSEE_SET); } IoInfo info = Modules.IoFileMgrForUserModule.getFileIoInfo(edataFd); if (info == null) { return(-1); } int result = 0; // Check if the DLC decryption is enabled if (!DisableDLCStatus) { IVirtualFile vFile = info.vFile; if (vFile == null && info.readOnlyFile != null) { vFile = new SeekableDataInputVirtualFile(info.readOnlyFile); } PGDVirtualFile pgdFile = new EDATVirtualFile(vFile); if (pgdFile.Valid) { info.vFile = pgdFile; } } return(result); }
public virtual int sceNpDrmEdataGetDataSize(int edataFd) { IoInfo info = Modules.IoFileMgrForUserModule.getFileIoInfo(edataFd); int size = 0; if (info != null) { if (info.vFile != null) { size = (int)info.vFile.Length(); } else if (info.readOnlyFile != null) { try { size = (int)info.readOnlyFile.Length(); } catch (IOException e) { Console.WriteLine("sceNpDrmEdataGetDataSize", e); } } } return(size); }
private int LoadLogFile(string LogFilePath) { StreamReader Reader = new StreamReader(LogFilePath); string IoInfo, IoType; szDIIO.Clear(); szDOIO.Clear(); szAllHeadersTime.Clear(); szDIHeadersTime.Clear(); szDOHeadersTime.Clear(); while (true) { IoInfo = Reader.ReadLine(); if (string.IsNullOrEmpty(IoInfo)) { return(0); } IoType = IoInfo.Substring(24, 2); if (IoType == "DI" || IoType == "DO") { szAllHeadersTime.Add(IoInfo.Substring(11, 12)); } if (IoType == "DI") { szDIIO.Add(IoInfo.Substring(27)); szDIHeadersTime.Add(IoInfo.Substring(11, 12)); } else if (IoType == "DO") { szDOIO.Add(IoInfo.Substring(27)); szDOHeadersTime.Add(IoInfo.Substring(11, 12)); } } }