• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Results 1 to 8 of 8
    1. #1
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      darklord92's Avatar
      Join Date
      Mar 2013
      Posts
      6
      Thanks (-->)
      0
      Thanks (<--)
      0

      Color Aimbot, Help!

      Silent VPN
      Hey everyone, I have finished my code just like fleep has it.
      issues, when I run the code, i only have two errors; hdcScreen, unreferenced local variable, and, Aim_bot : not all control paths return a value
      but the code will successfully run anyway, I set the code to detect rgb - Windows Photo Viewer, and it does. then nothing...
      all it says is press a key to continue.

      Code

      Code:
      #include "ScanContents.h"
      
      bool TakeScreenShot(std::string WindowToFind, BITMAP &bm, HBITMAP &hbmap, BITMAPINFO &bmi, HDC &hdcShot, HBITMAP &hbitmapOld, HWND &hwnd);
      
      bool Aim_Bot(HWND appWnd, std::string GameWindow);
      void SetupBitmapInfo(BITMAPINFO &bmi, int bWidth, int bHeight, int bitsPerPixel);
      bool CompareColour(RGBQUAD * pPixels, int height, int width, int x, int y);
      void ScanBMP(ScanContents * scan);
      
      MouseCoord CurrentMouseXY(0, 0);
      
      
      int main()
      	{
      	std::string GameWindow = "rgb - Windows Photo Viewer"; //rgb - Windows Photo Viewer, Counter-Strike Scource
      	HWND appWnd = FindWindow(0, GameWindow.c_str());
      	
      	
      	while(!appWnd)
      	{
      	system("CLS");
      	appWnd = FindWindow(0, GameWindow.c_str());
      	std::cout << "Unable to find " << GameWindow.c_str() << std::endl;
      	Sleep(500);
      	}
      
      	POINT currentPos;
      	GetCursorPos(& currentPos);
      	CurrentMouseXY.X = currentPos.x;
      	CurrentMouseXY.Y = currentPos.y;
      
      	Aim_Bot(appWnd, GameWindow);
      	system("pause");
      	return 0;
      }
      
      bool TakeScreenShot(std::string WindowToFind, BITMAP &bm, HBITMAP &hbmap, BITMAPINFO &bmi, HDC &hdcShot, HBITMAP &hbitmapOld, HWND &hwnd)
      {
      	RECT rc;
      	GetWindowRect(hwnd, &rc);
      
      	hdcShot = CreateCompatibleDC(0);
      	hbmap = CreateCompatibleBitmap(GetDC(0), rc.right - rc.left, rc.bottom - rc.top);
      	SelectObject(hdcShot, hbmap);
      
      	BitBlt(hdcShot, 0, 0, rc.right - rc.left, rc.bottom - rc.top, GetDC(0), rc.left, rc.top, SRCCOPY);
      
      	if(!GetObject(hbmap, sizeof(BITMAP), (LPSTR)&bm))
      		return false;
      
      	int bitsPerPixel = bm.bmBitsPixel;
      
      	if(bitsPerPixel != 32 || bm.bmPlanes != 1)
      		return false;
      
      	SetupBitmapInfo(bmi, bm.bmWidth, bm.bmHeight, bitsPerPixel);
      	return true;
      }
      
      bool Aim_Bot(HWND appWnd, std::string GameWindow)
      {
      	RECT rcWindow;
      	GetWindowRect(appWnd, &rcWindow);
      	BITMAP bm;
      	HBITMAP hbmap;
      	HBITMAP hbmapOld;
      	BITMAPINFO bmi;
      	HDC hdcShot;
      	HDC hdcScreen;
      
      
      	RGBQUAD * pPixels;
      
      	int TimeTakenScreenAndScan;
      	
      	while(true)
      	{
      	
      		if(!GetAsyncKeyState('X'))
      		{
      			TimeTakenScreenAndScan = clock();
      
      			if(TakeScreenShot(GameWindow, bm, hbmap, bmi, hdcShot, hbmapOld, appWnd))
      				break;
      
      			HBITMAP hbmapNew = CreateCompatibleBitmap(hdcShot, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top);
      
      			HDC hdcShotNew = CreateCompatibleDC(hdcShot);
      
      			HBITMAP Oldbmp = (HBITMAP) SelectObject(hdcShotNew, hbmapNew);
      
      			BitBlt(hdcShotNew, 0, 0, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, hdcShot, 0, 0, SRCCOPY);
      
      			pPixels = new RGBQUAD[bm.bmWidth * bm.bmHeight];
      			if(!pPixels)return false;
      
      			SelectObject(hdcShotNew, Oldbmp);
      
      			if(!GetDIBits(hdcShotNew, hbmapNew, 0, bm.bmHeight, pPixels, &bmi, DIB_RGB_COLORS))
      			{
      				ReleaseDC(appWnd, hdcShot);
      				delete[] pPixels;
      				return false;
      			}
      			ReleaseDC(appWnd, hdcShot);
      
      			ScanContents scanContentsMain(bm, rcWindow, pPixels);
      
      			ScanBMP(&scanContentsMain);
      			
      			if(pPixels)
      				free(pPixels);
      			SelectObject(hdcShot, hbmapOld);
      			DeleteObject(hbmap);
      			DeleteDC(hdcShot);
      			DeleteObject(hbmapNew);
      			DeleteObject(Oldbmp);
      			DeleteDC(hdcShotNew);
      			
      		}
      	}
      }
      
      	
      void SetupBitmapInfo(BITMAPINFO &bmi, int bWidth, int bHeight, int bitsPerPixel)
      {
      	bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
      	bmi.bmiHeader.biWidth = bWidth;
      	bmi.bmiHeader.biHeight = bHeight;
      	bmi.bmiHeader.biPlanes = 1;
      	bmi.bmiHeader.biBitCount = bitsPerPixel;
      	bmi.bmiHeader.biCompression = BI_RGB;
      	bmi.bmiHeader.biSizeImage = 0;
      }
      
      void ShootBot(int x, int y)
      {
      	mouse_event(MOUSEEVENTF_LEFTDOWN,x, y,0,0);
      	mouse_event(MOUSEEVENTF_LEFTUP,x, y,0,0);
      }
      
      void ScanBMP(ScanContents * scan)
      {
      	for(int y = (scan->RcWindow.bottom - scan->RcWindow.top)/2;
      		y < ((scan->RcWindow.bottom - scan->RcWindow.top) - (scan->RcWindow.bottom - scan->RcWindow.top)/3.5);
      		y++)
      	{
      	for(int x = (scan->RcWindow.bottom - scan->RcWindow.top)/4;
      		x < ((scan->RcWindow.bottom - scan->RcWindow.top) - (scan->RcWindow.bottom - scan->RcWindow.top)/4);
      		x++)
      	{
      		SetCursorPos(x+scan->RcWindow.left, (y+4)+scan->RcWindow.top);
      
      		if(CompareColour(scan->PPixels, scan->Bm.bmHeight, scan->Bm.bmWidth, x, y))
      		{
      			//SetCursorPos(x+scan->RcWindow.left, (y+4)+scan->RcWindow.top);
      			
      
      			POINT currentPos;
      			GetCursorPos(&currentPos);
      
      			ShootBot(x+scan->RcWindow.left, y+scan->RcWindow.top);
      			
      			CurrentMouseXY.X = currentPos.x;
      			CurrentMouseXY.Y = currentPos.y;
      			return;
      			}
      		}
      	}
      }
      
      
      
      bool CompareColour(RGBQUAD * pPixels, int height, int width, int x, int y)
      {
      	int p = (height-y-1)*width+x;
      
      	std::cout << (int)pPixels[p].rgbRed << ", " << (int)pPixels[p].rgbGreen << ", " << (int)pPixels[p].rgbBlue <<std::endl;
      	if((int)pPixels[p].rgbRed < 30 && (int)pPixels[p].rgbGreen < 30 && (int)pPixels[p].rgbBlue > 215)
      	{
      		return true;
      	}
      
      	if(GetAsyncKeyState(VK_ESCAPE))
      	{
      		exit(0);
      	}
      	return false;
      }

    2. #2
      Newbie
      xnubcoderx
       
      Annoyed
       
      bhupesh's Avatar
      Join Date
      Sep 2012
      Posts
      36
      Thanks (-->)
      7
      Thanks (<--)
      1
      Thats only ur main.cpp
      post both of the codes
      so statics.h something like that and main.cpp

    3. #3
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      darklord92's Avatar
      Join Date
      Mar 2013
      Posts
      6
      Thanks (-->)
      0
      Thanks (<--)
      0
      here is my ScanContents...

      Code:
      #include <process.h>
      #include <iostream>
      #include <Windows.h>
      #include <ctime>
      
      
      class ScanContents
      {
      public:
      	BITMAP Bm;
      	RECT RcWindow;
      	RGBQUAD * PPixels;
      
      	ScanContents(BITMAP bm, RECT rcWindow, RGBQUAD * pPixels)
      	{
      		Bm = bm;
      		RcWindow = rcWindow;
      		PPixels = pPixels;
      	}
      };
      
      class MouseCoord
      {
      public:
      	int X;
      	int Y;
      	MouseCoord(int x, int y)
      	{
      		X = x;
      		Y = y;
      	}
      };

    4. #4
      Newbie
      xnubcoderx
       
      Annoyed
       
      bhupesh's Avatar
      Join Date
      Sep 2012
      Posts
      36
      Thanks (-->)
      7
      Thanks (<--)
      1
      The code seems to be wrong. I highly recommend you PM fleep, crypt or c5. Active ones> Crypt. and c5 sometimes. Fleep barely log's in because he has a lot of other things to do while the other 2 can spare

      Hope your code works. Good Luck
      Bhupesh.

    5. #5
      RTFM
      Shootin Pool!
       
      Coding
       
      Syperus's Avatar
      Join Date
      Oct 2012
      Location
      127.0.0.1
      Posts
      436
      Thanks (-->)
      101
      Thanks (<--)
      131
      Quote Originally Posted by bhupesh View Post
      The code seems to be wrong. I highly recommend you PM fleep, crypt or c5. Active ones> Crypt. and c5 sometimes. Fleep barely log's in because he has a lot of other things to do while the other 2 can spare

      Hope your code works. Good Luck
      Bhupesh.
      One of the people you mentioned posted right above you.
      Blacks Ops Zombies, BioShock Infinite Array of Bytes
      "People say I'm a bad influence. I say the world's already fucked, I'm just adding to it" -Eminem

    6. #6
      Hacker
      Learning to hack games!
       
      Pawning
       
      Fleep's Avatar
      Join Date
      May 2012
      Posts
      626
      Thanks (-->)
      208
      Thanks (<--)
      743
      Quote Originally Posted by bhupesh View Post
      The code seems to be wrong. I highly recommend you PM fleep, crypt or c5. Active ones> Crypt. and c5 sometimes. Fleep barely log's in because he has a lot of other things to do while the other 2 can spare

      Hope your code works. Good Luck
      Bhupesh.
      Regardless of my signature text, I am on the site many times a day.
      I simply have been taking a more admin role recently until I can get back to tutorials again.

      Fleep

    7. #7
      Newbie
      xnubcoderx
       
      Annoyed
       
      bhupesh's Avatar
      Join Date
      Sep 2012
      Posts
      36
      Thanks (-->)
      7
      Thanks (<--)
      1
      Quote Originally Posted by Fleep View Post
      Regardless of my signature text, I am on the site many times a day.
      I simply have been taking a more admin role recently until I can get back to tutorials again.

      Fleep
      Okay, but please check out my post on [Help] DirectX chams not working. Please and Thanks

    8. #8
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      darklord92's Avatar
      Join Date
      Mar 2013
      Posts
      6
      Thanks (-->)
      0
      Thanks (<--)
      0
      Silent VPN
      So does this mean i need to get rid of the int x? im a bit confused, sorry it took a while to get back to you

    Similar Game Hacker Threads

    1. [Help] Need assistance with color aimbot
      By HelpMe in forum GH Tutorials Help
      Replies: 10
      Last Post: 01-18-2016, 08:46 PM
    2. [Help] Color AimBot rewrite.
      By oriontal in forum GH Tutorials Help
      Replies: 1
      Last Post: 03-12-2015, 06:00 PM
    3. [Help] Color aimbot help!!
      By rickblack28 in forum Hacking Help
      Replies: 4
      Last Post: 11-04-2014, 12:03 PM
    4. [Help] Color aimbot tutorial using c++
      By JavaProgrammer in forum GH Tutorials Help
      Replies: 6
      Last Post: 01-01-2013, 04:22 PM
    5. [Help] Color Aimbot Exiting & COD4
      By maptwo3 in forum GH Tutorials Help
      Replies: 4
      Last Post: 06-16-2012, 08:15 PM

    Tags for this Thread