Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Diagnostics;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace PES20Patcher_nesa24
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- #region file name
- OpenFileDialog ofd = new OpenFileDialog();
- string filename = "PES2020.exe";
- string shortname = "";
- string patchingfile = "";
- string exeversion = "";
- #endregion file name
- #region gameversions
- int gamever;
- int gamesub;
- int game;
- string gamename = "";
- string gamesubversion = "";
- #endregion
- private void ExitBTN_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- public void CheckGP(string file)
- {
- if (File.Exists(Directory.GetCurrentDirectory() + "\\" + filename))
- {
- BinaryReader br = new BinaryReader(File.Open(Directory.GetCurrentDirectory() + "\\" + filename, FileMode.Open, FileAccess.Read));
- byte[] kon = {0x96, 0x42};
- byte[] n24 = {0x65, 0x55};
- byte[] gpv = new byte[2];
- br.BaseStream.Position = 0x02565A56;
- gpv = br.ReadBytes(2);
- if (gpv[0]==kon[0])
- {
- exeversion = "KONAMI";
- }
- if (gpv[0] == n24[0])
- {
- exeversion = "nesa24";
- }
- br.Close();
- label2.Text= "Gameplay: " + exeversion;
- }
- else
- {
- MessageBox.Show("Copy PATCHER to PES2020 main folder!");
- MessageBox.Show("Tool will close!");
- this.Close();
- }
- }
- public void patch(string file)
- {
- BinaryWriter bw = new BinaryWriter(File.Open(Directory.GetCurrentDirectory()+"\\"+filename, FileMode.Open, FileAccess.Write));
- bw.BaseStream.Position = 0x02565A54;
- byte[] patch1 = { 0x00, 0x00, 0x65, 0x55, 0x00, 0x00, 0xF0, 0x42, 0x00, 0x00, 0x34, 0x43 };
- bw.Write(patch1);
- bw.BaseStream.Position = 0x0257FE0C;
- byte[] patch2 = { 0x99, 0x99, 0xB9, 0x3F, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x42, 0x69, 0x6E, 0x64, 0x00, 0x00 };
- bw.Write(patch2);
- bw.BaseStream.Position = 0x0258888C;
- byte[] patch3 = { 0xCD, 0xCC, 0x0C, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0x00, 0x00, 0x88, 0x40 };
- bw.Write(patch3);
- bw.BaseStream.Position = 0x02588D20;
- byte[] patch4 = { 0x00, 0x00, 0x96, 0x45, 0x00, 0x00, 0xF0, 0x42, 0x00, 0x00, 0xC8, 0x42 };
- bw.Write(patch4);
- bw.BaseStream.Position = 0x02588D74;
- byte[] patch5 = { 0x00, 0x00, 0x96, 0x45, 0x00, 0x00, 0xB4, 0x41, 0x00, 0x00, 0xB4, 0x41 };
- bw.Write(patch5);
- bw.BaseStream.Position = 0x02588D9C;
- byte[] patch6 = { 0x00, 0x00, 0x96, 0x45, 0x00, 0x00, 0x70, 0x42, 0x00, 0x00, 0xD2, 0x42, 0x00, 0x00, 0x70, 0x41 };
- bw.Write(patch6);
- bw.BaseStream.Position = 0x03433FE8;
- byte[] patch7 = { 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0xA8, 0xFF, 0xFF, 0x00, 0xA8, 0xFF, 0xFF, 0x00, 0xA8, 0xFF, 0xFF, 0xF8, 0x44, 0x07, 0xFF };
- bw.Write(patch7);
- bw.BaseStream.Position = 0x0349ED14;
- byte[] patch8 = { 0x00, 0x00, 0xA0, 0x40, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42 };
- bw.Write(patch8);
- bw.Close();
- exeversion = "nesa24";
- label2.Text = "Gameplay: " + exeversion;
- }
- public void konami(string file)
- {
- BinaryWriter bw = new BinaryWriter(File.Open(Directory.GetCurrentDirectory() + "\\" + filename, FileMode.Open, FileAccess.Write));
- bw.BaseStream.Position = 0x02565A54;
- byte[] patch1 = { 0x00, 0x00, 0x96, 0x42, 0x00, 0x00, 0xF0, 0x42, 0x00, 0x00, 0x34, 0x43 }; //000096420000F04200003443
- bw.Write(patch1);
- bw.BaseStream.Position = 0x0257FE0C;
- byte[] patch2 = { 0x99, 0x99, 0xD9, 0x3F, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x42, 0x69, 0x6E, 0x64, 0x00, 0x00 }; //9999D93F53637269707442696E640000
- bw.Write(patch2);
- bw.BaseStream.Position = 0x0258888C;
- byte[] patch3 = { 0x66, 0x66, 0xE6, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, 0x00, 0x00, 0x88, 0x40 }; // 6666E63F000000000000204000008840
- bw.Write(patch3);
- bw.BaseStream.Position = 0x02588D20;
- byte[] patch4 = { 0x00, 0x00, 0x96, 0x42, 0x00, 0x00, 0xF0, 0x42, 0x00, 0x00, 0xC8, 0x42 }; //000096420000F0420000C842
- bw.Write(patch4);
- bw.BaseStream.Position = 0x02588D74;
- byte[] patch5 = { 0x00, 0x00, 0x96, 0x42, 0x00, 0x00, 0xB4, 0x41, 0x00, 0x00, 0xB4, 0x41 }; //000096420000B4410000B441
- bw.Write(patch5);
- bw.BaseStream.Position = 0x02588D9C;
- byte[] patch6 = { 0x00, 0x00, 0x96, 0x42, 0x00, 0x00, 0x70, 0x42, 0x00, 0x00, 0xD2, 0x42, 0x00, 0x00, 0x70, 0x41 }; //00009642000070420000D24200007041
- bw.Write(patch6);
- bw.BaseStream.Position = 0x03433FE8;
- byte[] patch7 = { 0x00, 0xA8, 0xFF, 0xFF, 0x00, 0xA8, 0xFF, 0xFF, 0x00, 0xA8, 0xFF, 0xFF, 0x00, 0xA8, 0xFF, 0xFF, 0x00, 0xA8, 0xFF, 0xFF }; //00A8FFFF00A8FFFF00A8FFFF00A8FFFF00A8FFFF
- bw.Write(patch7);
- bw.BaseStream.Position = 0x0349ED14;
- byte[] patch8 = { 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42 }; //00000041000080400000000000000042
- bw.Write(patch8);
- bw.Close();
- exeversion = "KONAMI";
- label2.Text = "Gameplay: " + exeversion;
- }
- private void PatchBTN_Click(object sender, EventArgs e)
- {
- patch(Directory.GetCurrentDirectory() + "\\"+ filename);
- MessageBox.Show("Patched with nesa24 GP");
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- CheckGP(Directory.GetCurrentDirectory() + "\\" + filename);
- }
- private void button1_Click(object sender, EventArgs e)
- {
- konami(Directory.GetCurrentDirectory() + "\\" + filename);
- MessageBox.Show("Restored KONAMI GP");
- }
- }
- }
Add Comment
Please, Sign In to add comment