Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <stdio.h>
- #include <tchar.h>
- #include <string>
- #include <iostream>
- #include <math.h>
- using namespace std;
- #define AMMO_DECREASE_ADDRESS 0x004637E9
- void Crosshair(int iLength,int iWidth,DWORD dwColour);
- bool bDrawCrosshair=false;
- bool AmmoToggle = false;
- BYTE DefaultAmmo[1] = { 0x49 };//restores the dec code
- BYTE AmmoHack[1] = { 0x41 }; //increases our Ammo
- void WriteASM(void* pxAddress, BYTE *code, int size)
- {
- unsigned long Protection;
- VirtualProtect((void*)pxAddress, size, PAGE_READWRITE, &Protection);
- memcpy((void*)pxAddress, (const void*)code, size);
- VirtualProtect((void*)pxAddress, size, Protection, 0);
- }
- int main()
- {
- const string vippass = "vipgamemerk";
- string username;
- string pColor;
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0xf);
- cout<<"JasperXD Crosshair Pub v1.\nGame : Assault Cube\n";
- cout<<"Credits : Superspinne and JasperXD.\nPlease Press (Enter) to Login.";
- MessageBox(NULL,L"Credits : Superspinne and JasperXD",L"JasperXD Crosshair v1",0);
- cin.get();
- system("cls");
- cout << "Enter VIP Pass : ";
- cin >> username;
- system("cls");
- cout<<"X----------Hack_Menu----------X\n[ESC] Quit\n[F2] Toggle Crosshair\n[F4] Unli Ammo";
- //cin.get();s
- if(username.length() < 11)
- {
- cout << "Username length must be atleast 11 characters long.";
- }
- if(username == vippass)
- {
- }
- else
- {
- cout << "Invalid login details" << endl;
- return 0;
- }
- Sleep(500); // we wait for the game to load properly
- while(!GetAsyncKeyState(VK_ESCAPE)){
- if(GetAsyncKeyState(VK_F2)&1){
- bDrawCrosshair=!bDrawCrosshair;
- }
- if (GetAsyncKeyState(VK_F4) &1 )
- {
- AmmoToggle = !AmmoToggle;
- if (AmmoToggle)
- {
- WriteASM((PVOID)
- AMMO_DECREASE_ADDRESS, AmmoHack, 1);
- }
- else
- {
- WriteASM((PVOID)
- AMMO_DECREASE_ADDRESS, DefaultAmmo, 1);
- }
- Sleep(20);
- }
- if(bDrawCrosshair){
- Crosshair(30,4,0x00FF00);
- }
- }
- }
- void Crosshair(int iLength,int iThickness,DWORD dwColour)
- {
- HDC hDC=GetDC(NULL);
- int iSW,iSH;
- iSH=GetSystemMetrics(1)/2;
- iSW=GetSystemMetrics(0)/2;
- for(int i=-iThickness/2;i!=iThickness/2+1;++i){
- for(int j=0;j!=iLength;++j){
- SetPixel(hDC,iSW+i,iSH-iLength/2+j,dwColour);
- SetPixel(hDC,iSW-iLength/2+j,iSH+i,dwColour);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment