I am trying to use source provided by Mrk to patch a program. Why doesnt this work?
Code:
nclude <fstream>
#include <stdlib.h>
using namespace std;
int main(int argc, char* argv[])
{
int offset = 0x0BADC0DE; //store offset here.....
char orgbyte[6]; //buffer for bytes that we read in..
int obyte[6] = {0x00,0x00,0x00,0x00,0x00,0x00}; //write in original bytes here to be able to unpatch..
int rbyte[6] = {0x90,0x90,0x90,0x90,0x90,0x90}; //which bytes to write..
char filename[255] = "Gunz.exe"; //name of the file to patch..
char buffer[255]; //buffer to read to..
ifstream fil(filename); //open the file...
if (fil.is_open()) //if it's fkin open..
{
fil.seekg( offset , ios::beg); //go to the offset that we're going to patch...
fil.read( orgbyte , sizeof obyte ); //read bytes from the file..
if( atoi(orgbyte) == obyte ) //if the bytes read are the original bytes we'll patch! :)
{
printf("Xara Xtreme Patcher By Fallen Empires.****** ");
printf("â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*\n");
printf(" Xara Trial Has Been Frozen ;)\n");
printf(" â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*\n");
printf(" Offset Patcher By Mrk");
system("pause > nul"); //wait for user input
fil.close(); // close the file now
return 0; //end process
}
else
{
printf("File Could Not be patched"); // oh noews :/
fil.close(); // close the file now
return 1; //end with error
}
}
else
{
printf("Xara Xtreme Patcher By Fallen Empires.******\n");
printf("â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*\n");
printf(" What the hell is wrong with you? Where is xtreme.exe???\n");
printf("â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*â€*\n");
printf(" Offset Patcher By Mrk");
system("pause > nul"); //wait for user input
}
fil.close(); // close the file now
return 0;
}
i get these errors:
Code:
Error 1 error C2446: '==' : no conversion from 'int *' to 'int' c:\documents and settings\chris tarquini\my documents\visual studio 2005\projects\xpatcher\xpatcher.cpp 27
Error 2 error C2040: '==' : 'int' differs in levels of indirection from 'int [6]' c:\documents and settings\chris tarquini\my documents\visual studio 2005\projects\xpatcher\xpatcher.cpp 27