コード例 #1
0
ファイル: Collection.cs プロジェクト: naomichan/Bundai
 public void ParseLookup(Binboy bb)
 {
     //int i = 1;
     while (bb.Length > bb.Position)
     {
         string ls = bb.ReadString();
         //We know this specific thing is in fd2658b725421b6d
         //it's 8e377b0745f2fa0a.0.dds, i thinks it has the offset 175582
         //but really it's 45838 (19573 skipping anything without /)
         //total is 129284 (54827)
         //if (ls == "units/payday2/weapons/wpn_fps_saw_pts/wpn_fps_saw_protection_df") Bandaid.Output(i, ls);
         //++i;
         lookup.Add(ls);
     }
 }
コード例 #2
0
ファイル: Parsers.cs プロジェクト: naomichan/Bundai
        public static byte[] Strings(byte[] array, out string newExt)
        {
            ArrayList idxH = new ArrayList();

            Binboy bb = new Binboy(array);
            newExt = "csv";
            if (!bb.Open()) return array;
            for (int i = 0; i < 10; ++i) idxH.Add(bb.ReadBytes(4));
            try
            {
                int total = idxH.Count < 3 ? 0 : BitConverter.ToInt32((byte[])idxH[2], 0);
                for (int i = 0; i < total; ++i)
                {
                    bb.ReadBytes(8);
                    bb.ReadBytes(4);
                    bb.ReadBytes(4);
                    bb.ReadBytes(8);
                    //useless header stuff
                }
                int x = 1;
                MemoryStream memstream = new MemoryStream();
                using (StreamWriter sw = new StreamWriter(memstream))
                {
                    while (bb.Length > bb.Position)
                    {
                        string[] data = new string[2] { Binboy.ToByteString(BitConverter.GetBytes((int)bb.Position)), bb.ReadString() };
                        if (bb.Length <= bb.Position) break;
                        if (data[1].Length == 0) continue;
                        sw.WriteLine("{0},{1}", x, data[1]);
                        ++x;
                    }
                }
                return memstream.ToArray();
            }
            catch (Exception e)
            {
                return array;
            }
        }