Results 1 to 7 of 7
  1. #1
    Petros's Avatar
    Join Date
    Mar 2007
    Posts
    1
    Reputation
    10
    Thanks
    0

    what is wrong with this source?

    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

  2. #2
    Nightlord's Avatar
    Join Date
    Jun 2006
    Gender
    male
    Location
    X:1337 Y:1337
    Posts
    433
    Reputation
    10
    Thanks
    24
    The start? where is says "nclude <fstream>" Isnt it? "#include <fstream>"








  3. #3
    FluffyStuff's Avatar
    Join Date
    May 2007
    Location
    Dark side of the moon
    Posts
    308
    Reputation
    10
    Thanks
    150
    Thats one of the reasons why i dont like C++ its so fragile (try to compile the source code from another computer and i can acertain you that i wont compile because of linking errors). And the .NET environment of C++ is just pure crap, the one of C# is way better though being made in the same year.

  4. #4
    Migrashin's Avatar
    Join Date
    May 2007
    Gender
    male
    Posts
    53
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by FluffyStuff View Post
    Thats one of the reasons why i dont like C++ its so fragile (try to compile the source code from another computer and i can acertain you that i wont compile because of linking errors). And the .NET environment of C++ is just pure crap, the one of C# is way better though being made in the same year.

    I love how the code he has given is NOT in C++. That is obviously C

    printf is a C command or C# i dunno.

    std::cout is a C++ command/function anything you want to call it

  5. #5
    arunforce's Avatar
    Join Date
    Dec 2005
    Gender
    male
    Location
    A place for amigos
    Posts
    24,703
    Reputation
    4747
    Thanks
    12,562
    My Mood
    Yeehaw
    Quote Originally Posted by Migrashin View Post
    I love how the code he has given is NOT in C++. That is obviously C

    printf is a C command or C# i dunno.

    std::cout is a C++ command/function anything you want to call it
    No you idiot, that's C++, and C# is C. I didn't read through the code but it looks like the integers you are calling upon are in an array hence the error, try putting [0] after it on the same line of the error. Haven't coded in C++ in a while, so my brain isn't that fresh on it.



    BRING BACK BT, BRING BACK SAGA, BRING BACK VF, BRING BACK MPGHCRAFT, BRING BACK HABAMON


  6. #6
    Migrashin's Avatar
    Join Date
    May 2007
    Gender
    male
    Posts
    53
    Reputation
    10
    Thanks
    0
    printf is not a C++ command. std::cout is a C++ command.

    C:
    printf("Hello World!\n");

    C++:
    cout << "Hello World!" << endl;

    or

    std::cout << "Hello World!\n";

  7. #7
    FluffyStuff's Avatar
    Join Date
    May 2007
    Location
    Dark side of the moon
    Posts
    308
    Reputation
    10
    Thanks
    150
    You retard, i just created a new project in C++ (one with Hello World in it) and this file was auto created:
    Code:
    // Test2.cpp : Defines the entry point for the console application.
    //
    
    #include "stdafx.h"
    
    int main(int argc, char* argv[])
    {
    	printf("Hello World!\n");
    	return 0;
    }
    And just for your info in C# it would be Console.Write("Hello World!");
    Please https://www.justfuckinggooglei*****m before making stupid comments.

Similar Threads

  1. What's wrong with this?
    By fvestrgenrl in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 6
    Last Post: 07-21-2010, 03:12 PM
  2. What's wrong with this guy?
    By Mr.Magicman in forum General
    Replies: 15
    Last Post: 06-01-2010, 08:53 AM
  3. What is wrong with this code?
    By t7ancients in forum C++/C Programming
    Replies: 10
    Last Post: 10-19-2009, 01:58 PM
  4. What's wrong with this?
    By yup in forum Visual Basic Programming
    Replies: 4
    Last Post: 03-18-2008, 10:36 AM
  5. what is wrong with this ??
    By floris12345! in forum Visual Basic Programming
    Replies: 5
    Last Post: 01-16-2008, 05:22 PM