using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Castlevania_HD_XBLA_TU2
{
public partial class Form1 : Form
{
//Global variable for real time memory - so we can share between functions
private ISOLib.XBDMPackage.RealTimeMemory _rtm;
private uint[] _addresses;
private bool _flag = false;
public Form1()
{
InitializeComponent();
}
private void connectButton_Click(object sender, EventArgs e)
{
//Pointer Range, start address and dump length
_rtm = new ISOLib.XBDMPackage.RealTimeMemory(ipAddressTextBox .Text, 0xC7470000, 0x80000);
if (_rtm.Connect())
{
MessageBox.Show(this,string.Format("Connected"), string.Format("Castlevania HD XBLA TU2"), MessageBoxButtons.OK, MessageBoxIcon.Information);
pokeMemoryButton.Enabled = true;
toolStripStatus.Text = string.Format("Connected");
}
else
{
MessageBox.Show(this, string.Format("Already Connected or No Connection"), string.Format("Castlevania HD XBLA TU2"), MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void pokeMemoryButton_Click(object sender, EventArgs e)
{
System.Threading.Thread oThread = new System.Threading.Thread(PokeMemory);
oThread.Start();
}
private void PokeMemory()
{
CheckForIllegalCrossThreadCalls = false;
try
{
if (_flag)//if you have the addresses already
_rtm.Poke(_addresses[0] + 0x68, "43C80000");
else
{
toolStripStatus.Text = string.Format("Estimate 35 seconds...");
toolStripStatus.Invalidate();
_addresses = _rtm.FindUIntOffset("09536F6D61204372757A006F72726 9730017029400000000");
toolStripStatus.Text = string.Format("Connected");
toolStripStatus.Invalidate();
_rtm.Poke(_addresses[0] + 0x68, "43C80000");//SOMA
_rtm.Poke(_addresses[0] + 0x6C, "48000000");
_rtm.Poke(_addresses[0] + 0x70, "43000000");
_rtm.Poke(_addresses[0] + 0x74, "48000000");
_rtm.Poke(_addresses[0] + 0x78, "48000000");
_rtm.Poke(_addresses[0] + 0x7C, "48000000");
_rtm.Poke(_addresses[0] + 0x80, "48000000");
_rtm.Poke(_addresses[0] + 0x390, "43C80000");//ALUCARD
_rtm.Poke(_addresses[0] + 0X394, "48000000");
_rtm.Poke(_addresses[0] + 0x398, "43000000");
_rtm.Poke(_addresses[0] + 0x39C, "48000000");
_rtm.Poke(_addresses[0] + 0x3A0, "48000000");
_rtm.Poke(_addresses[0] + 0x3A4, "48000000");
_rtm.Poke(_addresses[0] + 0x3A8, "48000000");
_rtm.Poke(_addresses[0] + 0x6B8, "43C80000");//JOHATHAN
_rtm.Poke(_addresses[0] + 0x6BC, "48000000");
_rtm.Poke(_addresses[0] + 0x6C0, "43000000");
_rtm.Poke(_addresses[0] + 0x6C4, "48000000");
_rtm.Poke(_addresses[0] + 0x6C8, "48000000");
_rtm.Poke(_addresses[0] + 0x6CC, "48000000");
_rtm.Poke(_addresses[0] + 0x6D0, "48000000");
_rtm.Poke(_addresses[0] + 0x9E0, "43C80000");//Julius
_rtm.Poke(_addresses[0] + 0x9E4, "48000000");
_rtm.Poke(_addresses[0] + 0x9E8, "43000000");
_rtm.Poke(_addresses[0] + 0x9EC, "48000000");
_rtm.Poke(_addresses[0] + 0x9F0, "48000000");
_rtm.Poke(_addresses[0] + 0x9F4, "48000000");
_rtm.Poke(_addresses[0] + 0x9F8, "48000000");
_rtm.Poke(_addresses[0] + 0xD08, "43C80000");//Richter
_rtm.Poke(_addresses[0] + 0xD0C, "48000000");
_rtm.Poke(_addresses[0] + 0xD10, "43000000");
_rtm.Poke(_addresses[0] + 0xD14, "48000000");
_rtm.Poke(_addresses[0] + 0xD18, "48000000");
_rtm.Poke(_addresses[0] + 0xD1C, "48000000");
_rtm.Poke(_addresses[0] + 0xD20, "48000000");
_rtm.Poke(_addresses[0] + 0x1030, "43C80000");//Shanoa
_rtm.Poke(_addresses[0] + 0x1034, "48000000");
_rtm.Poke(_addresses[0] + 0x1038, "43000000");
_rtm.Poke(_addresses[0] + 0x103C, "48000000");
_rtm.Poke(_addresses[0] + 0x1040, "48000000");
_rtm.Poke(_addresses[0] + 0x1044, "48000000");
_rtm.Poke(_addresses[0] + 0x1048, "48000000");
_rtm.Poke(_addresses[0] + 0x1358, "43C80000");//Charlotte
_rtm.Poke(_addresses[0] + 0x135C, "48000000");
_rtm.Poke(_addresses[0] + 0x1360, "43000000");
_rtm.Poke(_addresses[0] + 0x1364, "48000000");
_rtm.Poke(_addresses[0] + 0x1368, "48000000");
_rtm.Poke(_addresses[0] + 0x136C, "48000000");
_rtm.Poke(_addresses[0] + 0x1370, "48000000");
_rtm.Poke(_addresses[0] + 0x1680, "43C80000");//Yoko
_rtm.Poke(_addresses[0] + 0x1684, "48000000");
_rtm.Poke(_addresses[0] + 0x1688, "43000000");
_rtm.Poke(_addresses[0] + 0x168C, "48000000");
_rtm.Poke(_addresses[0] + 0x1690, "48000000");
_rtm.Poke(_addresses[0] + 0x1694, "48000000");
_rtm.Poke(_addresses[0] + 0x1698, "48000000");
_rtm.Poke(_addresses[0] + 0x19A8, "43C80000");//Maria
_rtm.Poke(_addresses[0] + 0x19AC, "48000000");
_rtm.Poke(_addresses[0] + 0x19B0, "43000000");
_rtm.Poke(_addresses[0] + 0x19B4, "48000000");
_rtm.Poke(_addresses[0] + 0x19B8, "48000000");
_rtm.Poke(_addresses[0] + 0x19BC, "48000000");
_rtm.Poke(_addresses[0] + 0x19C0, "48000000");
_rtm.Poke(_addresses[0] + 0x1CD0, "43C80000");//Simon
_rtm.Poke(_addresses[0] + 0x1CD4, "48000000");
_rtm.Poke(_addresses[0] + 0x1CD8, "43000000");
_rtm.Poke(_addresses[0] + 0x1CDC, "48000000");
_rtm.Poke(_addresses[0] + 0x1CE0, "48000000");
_rtm.Poke(_addresses[0] + 0x1CE4, "48000000");
_rtm.Poke(_addresses[0] + 0x1CE8, "48000000");
_rtm.Poke(_addresses[0] + 0x1FF8, "43C80000");//FUMA
_rtm.Poke(_addresses[0] + 0x1FFC, "48000000");
_rtm.Poke(_addresses[0] + 0x2000, "43000000");
_rtm.Poke(_addresses[0] + 0x2004, "48000000");
_rtm.Poke(_addresses[0] + 0x2008, "48000000");
_rtm.Poke(_addresses[0] + 0x200C, "48000000");
_rtm.Poke(_addresses[0] + 0x2010, "48000000");
}
if (decimal.Parse(_rtm.Peek(_addresses[0] + 0x10, 0x04)) != 0) MessageBox.Show(this, string.Format("All Stats Successfully Changed"), string.Format("Castlevania HD XBLA TU2"), MessageBoxButtons.OK, MessageBoxIcon.Information);
else MessageBox.Show(this, string.Format("Poke Done"), string.Format("Castlevania HD XBLA TU2"), MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(this, ex.Message, string.Format("Castlevania HD XBLA TU2"), MessageBoxButtons.OK, MessageBoxIcon.Information);
}
finally
{
_flag = false;
System.Threading.Thread.CurrentThread.Abort();
}
}
}
}