コード例 #1
0
 public ThirdGenLanguage(ThirdGenLanguageGlobals languageGlobals, StructureValueCollection values, IndexOffsetConverter converter, BuildInformation buildInfo)
 {
     _languageGlobals = languageGlobals;
     _pointerLayout = buildInfo.GetLayout("locale index table entry");
     _encryptionKey = buildInfo.LocaleKey;
     _symbols = buildInfo.LocaleSymbols;
     _converter = converter;
     _pageSize = buildInfo.LocaleAlignment;
     Load(values, converter);
 }
コード例 #2
0
        private IReader DecryptData(IReader reader, Pointer dataLocation, int tableSize, AESKey key)
        {
            // Round the table size to an AES block size
            tableSize = (tableSize + 0xF) & ~0xF;

            reader.SeekTo(dataLocation.AsOffset());
            byte[] data = reader.ReadBlock(tableSize);
            if (key != null)
                data = AES.Decrypt(data, key.Key, key.IV);
            return new EndianReader(new MemoryStream(data), Endian.BigEndian);
        }
コード例 #3
0
        public ThirdGenStringTable(IReader reader, int count, int tableSize, Pointer indexTableLocation, Pointer dataLocation, AESKey key)
        {
            int[] offsets = ReadOffsets(reader, indexTableLocation, count);
            IReader stringReader = DecryptData(reader, dataLocation, tableSize, key);

            // Read each string
            stringReader.SeekTo(0);
            for (int i = 0; i < offsets.Length; i++)
            {
                stringReader.SeekTo(offsets[i]);
                _strings.Add(stringReader.ReadAscii());
            }
        }
コード例 #4
0
 public BuildInformation(string game, string localeKey, string stringidKey, IStringIDResolver stringIDResolver, string filenameKey, int headerSize, bool loadStrings, string layoutFile, string shortName, string pluginFolder, string scriptDefsFile, int localeAlignment)
 {
     _gameName = game;
     if (localeKey != null)
         _localeKey = new AESKey(localeKey);
     if (stringidKey != null)
         _stringidKey = new AESKey(stringidKey);
     _stringIDResolver = stringIDResolver;
     if (filenameKey != null)
         _filenameKey = new AESKey(filenameKey);
     _headerSize = headerSize;
     _loadStrings = loadStrings;
     _layoutFile = layoutFile;
     _shortName = shortName;
     _pluginFolder = pluginFolder;
     _scriptDefsFile = scriptDefsFile;
     _localeAlignment = localeAlignment;
 }