예제 #1
0
        private void WriteStringBlock(IStream stream)
        {
            StructureLayout headerLayout = _buildInfo.Layouts.GetLayout("header");

            if (!headerLayout.HasField("string block offset"))
            {
                return;
            }

            var segment = StringArea.Segments[0];

            int newSize = _stringIDs.Count * 0x80;

            if (segment.ActualSize < newSize)
            {
                segment.Resize(newSize, stream);
            }

            stream.SeekTo(segment.Offset);

            for (int i = 0; i < _stringIDs.Count; i++)
            {
                byte[] data       = new byte[0x80];
                byte[] stringData = System.Text.Encoding.UTF8.GetBytes(_stringIDs.GetString(i));

                Array.Copy(stringData, 0, data, 0, stringData.Length > 0x80 ? 0x80 : stringData.Length);
                stream.WriteBlock(data);
            }
        }
예제 #2
0
        private void WriteStringBlock(IStream stream)
        {
            var segment = StringArea.Segments[0];

            int newSize = _stringIDs.Count * 0x80;

            if (segment.ActualSize < newSize)
            {
                segment.Resize(newSize, stream);
            }

            stream.SeekTo(segment.Offset);

            for (int i = 0; i < _stringIDs.Count; i++)
            {
                byte[] data       = new byte[0x80];
                byte[] stringData = System.Text.Encoding.UTF8.GetBytes(_stringIDs.GetString(i));

                Array.Copy(stringData, 0, data, 0, stringData.Length > 0x80 ? 0x80 : stringData.Length);
                stream.WriteBlock(data);
            }
        }