コード例 #1
0
 private void Init(Stream input)
 {
     using (var br = new BinaryReader(input))
     {
         Header.Read(br);
         if (!Functions.CompareBytes(Header.Magic, new byte[] { 0, 0x50, 0x53, 0x46 }))
         {
             throw new Exception("Invalid PARAM.SFO Header Magic");
         }
         var tables = new List <index_table>();
         for (var i = 0; i < Header.IndexTableEntries; i++)
         {
             var t = new index_table();
             t.Read(br);
             tables.Add(t);
         }
         var xtables = new List <Table>();
         var count   = 0;
         foreach (var t in tables)
         {
             var x = new Table();
             x.index      = count;
             x.Indextable = t;
             x.Name       = ReadName(br, t);
             x.Value      = ReadValue(br, t);
             count++;
             xtables.Add(x);
         }
         Tables = xtables.ToArray();
         br.Close();
     }
 }
コード例 #2
0
 /// <summary>
 /// Start Reading the Parameter file
 /// </summary>
 /// <param name="input">Input Stream</param>
 private void Init(Stream input)
 {
     using (var br = new BinaryReader(input))
     {
         Header.Read(br);
         var tables = new List <index_table>();
         for (int i = 0; i < Header.IndexTableEntries; i++)
         {
             var t = new index_table();
             t.Read(br);
             tables.Add(t);
         }
         var xtables = new List <Table>();
         int count   = 0;
         foreach (index_table t in tables)
         {
             var x = new Table();
             x.index      = count;
             x.Indextable = t;
             x.Name       = ReadName(br, t);
             x.Value      = ReadValue(br, t);
             count++;
             xtables.Add(x);
         }
         Tables = xtables;
         br.Close();
     }
 }
コード例 #3
0
ファイル: PARAM_SFO.cs プロジェクト: Hector-Ab/PeXploit
 private void Init(Stream input)
 {
     using (var br = new BinaryReader(input))
     {
         Header.Read(br);
         if (!Functions.CompareBytes(Header.Magic, new byte[] {0, 0x50, 0x53, 0x46}))
             throw new Exception("Invalid PARAM.SFO Header Magic");
         var tables = new List<index_table>();
         for (int i = 0; i < Header.IndexTableEntries; i++)
         {
             var t = new index_table();
             t.Read(br);
             tables.Add(t);
         }
         var xtables = new List<Table>();
         int count = 0;
         foreach (index_table t in tables)
         {
             var x = new Table();
             x.index = count;
             x.Indextable = t;
             x.Name = ReadName(br, t);
             x.Value = ReadValue(br, t);
             count++;
             xtables.Add(x);
         }
         Tables = xtables.ToArray();
         br.Close();
     }
 }