private void method_3(Stream stream_0) { int num1 = 0; for (int index = 0; index < this.gclass100_0.GClass101_0.Length - 1; ++index) { num1 += GClass27.smethod_0((int)this.gclass100_0.GClass101_0[index].Size.TotalBytes, 64); } this.gclass108_0.UInt32_0 = (uint)num1 + (uint)(int)this.gclass100_0.GClass101_0[this.gclass100_0.GClass101_0.Length - 1].Size.TotalBytes; byte[] buffer1 = File.ReadAllBytes(this.string_2); byte[] buffer2 = File.ReadAllBytes(this.string_0); byte[] numArray = File.ReadAllBytes(this.string_1); GClass99.smethod_7(numArray, GEnum3.const_3); this.gclass108_0.UInt32_2 = (uint)(484 + this.gclass100_0.GClass101_0.Length * 36); this.gclass108_0.UInt32_1 = 0U; stream_0.Seek(0L, SeekOrigin.Begin); this.gclass108_0.method_0(stream_0); stream_0.Seek((long)GClass27.smethod_0((int)stream_0.Position, 64), SeekOrigin.Begin); stream_0.Write(buffer2, 0, buffer2.Length); stream_0.Seek((long)GClass27.smethod_0((int)stream_0.Position, 64), SeekOrigin.Begin); stream_0.Write(numArray, 0, numArray.Length); stream_0.Seek((long)GClass27.smethod_0((int)stream_0.Position, 64), SeekOrigin.Begin); stream_0.Write(buffer1, 0, (int)this.gclass108_0.UInt32_2); byte[] buffer3 = new byte[4096]; long num2 = 0; foreach (GClass101 gclass101_0 in this.gclass100_0.GClass101_0) { stream_0.Seek((long)GClass27.smethod_0((int)stream_0.Position, 64), SeekOrigin.Begin); using (FileStream fileStream = File.OpenRead(this.method_2(gclass101_0))) { int count; do { count = fileStream.Read(buffer3, 0, buffer3.Length); stream_0.Write(buffer3, 0, count); num2 += (long)count; }while (count > 0); } this.method_4((int)((double)num2 / (double)this.gclass108_0.UInt32_0 * 100.0)); } while (stream_0.Position % 64L != 0L) { stream_0.WriteByte((byte)0); } }
private static bool smethod_10(GClass30 gclass30_0, GClass101 gclass101_0, byte[] byte_1) { string str = Path.Combine(gclass30_0.OutputPath, gclass101_0.ContentId.ToString("x8") + ".app"); byte[] numArray = Class85.smethod_9(gclass101_0.Index); byte[] byte_0; if (gclass30_0.System != SystemType.SystemWiiU && gclass30_0.System != SystemType.SystemWii) { if (gclass30_0.System != SystemType.System3DS) { throw new NotImplementedException(); } byte_0 = Class85.smethod_3(str, byte_1, numArray); } else { byte[] array = File.ReadAllBytes(str); Array.Resize <byte>(ref array, GClass27.smethod_0(array.Length, 16)); byte_0 = SHA1.Create().ComputeHash(Class85.smethod_5(array, byte_1, numArray), 0, (int)gclass101_0.ContentSize.TotalBytes); } return(GClass27.smethod_1(byte_0, gclass101_0.Hash)); }