Results 1 to 13 of 13
  1. #1
    BilakosBF3's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Location
    0x22
    Posts
    131
    Reputation
    108
    Thanks
    1,130
    My Mood
    Yeehaw

    Universal Crosshair(C++)

    Here is a simple code in cpp to get a crosshair for a lot of games,very easy code to understand for those who are trying to get into game hacking.Have fun:
    Code:
     
    #include <windows.h>
    #include <vector>
     
    #define SLEEPTIME 20
    #define CROSSHAIR_SIZE 5
     
    int systemInfo[2] = { 0, 0 };
    int centerInfo[2] = { 0, 0 };
    COLORREF cColorCrosshair = RGB(255, 0, 0);
     
    int APIENTRY WinMain(HINSTANCE hInstance,
                         HINSTANCE hPrevInstance,
                         LPSTR     lpCmdLine,
                         int       nCmdShow)
    {
    	HDC twHdc;
    	POINT cursorInfo;
    	char tInitPath[MAX_PATH];
    	char GName[32];
     
    	if (!GetModuleFileName(NULL, tInitPath, MAX_PATH)) {
    		MessageBox(NULL, "Unable to read file", NULL, NULL);
    		ExitProcess(0);
    	}
     
    	// Receiving file path 
    	GetModuleFileName(NULL, tInitPath, MAX_PATH);
    	char* pos = tInitPath + strlen(tInitPath);
    	while(pos >= tInitPath && *pos != '\\') --pos;
    	pos[1]=0;
     
    	// Add the ini file location to the path
    	strcat(tInitPath, "settings.ini");
     
    	// Receiving ini variable
    	GetPrivateProfileString("Game", "Name", NULL, GName, sizeof(GName), tInitPath);
     
    	while(true) {
    		HWND twHandle = FindWindow(NULL, GName);
    		if (twHandle != NULL && GetForegroundWindow() == twHdc) {
    			// Hooking information
    			static bool bInfo = false;
    			if (!bInfo) {
    				char temp[MAX_PATH];
    				sprintf(temp, "%s succesfully hooked, reading ini (%s)", GName, tInitPath);
    				MessageBox(NULL, temp, "Notice", NULL);
     
    				// Receiving resolution info
    				systemInfo[0] = GetSystemMetrics(SM_CXSCREEN);
    				systemInfo[1] = GetSystemMetrics(SM_CYSCREEN);
     
    				centerInfo[0] = systemInfo[0] * 0.5f;
    				centerInfo[1] = systemInfo[1] * 0.5f;
     
    				// Getting handle for pixel adjustment
    				twHdc = GetDC(twHandle);
     
    				// Make sure radius is set
    				if (radius <= 0)
    					radius = centerInfo[1];
     
    				bInfo = true;
    			}
     
    			// Get current cursor position
    			GetCursorPos(&cursorInfo);
     
    			// Crosshair drawing code
    			for (int x=centerInfo[0]-CROSSHAIR_SIZE;x<centerInfo[0]+CROSSHAIR_SIZE;x++)
    				SetPixel(twHdc, x, centerInfo[1], cColorCrosshair);
    			for (int y=centerInfo[1]-CROSSHAIR_SIZE;y<centerInfo[1]+CROSSHAIR_SIZE;y++)
    				SetPixel(twHdc, centerInfo[0], y, cColorCrosshair);
     
    			caActive = true;
    		}
    		else if (caActive == true) {
    			ExitProcess(0);
    		}
    		Sleep(SLEEPTIME);
    	}
     
    	return 0;
    }
    Check Me Out

  2. The Following 2 Users Say Thank You to BilakosBF3 For This Useful Post:

    Hacker Fail (03-05-2015),THE MOB (01-30-2015)

  3. #2
    BilakosBF3's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Location
    0x22
    Posts
    131
    Reputation
    108
    Thanks
    1,130
    My Mood
    Yeehaw
    I forgot to say that this code doesnt have pbss protection,so one pbss will be enough to get you banned if you dont add pbss protection.
    Check Me Out

  4. #3
    Hacker Fail's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    C++
    Posts
    1,875
    Reputation
    200
    Thanks
    7,895
    Good job, this source works in EVERY thing, because you get a name of window..
    • Member Level 1 since November, 2011
    • Contributor since March, 2015

     

  5. #4
    Slendermang's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Posts
    21
    Reputation
    10
    Thanks
    0
    Great job, thanks!

  6. #5
    Baztai's Avatar
    Join Date
    Jan 2012
    Gender
    male
    Location
    New Zealand
    Posts
    3
    Reputation
    10
    Thanks
    0
    My Mood
    Mellow
    I like this, good job.

  7. #6
    goco79's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Location
    South Dakota
    Posts
    57
    Reputation
    10
    Thanks
    5
    My Mood
    Buzzed
    I'm new to coding (not C++), but I would like to know how to execute this script. What do I put it into? What compiler should I use? What type of file do I save this as? Are there any modifications to the script that I need to make?

    Sorry for inundating you with questions, I would just like to figure this out. I see scripts being posted around these forums, but I have never understood how people use them.

    I am not completely ignorant-- I have spent time coding & scripting. I am just now familiarizing myself at this point.
    "Even death is not to be feared by the one who has lived wisely." ~Buddha

  8. #7
    Hacker Fail's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    C++
    Posts
    1,875
    Reputation
    200
    Thanks
    7,895
    Quote Originally Posted by goco79 View Post
    I'm new to coding (not C++), but I would like to know how to execute this script. What do I put it into? What compiler should I use? What type of file do I save this as? Are there any modifications to the script that I need to make?

    Sorry for inundating you with questions, I would just like to figure this out. I see scripts being posted around these forums, but I have never understood how people use them.

    I am not completely ignorant-- I have spent time coding & scripting. I am just now familiarizing myself at this point.
    You need to create a .exe, and copy and paste !
    • Member Level 1 since November, 2011
    • Contributor since March, 2015

     

  9. #8
    ozzy bubbles's Avatar
    Join Date
    Aug 2013
    Gender
    male
    Location
    My Chair.
    Posts
    141
    Reputation
    10
    Thanks
    83
    My Mood
    Aggressive
    Cute Code.Thanks.


    20 Posts ( ̲̅:̲̅:̲̅:̲̅[̲̅ ̲̅]̲̅:̲̅:̲̅:̲̅ ) DONE
    30 Posts ( ̲̅:̲̅:̲̅:̲̅[̲̅ ̲̅]̲̅:̲̅:̲̅:̲̅ ) DONE
    50 Posts ( ̲̅:̲̅:̲̅:̲̅[̲̅ ̲̅]̲̅:̲̅:̲̅:̲̅ ) DONE
    100 posts ( ̲̅:̲̅:̲̅:̲̅[̲̅ ̲̅]̲̅:̲̅:̲̅:̲̅ ) DONE
    200 Posts ( ̲̅:̲̅:̲̅:̲̅[̲̅ ̲̅]̲̅:̲̅:̲̅:̲̅ ) Undone
    300 Posts ( ̲̅:̲̅:̲̅:̲̅[̲̅ ̲̅]̲̅:̲̅:̲̅:̲̅ ) Undone






  10. #9
    BilakosBF3's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Location
    0x22
    Posts
    131
    Reputation
    108
    Thanks
    1,130
    My Mood
    Yeehaw
    Quote Originally Posted by goco79 View Post
    I'm new to coding (not C++), but I would like to know how to execute this script. What do I put it into? What compiler should I use? What type of file do I save this as? Are there any modifications to the script that I need to make?

    Sorry for inundating you with questions, I would just like to figure this out. I see scripts being posted around these forums, but I have never understood how people use them.

    I am not completely ignorant-- I have spent time coding & scripting. I am just now familiarizing myself at this point.
    You will know how to use once you know how to code,start by spending some time looking at sources.
    Check Me Out

  11. #10
    curkill2's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    40
    Reputation
    10
    Thanks
    9
    thanks now i can start coding

  12. #11
    Dondonian's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Posts
    40
    Reputation
    10
    Thanks
    42
    My Mood
    Aggressive
    Good job, this source works in EVERY thing, because you get a name of window..

  13. #12
    Mayion's Avatar
    Join Date
    Oct 2012
    Gender
    male
    Location
    Bed
    Posts
    12,698
    Reputation
    2920
    Thanks
    7,590
    My Mood
    Twisted
    Do you know a way to make this a injectable .dll file?


     


    Editor - N/A
    Donator - 30 August 2013
    Battlefield Minion - 26 October 2013
    Blackshot Minion - 14 January 2014/16 September 2014
    Minecraft Minion - 7 February 2014/16 September 2014
    WarRock Minion - 23 February 2014
    League of Legends Minion - 21 March 2014

    Minion+ - 15 May 2014
    Other Semi-Popular First Person Shooter Minion - 8 August 2014
    CrossFire Minion - 23 October 2014
    Programming Section Minion - 13 November 2014
    Marketplace Minion - 7 December 2014

    Official Middleman - 7 December 2014 - 27 June 2015
    Moderator - 29 December 2014
    Project Blackout Minion - 10 January 2015
    News Force Interviewer - January 2015
    Steam Games Minion - 21 March 2015
    Dragon Nest Minion - 31 March 2015
    Publicist - April 2015 - 21 September 2015
    Global Moderator - 25 August 2015
    Super User - 13 August 2016

    Here ends the legend of me; may I rest in peace.



  14. #13
    matmat59's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Posts
    0
    Reputation
    10
    Thanks
    0
    thank you, no risk of ban?

    or does it put you this order?

    thank you

Similar Threads

  1. [Release] Universal Crosshairs~!
    By iOwnage in forum Combat Arms Hacks & Cheats
    Replies: 115
    Last Post: 12-01-2009, 05:00 PM
  2. universal Crosshair
    By K4GE in forum Soldier Front Hacks
    Replies: 2
    Last Post: 07-05-2009, 05:32 PM
  3. UVC Universal Crosshair
    By yellowblob4 in forum CrossFire Hacks & Cheats
    Replies: 2
    Last Post: 07-02-2009, 12:11 PM
  4. Universal Crosshair hack (Lag Program) ;)
    By josser in forum Soldier Front Hacks
    Replies: 16
    Last Post: 04-18-2009, 08:41 PM
  5. (UVC) universal crosshair
    By donie1 in forum Combat Arms Hacks & Cheats
    Replies: 57
    Last Post: 09-12-2008, 01:06 PM