mirror of
https://github.com/AdmiralCurtiss/WfcPatcher.git
synced 2026-09-08 03:05:56 -05:00
Fix ARM9 footer.
This commit is contained in:
22
Program.cs
22
Program.cs
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user