Fix ARM9 footer.

This commit is contained in:
Admiral H. Curtiss
2014-05-30 18:58:08 +02:00
parent d50f24fcf2
commit 8cd1e3c8e1

View File

@@ -140,25 +140,25 @@ namespace WfcPatcher {
int newSize = data.Length;
int diff = (int)len - newSize;
/*
// copy back footer
if ( diff > 0 ) {
List<byte> footer = new List<byte>();
nds.Position = pos + len;
while ( nds.PeekUInt32() != 0xFFFFFFFF ) {
for ( int i = 0; i < 4; ++i ) { footer.Add( (byte)nds.ReadByte() ); }
if ( nds.PeekUInt32() == 0xDEC00621 ) {
for ( int j = 0; j < 12; ++j ) {
footer.Add( (byte)nds.ReadByte() );
}
nds.Position = pos + newSize;
nds.Write( footer.ToArray(), 0, footer.Count );
}
nds.Position = pos + newSize;
nds.Write( footer.ToArray(), 0, footer.Count );
// padding
for ( int j = 0; j < diff; ++j ) {
nds.WriteByte( 0xFF );
}
}
// padding
for ( int j = 0; j < diff; ++j ) {
nds.WriteByte( 0xFF );
}
*/
// write new size
byte[] newSizeBytes = BitConverter.GetBytes( newSize );
nds.Position = 0x2C;