本文整理汇总了C#中System.IO.FileStream.ReadUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# System.IO.FileStream.ReadUInt32方法的具体用法?C# System.IO.FileStream.ReadUInt32怎么用?C# System.IO.FileStream.ReadUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.FileStream
的用法示例。
在下文中一共展示了System.IO.FileStream.ReadUInt32方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PatchFile
static bool PatchFile( string filename, string newFilename )
{
Console.WriteLine( "Reading and copying " + filename + "..." );
using ( var nds = new System.IO.FileStream( newFilename, System.IO.FileMode.Create ) ) {
using ( var ndsSrc = new System.IO.FileStream( filename, System.IO.FileMode.Open ) ) {
Util.CopyStream( ndsSrc, nds, (int)ndsSrc.Length );
ndsSrc.Close();
}
// http://dsibrew.org/wiki/DSi_Cartridge_Header
// arm
Console.WriteLine( "Patching ARM Executables..." );
nds.Position = 0x20;
uint arm9offset = nds.ReadUInt32();
uint arm9entry = nds.ReadUInt32();
uint arm9load = nds.ReadUInt32();
uint arm9size = nds.ReadUInt32();
uint arm7offset = nds.ReadUInt32();
uint arm7entry = nds.ReadUInt32();
uint arm7load = nds.ReadUInt32();
uint arm7size = nds.ReadUInt32();
bool modArm9 = PatchArm9( nds, arm9offset, arm9size );
bool modArm7 = PatchArm7( nds, arm7offset, arm7size );
// overlays
Console.WriteLine( "Patching Overlays..." );
nds.Position = 0x50;
uint arm9overlayoff = nds.ReadUInt32();
uint arm9overlaylen = nds.ReadUInt32();
uint arm7overlayoff = nds.ReadUInt32();
uint arm7overlaylen = nds.ReadUInt32();
bool modOvl9 = PatchOverlay( nds, arm9overlayoff, arm9overlaylen );
bool modOvl7 = PatchOverlay( nds, arm7overlayoff, arm7overlaylen );
nds.Close();
return modArm9 || modArm7 || modOvl9 || modOvl7;
}
}