I've only tested the patcher on Aeria's current as of now (1/20/2012), as that is the only client I have. If you find any bugs in the program, let me know, and I'll sort them out the best I can.
A demo:
Requires .NET 2.0 Framework to work
Version 1.1 ChangeLog:
Help Section
Add Hacks tab
Developer Tools tab
Source Code For Developers
-Added "About" tab
-Added "Developer Tools" tab
-Added Market Anywhere to "Add Hacks"
-Changed text of "Wallhack" to "Wallclimb"
-Added Change IP to "Developer Tools"
-Added Change URL to "Developer Tools"
-Added "Developer Tools" tab
-Added Market Anywhere to "Add Hacks"
-Changed text of "Wallhack" to "Wallclimb"
-Added Change IP to "Developer Tools"
-Added Change URL to "Developer Tools"
Help Section
Add Hacks tab
| Function | Definition | Requires |
|---|---|---|
| Make Backup | Creates a backup in the current directory named "{gamename}.exe.bak | N/A |
| Wall Climb | Allows you to climb hills in game | N/A |
| Remove Updater | Allows game to be ran by double clicking game.exe | N/A |
| Market Anywhere | Allows you to set up a market anywhere | N/A |
| Anti-Freeze | Stops client from pausing when not in focus/tabbed in | N/A |
| No Version | Stops the "Client version doesn't match!" error at login | N/A |
| Multi-Client | Allows more than one client of the same executable | Remove Updater |
Developer Tools tab
| Function | Definition | Example Format |
|---|---|---|
| Change IP | Changes the IP in the client to the IP in the textbox | 127.0.0.1 |
| Change "Buy Points" URL | Changes the link the user is directed to when they click the "Buy Points" button on the item mall | ![]() |
Source Code For Developers
using System;
using System.Drawing;
using System.Drawing.Text;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Microsoft.VisualBasic;
namespace ShaiyaPatcher
{
public partial class PatchForm : Form
{
UTF8Encoding encoder = new UTF8Encoding();
static Regex regIP = new Regex(@"(?<First>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?<Second>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?<Third>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?<Fourth>2[0-4]\d|25[0-5]|[01]?\d\d?)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);
static Regex regURL = new Regex(@"(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?", RegexOptions.IgnoreCase);
public PatchForm()
{
InitializeComponent();
}
private void addBtn_Click(object sender, EventArgs e)
{
addLog.AppendText("Program Started." + Environment.NewLine);
if (File.Exists(@"C:\AeriaGames\Shaiya\game.exe"))
ahOFD.FileName = @"C:\AeriaGames\Shaiya\game.exe";
if (ahOFD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
FileStream game;
try
{
game = new FileStream(ahOFD.FileName, FileMode.Open);
}
catch
{
addLog.AppendText("Error opening game.exe. Make sure you have sufficient rights, and the game is closed." + Environment.NewLine);
return;
}
BinaryReader gameRdr = new BinaryReader(game);
byte[] writeToAddr = new byte[((int)(game.Length - 1L)) + 1];
for (int i = 0; i <= writeToAddr.Length - 1; i++)
writeToAddr[i] = gameRdr.ReadByte();
game.Close();
gameRdr.Close();
writeBytes(ref writeToAddr, 0x16, "70617463686564006279006E696768746D6172655");
#region MakeBackup
if (mbChk.Checked)
{
addLog.AppendText("Creating backup." + Environment.NewLine);
try
{
if (!File.Exists(ahOFD.FileName.TrimEnd(new char[] { '.' }) + ".bak"))
{
File.Move(ahOFD.FileName, ahOFD.FileName.TrimEnd(new char[] { '.' }) + ".bak");
addLog.AppendText("Backup Successfully Created!" + Environment.NewLine);
}
else if (MessageBox.Show("Backup exists, do you wish to overwrite it?", "File Exists", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
File.Delete(ahOFD.FileName.TrimEnd(new char[] { '.' }) + ".bak");
File.Move(ahOFD.FileName, ahOFD.FileName.TrimEnd(new char[] { '.' }) + ".bak");
addLog.AppendText("Backup Successfully Created!" + Environment.NewLine);
}
}
catch
{
addLog.AppendText("Error creating backup" + Environment.NewLine);
}
}
#endregion
#region WallHack
if (whChk.Checked)
{
addLog.AppendText("Enabling Wall Climb." + Environment.NewLine);
int addr1 = FindBytes(ref writeToAddr, "8A560984D2899C24", 0);
if (addr1 > -1)
{
int addr2 = FindBytes(ref writeToAddr, "0F85", addr1);
if ((addr2 - addr1) < 15)
{
writeBytes(ref writeToAddr, addr1 + 12, "90E9");
addLog.AppendText("Wall Climb Enabled!" + Environment.NewLine);
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
#endregion
#region RemoveUpdater
if (ruChk.Checked)
{
addLog.AppendText("Removing Updater Dependency." + Environment.NewLine);
int addr1 = FindBytes(ref writeToAddr, "8BE55DC210006A0A68", 0);
if (addr1 > -1)
{
int addr2 = FindBytes(ref writeToAddr, "0F84", addr1);
if ((addr2 - addr1) < 30)
{
writeBytes(ref writeToAddr, addr2, "90E9");
addLog.AppendText("Updater Dependency Removed!" + Environment.NewLine);
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
#endregion
#region AntiFreeze
if (afChk.Checked)
{
addLog.AppendText("Enabling Anti-Freeze." + Environment.NewLine);
int addr1 = FindBytes(ref writeToAddr, "5F5E5D33C05B83C430C21000833D", 0);
if (addr1 > -1)
{
int integer = Convert.ToInt32(writeToAddr[addr1 + 0x18].ToString("X").PadLeft(2, '0') + writeToAddr[addr1 + 0x17].ToString("X").PadLeft(2, '0') + writeToAddr[addr1 + 0x16].ToString("X").PadLeft(2, '0') + writeToAddr[addr1 + 0x15].ToString("X").PadLeft(2, '0'), 16);
if (integer == -1869574000)
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
else
{
writeBytes(ref writeToAddr, integer - 0x400000, "01");
writeBytes(ref writeToAddr, addr1 + 0x13, "909090909090");
addLog.AppendText("Anti-Freeze Enabled!" + Environment.NewLine);
}
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
#endregion
#region NoVersion
if (nvChk.Checked)
{
addLog.AppendText("Removing Version Check." + Environment.NewLine);
int addr1 = FindBytes(ref writeToAddr, "8BC20FB60C0168", 0);
if (addr1 > -1)
{
writeBytes(ref writeToAddr, addr1 + 7, "FFFFFFFF");
addLog.AppendText("Version Check Removed!" + Environment.NewLine);
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
#endregion
#region MultiClient
if (mcChk.Checked)
{
addLog.AppendText("Enabling Multi-Client." + Environment.NewLine);
int addr1 = FindBytes(ref writeToAddr, "884F06FF15", 0);
if (addr1 > -1)
{
int index = FindBytes(ref writeToAddr, "75", addr1);
if ((index - addr1) < 30)
{
writeToAddr[index] = 0xeb;
addLog.AppendText("Multi-Client Enabled!" + Environment.NewLine);
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
addr1 = FindBytes(ref writeToAddr, "FFD785C074", 0);
if (addr1 > -1)
{
int num5 = FindBytes(ref writeToAddr, "74", addr1);
if ((num5 - addr1) < 30)
{
writeToAddr[num5] = 0xeb;
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
#endregion
#region MarketAnywhere
if (maChk.Checked)
{
addLog.AppendText("Enabling Market Anywhere." + Environment.NewLine);
int addr1 = FindBytes(ref writeToAddr, "663D2A00746F ", 0);
if (addr1 > -1)
{
writeToAddr[addr1 + 4] = 0xEB;
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
#endregion
#region HackSave
ahSFD.FileName = ahOFD.FileName;
if (ahSFD.ShowDialog() == DialogResult.OK)
{
FileStream output = new FileStream(ahSFD.FileName, FileMode.OpenOrCreate);
BinaryWriter writer = new BinaryWriter(output);
for (int j = 0; j <= writeToAddr.Length - 1; j++)
{
writer.Write(writeToAddr[j]);
}
addLog.AppendText("Successfully saved file!" + Environment.NewLine);
output.Close();
writer.Close();
}
else
{
addLog.AppendText("User canceled save!" + Environment.NewLine);
}
#endregion
}
}
int FindBytes(ref byte[] arrayToSearchThrough, string spatternToFind, int start = 0)
{
byte[] patternToFind = GetBytes(spatternToFind);
if (patternToFind.Length > arrayToSearchThrough.Length)
return -1;
for (int i = start; i < arrayToSearchThrough.Length - patternToFind.Length; i++)
{
bool found = true;
for (int j = 0; j < patternToFind.Length; j++)
{
if (arrayToSearchThrough[i + j] != patternToFind[j])
{
found = false;
break;
}
}
if (found)
return i;
}
return -1;
}
void writeBytes(ref byte[] writeToAddr, int StartAddress, string dataToWrite)
{
byte[] buffer = GetBytes(dataToWrite);
for (int i = 0; i <= buffer.Length - 1; i++)
if (buffer[i] != 0)
writeToAddr[StartAddress + i] = buffer[i];
}
private byte[] GetBytes(string strInput)
{
int numBytes = (strInput.Length) / 2;
byte[] bytes = new byte[numBytes];
for (int x = 0; x < numBytes; ++x)
bytes[x] = Convert.ToByte(strInput.Substring(x * 2, 2), 16);
return bytes;
}
private void PatchForm_Load(object sender, EventArgs e)
{
InstalledFontCollection fonts = new InstalledFontCollection();
foreach (FontFamily family in fonts.Families)
fntList.Items.Add(family.Name);
fntList.SelectedItem = "Arial";
sizeBox.SelectedIndex = sizeBox.FindString("13");
}
private void sizeBox_SelectedValueChanged(object sender, EventArgs e)
{
try
{
demoLbl.Font = new Font(fntList.SelectedItem.ToString(), Convert.ToInt32(sizeBox.SelectedItem), FontStyle.Regular);
}
catch
{
//Do Nothing
}
}
private void fntList_SelectedValueChanged(object sender, EventArgs e)
{
try
{
demoLbl.Font = new Font(fntList.SelectedItem.ToString(), Convert.ToInt32(sizeBox.SelectedItem), FontStyle.Regular);
}
catch
{
//Do Nothing
}
}
private void button1_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(fntList.SelectedItem.ToStri ng()) && !string.IsNullOrEmpty(sizeBox.SelectedItem.ToStrin g()))
{
if (ahOFD.ShowDialog() == DialogResult.OK)
{
FileStream game;
try
{
game = new FileStream(ahOFD.FileName, FileMode.Open);
}
catch
{
MessageBox.Show("Game opening failed. Check if game is open or in use.", "Game Open Failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
BinaryReader gameRdr = new BinaryReader(game);
byte[] addrData = new byte[((int)(game.Length - 1L)) + 1];
for (int i = 0; i <= addrData.Length - 1; i++)
addrData[i] = gameRdr.ReadByte();
game.Close();
gameRdr.Close();
#region FontEdit
if (findandreplace(ref addrData) && writeFont(ref addrData, fntList.SelectedItem.ToString()) && writeSize(ref addrData, Convert.ToInt32(sizeBox.SelectedItem.ToString())))
{
writeBytes(ref addrData, 0x16, "70617463686564006279006E696768746D6172655");
ahSFD.FileName = ahOFD.FileName;
if (ahSFD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
FileStream output = new FileStream(ahSFD.FileName, FileMode.OpenOrCreate);
BinaryWriter writer = new BinaryWriter(output);
for (int i = 0; i <= addrData.Length - 1; i++)
{
writer.Write(addrData[i]);
}
output.Close();
writer.Close();
MessageBox.Show("Font changed successfully!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
}
else
{
MessageBox.Show("An error has occured.", "Unknown Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
#endregion
}
}
}
#region FontFunctions
string Hex(object data)
{
string str2 = Conversion.Hex(RuntimeHelpers.GetObjectValue(data) );
if ((str2.Length % 2) > 0)
str2 = "0" + str2;
return str2;
}
bool writeFont(ref byte[] edit, string fontName)
{
byte[] bytes = Encoding.ASCII.GetBytes(fontName);
for (int i = 0; i <= bytes.Length - 1; i++)
edit[0x360 + i] = bytes[i];
edit[0x360 + bytes.Length] = 0;
return true;
}
bool writeSize(ref byte[] edit, int fontSize)
{
int index = FindBytes(ref edit, "68900100006A", 0);
index = FindBytes(ref edit, "8D8E", index + 9);
index = FindBytes(ref edit, "68900100006A", index + 1);
if (index == -1)
return false;
index += 6;
edit[index] = (byte)fontSize;
return true;
}
bool findandreplace(ref byte[] edit)
{
if (FindBytes(ref edit, "60034000", 0) <= -1)
{
int index = FindBytes(ref edit, "575757576A0157575768900100005757576A0F", 0);
if (index == -1)
return false;
string str = Hex(edit[index - 4]) + Hex(edit[index - 3]) + Hex(edit[index - 2]) + Hex(edit[index - 1]);
do
{
index = FindBytes(ref edit, str, 0);
if (index > -1)
{
edit[index] = 0x60;
edit[index + 1] = 3;
edit[index + 2] = 0x40;
edit[index + 3] = 0;
}
}
while (index != -1);
}
return true;
}
#endregion
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
try
{
System.Diagnostics.Process.Start("http://elitepvpers.com/");
}
catch
{
MessageBox.Show("Unable to open link to \"http://elitepvpers.com\"");
}
}
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
try
{
System.Diagnostics.Process.Start("http://www.elitepvpers.com/forum/shaiya-hacks-bots-cheats-exploits/1681995-release-shaiya-patcher.html");
}
catch
{
MessageBox.Show("Unable to open link to application\'s thread on E*PvP!");
}
}
private void button2_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(newIP.Text))
{
if (validateIP(newIP.Text))
{
if (File.Exists(@"C:\AeriaGames\Shaiya\game.exe"))
ahOFD.FileName = @"C:\AeriaGames\Shaiya\game.exe";
if (ahOFD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
FileStream game;
try
{
game = new FileStream(ahOFD.FileName, FileMode.Open);
}
catch
{
addLog.AppendText("Error opening game.exe. Make sure you have sufficient rights, and the game is closed." + Environment.NewLine);
return;
}
BinaryReader gameRdr = new BinaryReader(game);
byte[] writeToAddr = new byte[((int)(game.Length - 1L)) + 1];
for (int i = 0; i <= writeToAddr.Length - 1; i++)
writeToAddr[i] = gameRdr.ReadByte();
game.Close();
gameRdr.Close();
writeBytes(ref writeToAddr, 0x16, "70617463686564006279006E696768746D6172655");
int addr1 = FindBytes(ref writeToAddr, "47414D4500", 0);
if (addr1 > -1)
{
writeIP(ref writeToAddr, addr1 - 92, newIP.Text);
ahSFD.FileName = ahOFD.FileName;
if (ahSFD.ShowDialog() == DialogResult.OK)
{
FileStream output = new FileStream(ahSFD.FileName, FileMode.OpenOrCreate);
BinaryWriter writer = new BinaryWriter(output);
for (int j = 0; j <= writeToAddr.Length - 1; j++)
writer.Write(writeToAddr[j]);
MessageBox.Show("IP Change Successful!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
output.Close();
writer.Close();
}
}
else
MessageBox.Show("Could not find patch point!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
MessageBox.Show("Please enter a valid IP!", "IP Validation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void chngUrl_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(urlTxt.Text) && urlTxt.Text.Length <= 84)
{
if (validateURL(urlTxt.Text))
{
if (File.Exists(@"C:\AeriaGames\Shaiya\game.exe"))
ahOFD.FileName = @"C:\AeriaGames\Shaiya\game.exe";
if (ahOFD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
FileStream game;
try
{
game = new FileStream(ahOFD.FileName, FileMode.Open);
}
catch
{
addLog.AppendText("Error opening game.exe. Make sure you have sufficient rights, and the game is closed." + Environment.NewLine);
return;
}
BinaryReader gameRdr = new BinaryReader(game);
byte[] writeToAddr = new byte[((int)(game.Length - 1L)) + 1];
for (int i = 0; i <= writeToAddr.Length - 1; i++)
writeToAddr[i] = gameRdr.ReadByte();
game.Close();
gameRdr.Close();
writeBytes(ref writeToAddr, 0x16, "70617463686564006279006E696768746D6172655");
int addr1 = FindBytes(ref writeToAddr, "696E735F6D61726B65745F70617374", 0);
if (addr1 > -1)
{
writeURL(ref writeToAddr, addr1 - 86, urlTxt.Text);
ahSFD.FileName = ahOFD.FileName;
if (ahSFD.ShowDialog() == DialogResult.OK)
{
FileStream output = new FileStream(ahSFD.FileName, FileMode.OpenOrCreate);
BinaryWriter writer = new BinaryWriter(output);
for (int j = 0; j <= writeToAddr.Length - 1; j++)
writer.Write(writeToAddr[j]);
MessageBox.Show("URL Change Successful!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
output.Close();
writer.Close();
}
}
else
MessageBox.Show("Could not find patch point!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
MessageBox.Show("Please enter a valid URL!", "URL Validation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
MessageBox.Show("URL Text Box Cannot Be Empty, " + Environment.NewLine + "URL Cannot Be Longer Than 84 Characters!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
#region DevFunctions
static bool validateIP(string strIPAddressField)
{
if (regIP.IsMatch(strIPAddressField))
return true;
return false;
}
static bool validateURL(string urlTxt)
{
if(regURL.IsMatch(urlTxt))
return true;
return false;
}
void writeIP(ref byte[] writeToAddr, int StartAddress, string ipString)
{
byte[] buffer = encoder.GetBytes(ipString);
byte[] ip = new byte[14];
if (ipString.Length < 15)
for (int i = 0; i < 14; i++)
if (i <= buffer.Length - 1)
ip[i] = buffer[i];
else
ip = buffer;
for (int i = 0; i <= ip.Length - 1; i++)
writeToAddr[StartAddress + i] = ip[i];
}
void writeURL(ref byte[] writeToAddr, int StartAddress, string urlString)
{
byte[] buffer = encoder.GetBytes(urlString);
byte[] url = new byte[83];
if (urlString.Length < 84)
for (int i = 0; i < 83; i++)
if (i <= buffer.Length - 1)
url[i] = buffer[i];
else
url = buffer;
for (int i = 0; i <= url.Length - 1; i++)
writeToAddr[StartAddress + i] = url[i];
}
#endregion
}
}
using System.Drawing;
using System.Drawing.Text;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Microsoft.VisualBasic;
namespace ShaiyaPatcher
{
public partial class PatchForm : Form
{
UTF8Encoding encoder = new UTF8Encoding();
static Regex regIP = new Regex(@"(?<First>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?<Second>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?<Third>2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?<Fourth>2[0-4]\d|25[0-5]|[01]?\d\d?)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);
static Regex regURL = new Regex(@"(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?", RegexOptions.IgnoreCase);
public PatchForm()
{
InitializeComponent();
}
private void addBtn_Click(object sender, EventArgs e)
{
addLog.AppendText("Program Started." + Environment.NewLine);
if (File.Exists(@"C:\AeriaGames\Shaiya\game.exe"))
ahOFD.FileName = @"C:\AeriaGames\Shaiya\game.exe";
if (ahOFD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
FileStream game;
try
{
game = new FileStream(ahOFD.FileName, FileMode.Open);
}
catch
{
addLog.AppendText("Error opening game.exe. Make sure you have sufficient rights, and the game is closed." + Environment.NewLine);
return;
}
BinaryReader gameRdr = new BinaryReader(game);
byte[] writeToAddr = new byte[((int)(game.Length - 1L)) + 1];
for (int i = 0; i <= writeToAddr.Length - 1; i++)
writeToAddr[i] = gameRdr.ReadByte();
game.Close();
gameRdr.Close();
writeBytes(ref writeToAddr, 0x16, "70617463686564006279006E696768746D6172655");
#region MakeBackup
if (mbChk.Checked)
{
addLog.AppendText("Creating backup." + Environment.NewLine);
try
{
if (!File.Exists(ahOFD.FileName.TrimEnd(new char[] { '.' }) + ".bak"))
{
File.Move(ahOFD.FileName, ahOFD.FileName.TrimEnd(new char[] { '.' }) + ".bak");
addLog.AppendText("Backup Successfully Created!" + Environment.NewLine);
}
else if (MessageBox.Show("Backup exists, do you wish to overwrite it?", "File Exists", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
File.Delete(ahOFD.FileName.TrimEnd(new char[] { '.' }) + ".bak");
File.Move(ahOFD.FileName, ahOFD.FileName.TrimEnd(new char[] { '.' }) + ".bak");
addLog.AppendText("Backup Successfully Created!" + Environment.NewLine);
}
}
catch
{
addLog.AppendText("Error creating backup" + Environment.NewLine);
}
}
#endregion
#region WallHack
if (whChk.Checked)
{
addLog.AppendText("Enabling Wall Climb." + Environment.NewLine);
int addr1 = FindBytes(ref writeToAddr, "8A560984D2899C24", 0);
if (addr1 > -1)
{
int addr2 = FindBytes(ref writeToAddr, "0F85", addr1);
if ((addr2 - addr1) < 15)
{
writeBytes(ref writeToAddr, addr1 + 12, "90E9");
addLog.AppendText("Wall Climb Enabled!" + Environment.NewLine);
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
#endregion
#region RemoveUpdater
if (ruChk.Checked)
{
addLog.AppendText("Removing Updater Dependency." + Environment.NewLine);
int addr1 = FindBytes(ref writeToAddr, "8BE55DC210006A0A68", 0);
if (addr1 > -1)
{
int addr2 = FindBytes(ref writeToAddr, "0F84", addr1);
if ((addr2 - addr1) < 30)
{
writeBytes(ref writeToAddr, addr2, "90E9");
addLog.AppendText("Updater Dependency Removed!" + Environment.NewLine);
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
#endregion
#region AntiFreeze
if (afChk.Checked)
{
addLog.AppendText("Enabling Anti-Freeze." + Environment.NewLine);
int addr1 = FindBytes(ref writeToAddr, "5F5E5D33C05B83C430C21000833D", 0);
if (addr1 > -1)
{
int integer = Convert.ToInt32(writeToAddr[addr1 + 0x18].ToString("X").PadLeft(2, '0') + writeToAddr[addr1 + 0x17].ToString("X").PadLeft(2, '0') + writeToAddr[addr1 + 0x16].ToString("X").PadLeft(2, '0') + writeToAddr[addr1 + 0x15].ToString("X").PadLeft(2, '0'), 16);
if (integer == -1869574000)
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
else
{
writeBytes(ref writeToAddr, integer - 0x400000, "01");
writeBytes(ref writeToAddr, addr1 + 0x13, "909090909090");
addLog.AppendText("Anti-Freeze Enabled!" + Environment.NewLine);
}
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
#endregion
#region NoVersion
if (nvChk.Checked)
{
addLog.AppendText("Removing Version Check." + Environment.NewLine);
int addr1 = FindBytes(ref writeToAddr, "8BC20FB60C0168", 0);
if (addr1 > -1)
{
writeBytes(ref writeToAddr, addr1 + 7, "FFFFFFFF");
addLog.AppendText("Version Check Removed!" + Environment.NewLine);
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
#endregion
#region MultiClient
if (mcChk.Checked)
{
addLog.AppendText("Enabling Multi-Client." + Environment.NewLine);
int addr1 = FindBytes(ref writeToAddr, "884F06FF15", 0);
if (addr1 > -1)
{
int index = FindBytes(ref writeToAddr, "75", addr1);
if ((index - addr1) < 30)
{
writeToAddr[index] = 0xeb;
addLog.AppendText("Multi-Client Enabled!" + Environment.NewLine);
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
addr1 = FindBytes(ref writeToAddr, "FFD785C074", 0);
if (addr1 > -1)
{
int num5 = FindBytes(ref writeToAddr, "74", addr1);
if ((num5 - addr1) < 30)
{
writeToAddr[num5] = 0xeb;
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
#endregion
#region MarketAnywhere
if (maChk.Checked)
{
addLog.AppendText("Enabling Market Anywhere." + Environment.NewLine);
int addr1 = FindBytes(ref writeToAddr, "663D2A00746F ", 0);
if (addr1 > -1)
{
writeToAddr[addr1 + 4] = 0xEB;
}
else
{
addLog.AppendText("Unable to find address. Possibly already patched?" + Environment.NewLine);
}
}
#endregion
#region HackSave
ahSFD.FileName = ahOFD.FileName;
if (ahSFD.ShowDialog() == DialogResult.OK)
{
FileStream output = new FileStream(ahSFD.FileName, FileMode.OpenOrCreate);
BinaryWriter writer = new BinaryWriter(output);
for (int j = 0; j <= writeToAddr.Length - 1; j++)
{
writer.Write(writeToAddr[j]);
}
addLog.AppendText("Successfully saved file!" + Environment.NewLine);
output.Close();
writer.Close();
}
else
{
addLog.AppendText("User canceled save!" + Environment.NewLine);
}
#endregion
}
}
int FindBytes(ref byte[] arrayToSearchThrough, string spatternToFind, int start = 0)
{
byte[] patternToFind = GetBytes(spatternToFind);
if (patternToFind.Length > arrayToSearchThrough.Length)
return -1;
for (int i = start; i < arrayToSearchThrough.Length - patternToFind.Length; i++)
{
bool found = true;
for (int j = 0; j < patternToFind.Length; j++)
{
if (arrayToSearchThrough[i + j] != patternToFind[j])
{
found = false;
break;
}
}
if (found)
return i;
}
return -1;
}
void writeBytes(ref byte[] writeToAddr, int StartAddress, string dataToWrite)
{
byte[] buffer = GetBytes(dataToWrite);
for (int i = 0; i <= buffer.Length - 1; i++)
if (buffer[i] != 0)
writeToAddr[StartAddress + i] = buffer[i];
}
private byte[] GetBytes(string strInput)
{
int numBytes = (strInput.Length) / 2;
byte[] bytes = new byte[numBytes];
for (int x = 0; x < numBytes; ++x)
bytes[x] = Convert.ToByte(strInput.Substring(x * 2, 2), 16);
return bytes;
}
private void PatchForm_Load(object sender, EventArgs e)
{
InstalledFontCollection fonts = new InstalledFontCollection();
foreach (FontFamily family in fonts.Families)
fntList.Items.Add(family.Name);
fntList.SelectedItem = "Arial";
sizeBox.SelectedIndex = sizeBox.FindString("13");
}
private void sizeBox_SelectedValueChanged(object sender, EventArgs e)
{
try
{
demoLbl.Font = new Font(fntList.SelectedItem.ToString(), Convert.ToInt32(sizeBox.SelectedItem), FontStyle.Regular);
}
catch
{
//Do Nothing
}
}
private void fntList_SelectedValueChanged(object sender, EventArgs e)
{
try
{
demoLbl.Font = new Font(fntList.SelectedItem.ToString(), Convert.ToInt32(sizeBox.SelectedItem), FontStyle.Regular);
}
catch
{
//Do Nothing
}
}
private void button1_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(fntList.SelectedItem.ToStri ng()) && !string.IsNullOrEmpty(sizeBox.SelectedItem.ToStrin g()))
{
if (ahOFD.ShowDialog() == DialogResult.OK)
{
FileStream game;
try
{
game = new FileStream(ahOFD.FileName, FileMode.Open);
}
catch
{
MessageBox.Show("Game opening failed. Check if game is open or in use.", "Game Open Failure", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
BinaryReader gameRdr = new BinaryReader(game);
byte[] addrData = new byte[((int)(game.Length - 1L)) + 1];
for (int i = 0; i <= addrData.Length - 1; i++)
addrData[i] = gameRdr.ReadByte();
game.Close();
gameRdr.Close();
#region FontEdit
if (findandreplace(ref addrData) && writeFont(ref addrData, fntList.SelectedItem.ToString()) && writeSize(ref addrData, Convert.ToInt32(sizeBox.SelectedItem.ToString())))
{
writeBytes(ref addrData, 0x16, "70617463686564006279006E696768746D6172655");
ahSFD.FileName = ahOFD.FileName;
if (ahSFD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
FileStream output = new FileStream(ahSFD.FileName, FileMode.OpenOrCreate);
BinaryWriter writer = new BinaryWriter(output);
for (int i = 0; i <= addrData.Length - 1; i++)
{
writer.Write(addrData[i]);
}
output.Close();
writer.Close();
MessageBox.Show("Font changed successfully!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
}
}
else
{
MessageBox.Show("An error has occured.", "Unknown Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
#endregion
}
}
}
#region FontFunctions
string Hex(object data)
{
string str2 = Conversion.Hex(RuntimeHelpers.GetObjectValue(data) );
if ((str2.Length % 2) > 0)
str2 = "0" + str2;
return str2;
}
bool writeFont(ref byte[] edit, string fontName)
{
byte[] bytes = Encoding.ASCII.GetBytes(fontName);
for (int i = 0; i <= bytes.Length - 1; i++)
edit[0x360 + i] = bytes[i];
edit[0x360 + bytes.Length] = 0;
return true;
}
bool writeSize(ref byte[] edit, int fontSize)
{
int index = FindBytes(ref edit, "68900100006A", 0);
index = FindBytes(ref edit, "8D8E", index + 9);
index = FindBytes(ref edit, "68900100006A", index + 1);
if (index == -1)
return false;
index += 6;
edit[index] = (byte)fontSize;
return true;
}
bool findandreplace(ref byte[] edit)
{
if (FindBytes(ref edit, "60034000", 0) <= -1)
{
int index = FindBytes(ref edit, "575757576A0157575768900100005757576A0F", 0);
if (index == -1)
return false;
string str = Hex(edit[index - 4]) + Hex(edit[index - 3]) + Hex(edit[index - 2]) + Hex(edit[index - 1]);
do
{
index = FindBytes(ref edit, str, 0);
if (index > -1)
{
edit[index] = 0x60;
edit[index + 1] = 3;
edit[index + 2] = 0x40;
edit[index + 3] = 0;
}
}
while (index != -1);
}
return true;
}
#endregion
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
try
{
System.Diagnostics.Process.Start("http://elitepvpers.com/");
}
catch
{
MessageBox.Show("Unable to open link to \"http://elitepvpers.com\"");
}
}
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
try
{
System.Diagnostics.Process.Start("http://www.elitepvpers.com/forum/shaiya-hacks-bots-cheats-exploits/1681995-release-shaiya-patcher.html");
}
catch
{
MessageBox.Show("Unable to open link to application\'s thread on E*PvP!");
}
}
private void button2_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(newIP.Text))
{
if (validateIP(newIP.Text))
{
if (File.Exists(@"C:\AeriaGames\Shaiya\game.exe"))
ahOFD.FileName = @"C:\AeriaGames\Shaiya\game.exe";
if (ahOFD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
FileStream game;
try
{
game = new FileStream(ahOFD.FileName, FileMode.Open);
}
catch
{
addLog.AppendText("Error opening game.exe. Make sure you have sufficient rights, and the game is closed." + Environment.NewLine);
return;
}
BinaryReader gameRdr = new BinaryReader(game);
byte[] writeToAddr = new byte[((int)(game.Length - 1L)) + 1];
for (int i = 0; i <= writeToAddr.Length - 1; i++)
writeToAddr[i] = gameRdr.ReadByte();
game.Close();
gameRdr.Close();
writeBytes(ref writeToAddr, 0x16, "70617463686564006279006E696768746D6172655");
int addr1 = FindBytes(ref writeToAddr, "47414D4500", 0);
if (addr1 > -1)
{
writeIP(ref writeToAddr, addr1 - 92, newIP.Text);
ahSFD.FileName = ahOFD.FileName;
if (ahSFD.ShowDialog() == DialogResult.OK)
{
FileStream output = new FileStream(ahSFD.FileName, FileMode.OpenOrCreate);
BinaryWriter writer = new BinaryWriter(output);
for (int j = 0; j <= writeToAddr.Length - 1; j++)
writer.Write(writeToAddr[j]);
MessageBox.Show("IP Change Successful!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
output.Close();
writer.Close();
}
}
else
MessageBox.Show("Could not find patch point!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
MessageBox.Show("Please enter a valid IP!", "IP Validation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void chngUrl_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(urlTxt.Text) && urlTxt.Text.Length <= 84)
{
if (validateURL(urlTxt.Text))
{
if (File.Exists(@"C:\AeriaGames\Shaiya\game.exe"))
ahOFD.FileName = @"C:\AeriaGames\Shaiya\game.exe";
if (ahOFD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
FileStream game;
try
{
game = new FileStream(ahOFD.FileName, FileMode.Open);
}
catch
{
addLog.AppendText("Error opening game.exe. Make sure you have sufficient rights, and the game is closed." + Environment.NewLine);
return;
}
BinaryReader gameRdr = new BinaryReader(game);
byte[] writeToAddr = new byte[((int)(game.Length - 1L)) + 1];
for (int i = 0; i <= writeToAddr.Length - 1; i++)
writeToAddr[i] = gameRdr.ReadByte();
game.Close();
gameRdr.Close();
writeBytes(ref writeToAddr, 0x16, "70617463686564006279006E696768746D6172655");
int addr1 = FindBytes(ref writeToAddr, "696E735F6D61726B65745F70617374", 0);
if (addr1 > -1)
{
writeURL(ref writeToAddr, addr1 - 86, urlTxt.Text);
ahSFD.FileName = ahOFD.FileName;
if (ahSFD.ShowDialog() == DialogResult.OK)
{
FileStream output = new FileStream(ahSFD.FileName, FileMode.OpenOrCreate);
BinaryWriter writer = new BinaryWriter(output);
for (int j = 0; j <= writeToAddr.Length - 1; j++)
writer.Write(writeToAddr[j]);
MessageBox.Show("URL Change Successful!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
output.Close();
writer.Close();
}
}
else
MessageBox.Show("Could not find patch point!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
MessageBox.Show("Please enter a valid URL!", "URL Validation Failed", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
MessageBox.Show("URL Text Box Cannot Be Empty, " + Environment.NewLine + "URL Cannot Be Longer Than 84 Characters!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
#region DevFunctions
static bool validateIP(string strIPAddressField)
{
if (regIP.IsMatch(strIPAddressField))
return true;
return false;
}
static bool validateURL(string urlTxt)
{
if(regURL.IsMatch(urlTxt))
return true;
return false;
}
void writeIP(ref byte[] writeToAddr, int StartAddress, string ipString)
{
byte[] buffer = encoder.GetBytes(ipString);
byte[] ip = new byte[14];
if (ipString.Length < 15)
for (int i = 0; i < 14; i++)
if (i <= buffer.Length - 1)
ip[i] = buffer[i];
else
ip = buffer;
for (int i = 0; i <= ip.Length - 1; i++)
writeToAddr[StartAddress + i] = ip[i];
}
void writeURL(ref byte[] writeToAddr, int StartAddress, string urlString)
{
byte[] buffer = encoder.GetBytes(urlString);
byte[] url = new byte[83];
if (urlString.Length < 84)
for (int i = 0; i < 83; i++)
if (i <= buffer.Length - 1)
url[i] = buffer[i];
else
url = buffer;
for (int i = 0; i <= url.Length - 1; i++)
writeToAddr[StartAddress + i] = url[i];
}
#endregion
}
}








