Skip to content

Commit

Permalink
added a file integrity checker when opening a .bin file and decrement…
Browse files Browse the repository at this point in the history
… cheat count (data[0x34]) when removing a cheat
  • Loading branch information
rydoginator committed Sep 14, 2017
1 parent 516af26 commit f63f849
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 2 deletions.
Binary file modified .vs/CTRPFTool/v15/.suo
Binary file not shown.
5 changes: 3 additions & 2 deletions Form1.cs
Expand Up @@ -15,7 +15,7 @@ namespace CTRPFTool
{
public partial class MainForm : Form
{
string version = "v1.0";
string version = "v1.0.1";
public MainForm()
{
InitializeComponent();
Expand Down Expand Up @@ -136,7 +136,7 @@ private void openFileToolStripMenuItem_Click(object sender, EventArgs e)
byte[] tmp;
path = openFileDialog.FileName;
tmp = File.ReadAllBytes(path);
if (tmp.Length > 0x40 && tmp.Length < 10000) //check the size of the file
if (tmp.Length > 0x80 && tmp.Length == 0x80 + tmp[0x34] * 0x40 && tmp.Length % 0x40 == 0) //check the integrity of the file
{
data.AddRange(tmp);
PopulateList();
Expand Down Expand Up @@ -253,6 +253,7 @@ private void B_RemoveCheat_Click(object sender, EventArgs e)
{
data.RemoveAt(0x40 + (0x40 * index) + i);
}
data[0x34]--;
PopulateList();
}

Expand Down
Binary file modified bin/Debug/CTRPFTool.exe
Binary file not shown.
Binary file modified bin/Debug/CTRPFTool.pdb
Binary file not shown.
Binary file modified obj/Debug/CTRPFTool.exe
Binary file not shown.
Binary file modified obj/Debug/CTRPFTool.pdb
Binary file not shown.
Binary file modified obj/Debug/DesignTimeResolveAssemblyReferences.cache
Binary file not shown.

0 comments on commit f63f849

Please sign in to comment.