天使之翼2LOGO修正工具C#源代码
2013-04-15 .NET, Captain Tsubasa 天使之翼, Hack Tool 修改工具这是一个小程序 :A
把要写入到ROM里的168X48规格的LOGO修正代码定义到数组yypatch。
把要写入到ROM里的128X64规格的LOGO修正代码定义到数组Logopatch。
[cc lang=”C#”]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace fff
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public static Byte[] yypatch = new Byte[]
{
0x00,0x82,0x83,0x84,
0x00,0x97,0x98,0x99,
0x00,0xac,0xad,0xae,
0x00,0xc1,0xc2,0xc3,
0xaa,0x85,0x86,0x87,
0x88,0x9a,0x9b,0x9c,
0x9d,0xaf,0xb0,0xb1,
0xb2,0xc4,0xc5,0xc6,
0xc7,0xaa,0x89,0x8a,
0x8b,0x8c,0x9e,0x9f,
0xa0,0xa1,0xb3,0xb4,
0xb5,0xb6,0xc8,0xc9,
0xca,0xcb,0xaa,0x8d,
0x8e,0x8f,0x90,0xa2,
0xa3,0xa4,0xa5,0xb7,
0xb8,0xb9,0xba,0xcc,
0xcd,0xce,0xcf,0xaa,
0x91,0x92,0x93,0x94,
0xa6,0xa7,0xa8,0xa9,
0xbb,0xbc,0xbd,0xbe,
0xd0,0xd1,0xd2,0xd3,
0xaa,0x95,0x96,0x00,
0x00,0xaa,0xab,0x00,
0x00,0xbf,0xc0,0x00,
0x00,0xd4,0xd5,0x00,
0x00,0xaa,0x00,0xd6,
0xd7,0xd8,0x00,0xeb,
0xec,0xed,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0xaa,0xd9,
0xda,0xdb,0xdc,0xee,
0xef,0xf0,0xf1,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xaa,
0xdd,0xde,0xdf,0xe0,
0xf2,0xf3,0xf4,0xf5,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0xaa,0xe1,0xe2,0xe3,
0xe4,0xf6,0xf7,0xf8,
0xf9,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0xaa,0xe5,0xe6,
0xe7,0xe8,0xfa,0xfb,
0xfc,0xfd,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0xaa,0xe9,
0xea,0x00,0x00,0xfe,
0xff,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00
};
public static Byte[] Logopatch = new Byte[]
{
0xAA,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0xAA,0x80,0x81,
0x82,0x83,0x90,0x91,
0x92,0x93,0xA0,0xA1,
0xA2,0xA3,0xB0,0xB1,
0xB2,0xB3,0xAA,0x84,
0x85,0x86,0x87,0x94,
0x95,0x96,0x97,0xA4,
0xA5,0xA6,0xA7,0xB4,
0xB5,0xB6,0xB7,0xAA,
0x88,0x89,0x8A,0x8B,
0x98,0x99,0x9A,0x9B,
0xA8,0xA9,0xAA,0xAB,
0xB8,0xB9,0xBA,0xBB,
0xAA,0x8C,0x8D,0x8E,
0x8F,0x9C,0x9D,0x9E,
0x9F,0xAC,0xAD,0xAE,
0xAF,0xBC,0xBD,0xBE,
0xBF,0xAA,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0xAA,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0xAA,
0xC0,0xC1,0xC2,0xC3,
0xD0,0xD1,0xD2,0xD3,
0xE0,0xE1,0xE2,0xE3,
0xF0,0xF1,0xF2,0xF3,
0xAA,0xC4,0xC5,0xC6,
0xC7,0xD4,0xD5,0xD6,
0xD7,0xE4,0xE5,0xE6,
0xE7,0xF4,0xF5,0xF6,
0xF7,0xAA,0xC8,0xC9,
0xCA,0xCB,0xD8,0xD9,
0xDA,0xDB,0xE8,0xE9,
0xEA,0xEB,0xF8,0xF9,
0xFA,0xFB,0xAA,0xCC,
0xCD,0xCE,0xCF,0xDC,
0xDD,0xDE,0xDF,0xEC,
0xED,0xEE,0xEF,0xFC,
0xFD,0xFE,0xFF,0xAA,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00
};
//定义写入类型。
static byte[] xieru(byte[] xdaima, int i, int num)
{
xdaima[i] = (byte)num;
return xdaima;
}
byte[] xdaima;
string home;
string shome;
bool te = false;
//打开ROM
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = “所有合适文件*.*|*.*|.nes文件(*.nes)|*.nes”;
openFileDialog1.FilterIndex = 2;
openFileDialog1.RestoreDirectory = true;
if (DialogResult.OK == openFileDialog1.ShowDialog())
{
FileStream asave = new FileStream(openFileDialog1.FileName, FileMode.Open);
xdaima = new byte[asave.Length];
asave.Read(xdaima, 0, Convert.ToInt32(asave.Length));
MessageBox.Show(“成功载入文件!”, “提示”);
home = openFileDialog1.FileName;
shome = openFileDialog1.SafeFileName;
asave.Close();
label2.Text = “文件” + openFileDialog1.FileName;
}
te = true;
}
private void button2_Click(object sender, EventArgs e)
{
if (te)
{
try
{
Logopatch.CopyTo(xdaima, 0x11154);
//保存文件
if (!File.Exists(home + “备份.nes”))
File.Copy(home, home + “备份.nes”);
FileStream asav = new FileStream(home, FileMode.Create, FileAccess.ReadWrite);
asav.Write(xdaima, 0, xdaima.Length);
MessageBox.Show(“修正成功,原文件复本保存为:” + shome + “备份.nes”, “成功提示”);
asav.Flush();
asav.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
//MessageBox.Show(“数据输入有误”,”错误”,MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}
else
MessageBox.Show(“还未载入文件”, “提示”, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
private void button3_Click(object sender, EventArgs e)
{
if (te)
{
try
{
yypatch.CopyTo(xdaima, 0x11154);
//保存文件
if (!File.Exists(home + “备份.nes”))
File.Copy(home, home + “备份.nes”);
FileStream asav = new FileStream(home, FileMode.Create, FileAccess.ReadWrite);
asav.Write(xdaima, 0, xdaima.Length);
MessageBox.Show(“修正成功,原文件复本保存为:” + shome + “备份.nes”, “成功提示”);
asav.Flush();
asav.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
//MessageBox.Show(“数据输入有误”,”错误”,MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}
else
MessageBox.Show(“还未载入文件”, “提示”, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
private void button4_Click(object sender, EventArgs e)
{
Form2 gg = new Form2();
gg.ShowDialog();
}
}
}
[/cc]
download :LOGO 修正工具