コード例 #1
0
ファイル: RepackPAC.cs プロジェクト: descatal/FBRepacker
 private void parseAdditionalInfo(additionalInfo additionalInfoFlag, string[] newFileInfos, int fileNo, string header)
 {
     if (additionalInfoFlag.HasFlag(additionalInfo.EIDX))
     {
         repackEIDX.parseEIDXInfo(newFileInfos, fileNo, header);
     }
 }
コード例 #2
0
ファイル: ExtractPAC.cs プロジェクト: descatal/FBRepacker
        private void writeExtraFileInfo(int FHM_file_Index, additionalInfo additionalInfoFlag, int FHMFileNumber)
        {
            if (additionalInfoFlag.HasFlag(additionalInfo.EIDX) && EIDXFileInfo != null)
            {
                if (!EIDXFileInfo.ContainsKey(FHM_file_Index))
                {
                    throw new Exception(FHM_file_Index + " does not exist in EIDXFileInfo!");
                }

                appendPACInfo("EIDX_Index: " + FHM_file_Index);
                appendPACInfo("EIDX_Name: " + EIDXFileInfo[FHM_file_Index]);
            }

            if (additionalInfoFlag.HasFlag(additionalInfo.SOUNDNAME) && STREAM_Name_FileInfo.Count != 0)
            {
                appendPACInfo("Number of Sound Hashes: " + STREAM_Name_FileInfo.Count);
                for (int i = 1; i <= STREAM_Name_FileInfo.Count; i++)
                {
                    string[] names = STREAM_Name_FileInfo[i];

                    appendPACInfo("#SoundHash: " + i);

                    for (int j = 0; j < names.Length; j++)
                    {
                        string name         = names[j];
                        var    arrayOfBytes = Encoding.ASCII.GetBytes(name);

                        var    crc32 = new Crc32();
                        string hash  = crc32.Get(arrayOfBytes).ToString("X");

                        if (j == 0)
                        {
                            appendPACInfo("Name: " + name);
                            appendPACInfo("Hash: " + hash);
                        }
                        else
                        {
                            appendPACInfo("FileName: " + name);
                            appendPACInfo("FileHash: " + hash);
                        }
                    }
                }
            }
        }