allen434343

Untitled

Jul 25th, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <stdio.h>
  3. #include <tchar.h>
  4. #include <string>
  5. #include <iostream>
  6. #include <math.h>
  7. using namespace std;
  8.  
  9. #define AMMO_DECREASE_ADDRESS 0x004637E9
  10. void Crosshair(int iLength,int iWidth,DWORD dwColour);
  11. bool bDrawCrosshair=false;
  12. bool AmmoToggle = false;
  13. BYTE DefaultAmmo[1] = { 0x49 };//restores the dec code
  14. BYTE AmmoHack[1] = { 0x41 }; //increases our Ammo
  15.  
  16. void WriteASM(void* pxAddress, BYTE *code, int size)
  17. {
  18. unsigned long Protection;
  19. VirtualProtect((void*)pxAddress, size, PAGE_READWRITE, &Protection);
  20. memcpy((void*)pxAddress, (const void*)code, size);
  21. VirtualProtect((void*)pxAddress, size, Protection, 0);
  22. }
  23.  
  24. int main()
  25. {
  26. const string vippass = "vipgamemerk";
  27. string username;
  28. string pColor;
  29. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 0xf);
  30. cout<<"JasperXD Crosshair Pub v1.\nGame : Assault Cube\n";
  31. cout<<"Credits : Superspinne and JasperXD.\nPlease Press (Enter) to Login.";
  32. MessageBox(NULL,L"Credits : Superspinne and JasperXD",L"JasperXD Crosshair v1",0);
  33. cin.get();
  34. system("cls");
  35. cout << "Enter VIP Pass : ";
  36. cin >> username;
  37. system("cls");
  38. cout<<"X----------Hack_Menu----------X\n[ESC] Quit\n[F2] Toggle Crosshair\n[F4] Unli Ammo";
  39. //cin.get();s
  40.  
  41. if(username.length() < 11)
  42. {
  43. cout << "Username length must be atleast 11 characters long.";
  44. }
  45. if(username == vippass)
  46. {
  47.  
  48. }
  49. else
  50. {
  51. cout << "Invalid login details" << endl;
  52. return 0;
  53. }
  54. Sleep(500); // we wait for the game to load properly
  55. while(!GetAsyncKeyState(VK_ESCAPE)){
  56. if(GetAsyncKeyState(VK_F2)&1){
  57. bDrawCrosshair=!bDrawCrosshair;
  58. }
  59. if (GetAsyncKeyState(VK_F4) &1 )
  60. {
  61. AmmoToggle = !AmmoToggle;
  62. if (AmmoToggle)
  63. {
  64. WriteASM((PVOID)
  65. AMMO_DECREASE_ADDRESS, AmmoHack, 1);
  66. }
  67.  
  68. else
  69. {
  70. WriteASM((PVOID)
  71. AMMO_DECREASE_ADDRESS, DefaultAmmo, 1);
  72.  
  73. }
  74. Sleep(20);
  75. }
  76. if(bDrawCrosshair){
  77. Crosshair(30,4,0x00FF00);
  78. }
  79. }
  80. }
  81.  
  82. void Crosshair(int iLength,int iThickness,DWORD dwColour)
  83. {
  84. HDC hDC=GetDC(NULL);
  85. int iSW,iSH;
  86. iSH=GetSystemMetrics(1)/2;
  87. iSW=GetSystemMetrics(0)/2;
  88. for(int i=-iThickness/2;i!=iThickness/2+1;++i){
  89. for(int j=0;j!=iLength;++j){
  90. SetPixel(hDC,iSW+i,iSH-iLength/2+j,dwColour);
  91. SetPixel(hDC,iSW-iLength/2+j,iSH+i,dwColour);
  92. }
  93. }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment