rendered paste body public void Save(string Filename)
{
Stream _Stream = new FileStream(Filename, FileMode.Open, FileAccess.ReadWrite);
try
{
var _Writer = new BinaryWriter(_Stream);
//Time Played
var _TimeStamp = Functions.GenTimeStamp(this.StatsDays, this.StatsHours, this.StatsMins);
_Writer.BaseStream.Seek(2112, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(_TimeStamp.TotalSeconds));
_Writer.BaseStream.Seek(2124, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(_TimeStamp.TotalSeconds));
//The Prestige Level
_Writer.BaseStream.Seek(2068, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsPrestige));
//The XP
_Writer.BaseStream.Seek(2060, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsXP));
//The Score
_Writer.BaseStream.Seek(2076, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsScore));
//The Kills
_Writer.BaseStream.Seek(2080, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsKills));
//The Deaths
_Writer.BaseStream.Seek(2088, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsDeaths));
//The Killstreak
_Writer.BaseStream.Seek(2084, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsKillStreak));
//The Assists
_Writer.BaseStream.Seek(2096, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsAssists));
//The Headshots
_Writer.BaseStream.Seek(2100, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsHeadshots));
//The Wins
_Writer.BaseStream.Seek(2132, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsWins));
//The Losses
_Writer.BaseStream.Seek(2136, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsLosses));
//The Ties
_Writer.BaseStream.Seek(2140, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsTies));
//The Winstreak
_Writer.BaseStream.Seek(2144, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsWinStreak));
//The Hits
_Writer.BaseStream.Seek(2156, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsHits));
//The Misses
_Writer.BaseStream.Seek(2164, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsMisses));
// The Byte Error Routine
if (this.StatsByteError)
{
int _ByteIndex = 8140;
while (_ByteIndex < 8187)
{
_Writer.BaseStream.Seek(_ByteIndex, SeekOrigin.Begin);
_Writer.Write(255);
_ByteIndex++;
}
_ByteIndex = 2069;
while (_ByteIndex < 2076)
{
_Writer.BaseStream.Seek(_ByteIndex, SeekOrigin.Begin);
_Writer.Write(255);
_ByteIndex++;
}
}
else
{
int _ByteIndex = 8140;
while (_ByteIndex < 8187)
{
_Writer.BaseStream.Seek(_ByteIndex, SeekOrigin.Begin);
_Writer.Write("");
_ByteIndex++;
}
_ByteIndex = 2069;
while (_ByteIndex < 2076)
{
_Writer.BaseStream.Seek(_ByteIndex, SeekOrigin.Begin);
_Writer.Write("");
_ByteIndex++;
}
}
// The Unlock Everything's Routine
if (this.StatsUnlock)
{
int _UnlockIndex = 16;
while (_UnlockIndex < 2058)
{
_Writer.BaseStream.Seek(_UnlockIndex, SeekOrigin.Begin);
_Writer.Write(255);
_UnlockIndex++;
}
_UnlockIndex = 2168;
while (_UnlockIndex < 2898)
{
_Writer.BaseStream.Seek(_UnlockIndex, SeekOrigin.Begin);
_Writer.Write(255);
_UnlockIndex++;
}
_UnlockIndex = 3770;
while (_UnlockIndex < 6715)
{
_Writer.BaseStream.Seek(_UnlockIndex, SeekOrigin.Begin);
_Writer.Write(255);
_UnlockIndex++;
}
_UnlockIndex = 6719;
while (_UnlockIndex < 8188)
{
_Writer.BaseStream.Seek(_UnlockIndex, SeekOrigin.Begin);
_Writer.Write(255);
_UnlockIndex++;
}
}
else
{
int _UnlockIndex = 16;
while (_UnlockIndex < 2058)
{
_Writer.BaseStream.Seek(_UnlockIndex, SeekOrigin.Begin);
_Writer.Write("");
_UnlockIndex++;
}
_UnlockIndex = 2168;
while (_UnlockIndex < 2898)
{
_Writer.BaseStream.Seek(_UnlockIndex, SeekOrigin.Begin);
_Writer.Write("");
_UnlockIndex++;
}
_UnlockIndex = 3770;
while (_UnlockIndex < 6715)
{
_Writer.BaseStream.Seek(_UnlockIndex, SeekOrigin.Begin);
_Writer.Write("");
_UnlockIndex++;
}
_UnlockIndex = 6719;
while (_UnlockIndex < 8188)
{
_Writer.BaseStream.Seek(_UnlockIndex, SeekOrigin.Begin);
_Writer.Write("");
_UnlockIndex++;
}
/* !!!HACK!!! - Fix Byte Error if Unlock Everything is Unticked!! !!!HACK!!! */
if (this.StatsByteError)
{
int _ByteIndex;
_ByteIndex = 8140;
while (_ByteIndex < 8187)
{
_Writer.BaseStream.Seek(_ByteIndex, SeekOrigin.Begin);
_Writer.Write(255);
_ByteIndex++;
}
}
}
/* !!!HACK!!! Fix XP/Score if ByteError/Unlock Everything is Ticked !!!HACK!!! */
if (this.StatsByteError || this.StatsUnlock)
{
_Writer.BaseStream.Seek(2060, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsXP));
_Writer.BaseStream.Seek(2076, SeekOrigin.Begin);
_Writer.Write(Convert.ToInt32(this.StatsScore));
}
}
catch (IOException ex)
{
this.FireSaveStatsError(ex.Message);
}
finally
{
//Close the StreamReader
_Stream.Close();
//Done, let the main form know :)
this.FireSaveStatsComplete();
}
}