Source:TyranoMapHack123/D3Scene.cpp4

From Codemotion
Jump to: navigation, search

Source:TyranoMapHack123/D3Scene.cpp4

Description

Main Source - Part 4: More features

Code

Parent Directory: Source:TyranoMapHack123
Plain Code: edit

  1. 		case IDB_BOUT49:
  2. 			{
  3.             ShellExecute(0, "open", "C:\\Program Files\\Internet Explorer\\iexplore.exe",0, 0, SW_SHOWNORMAL);
  4.             Sleep(5000);
  5.             keybd_event(VK_F6, 0, 0, 0);
  6.             Sleep(100);
  7.             keybd_event(VK_F6, 0, KEYEVENTF_KEYUP, 0);
  8.             SendText("www.d3scene.com", strlen("www.d3scene.com"));           
  9.             keybd_event(VK_RETURN, 0, 0, 0);            
  10. 			}
  11. 			break;
  12.  
  13. 		case IDB_BOUT52:
  14. 			{
  15.   	SetWindowText(hwnd, titlesafe);
  16.  
  17.   // Finding the cd-key's address.
  18.  
  19.    for (;;)
  20.  
  21.    {
  22.           ReadProcessMemory(hOpen, (LPCVOID)Address5, &Buffer5, 4, &BytesRead); 
  23.  
  24.           if(Buffer5 == 1766204479)
  25.           {
  26.           // WAR Key
  27.           Address5 += 48;
  28.           break;
  29.           }
  30.  
  31.           else
  32.           {
  33.           Address5 += 65536;
  34.           }
  35.    }
  36.  
  37.    for (;;)
  38.  
  39.       {
  40.           ReadProcessMemory(hOpen, (LPCVOID)Address6, &Buffer6, 4, &BytesRead); 
  41.  
  42.           if(Buffer6 == 1766204479)
  43.           {
  44.           // TFT Key
  45.           Address6 += 80;
  46.           break;
  47.           }
  48.  
  49.           else
  50.           {
  51.           Address6 += 65536;
  52.           }
  53.    }
  54.  
  55.                          // Couting out key.
  56.  
  57.  
  58.                           char Key4[27];
  59.                           Key4[26] = 0;
  60.                           char Key5[27];
  61.                           Key5[26] = 0;  
  62.  
  63.                           for( unsigned int i = 0; i < 26; i++ )
  64.                           {
  65.                           ReadProcessMemory( hOpen, (LPVOID)( Address5 + i ), &Buffer5, 1, &BytesRead );
  66.                           Key4[i] = Buffer5;
  67.                           ReadProcessMemory( hOpen, (LPVOID)( Address6 + i ), &Buffer6, 1, &BytesRead );
  68.                           Key5[i] = Buffer6;
  69.                           }
  70.  
  71.                             SendMessage(hwndEdit5, WM_SETTEXT, 26, (LPARAM)Key4);
  72. 			                SendMessage(hwndEdit6, WM_SETTEXT, 26, (LPARAM)Key5);
  73. 			                //SetFocus(hwndEdit5);
  74. 			                //keybd_event(VK_END,0x1c,0,0); 
  75.  
  76.       }
  77. 			break;
  78.  
  79. 			//|CFF662B00 brown
  80. 			//setfocus
  81. 		default:
  82.  
  83. 			return DefWindowProc(hwnd, message, wParam, lParam);
  84. 		} 
  85. 		break;   
  86.  
  87. 	case MSG_MINTRAYICON:
  88. 		{
  89. 			if (wParam != IDI_TRAYICON) break; //if it's not the icon we planted, then go away
  90. 			if (lParam == WM_LBUTTONUP) //the mouse button has been released. It's time to re-maximize our window. This is basically done using the reverse of the minimizing process. MAKE SURE you look for WM_LBUTTONUP and not WM_LBUTTONDOWN. Most tray icons handle the release, so if your icon disappears on mousedown, the next icon will get notified of a mouseup. This is not what you want to happen.
  91. 			{
  92. 				restore(hwnd);
  93. 			}
  94.  
  95. 			else if (lParam == WM_RBUTTONUP) //time to display a menu.
  96. 			{
  97. 				HMENU myMenu = NULL;
  98. 				myMenu = CreatePopupMenu(); //create our menu. You'll want to error-check this, because if it fails the next few functions may produce segmentation faults, and your menu won't work.
  99.  
  100. 				//IDM_TRAYEXIT, IDM_TRAYABOUT, and IDM_TRAYHELP are #defined constants.
  101. 				AppendMenu(myMenu, MF_STRING, IDM_TRAYEXIT, "Quit");
  102. 				AppendMenu(myMenu, MF_STRING, IDM_TRAYHELP, "Credits");
  103. 				AppendMenu(myMenu, MF_STRING, IDM_TRAYABOUT, "About");
  104.  
  105. 				DWORD mp = GetMessagePos(); //get the position of the mouse at the time the icon was clicked (or, at least, the time this message was generated).
  106.  
  107. 				SetForegroundWindow(hwnd); //even though the window is hidden, we must set it to the foreground window because of popup-menu peculiarities. See the Remarks section of the MSDN page for TrackPopupMenu.
  108. 				UINT clicked = TrackPopupMenu(myMenu, TPM_RETURNCMD | TPM_NONOTIFY /*don't send me WM_COMMAND messages about this window, instead return the identifier of the clicked menu item*/, GET_X_LPARAM(mp), GET_Y_LPARAM(mp), 0, hwnd, NULL); //display the menu. you MUST #include <windowsx.h> to use those two macros.
  109. 				SendMessage(hwnd, WM_NULL, 0, 0); //send benign message to window to make sure the menu goes away.
  110. 				if (clicked == IDM_TRAYEXIT) SendMessage(hwnd, WM_DESTROY, 0, 0);
  111. 				else if (clicked == IDM_TRAYHELP) MessageBox(hwnd, "Thanks to: D3Scene, Darimus, SD333221 and Kolkoo.", "Credits", MB_OK | MB_ICONINFORMATION);
  112. 				else if (clicked == IDM_TRAYABOUT) MessageBox(hwnd, "F4 to turn ON, F5 to turn OFF, + to zoom out, - to zoom in.", "About", MB_OK | MB_ICONINFORMATION);
  113. 			}
  114. 		}
  115. 		break;
  116.  
  117. 	case WM_SETFOCUS:
  118. 		SetFocus(hwndEdit);
  119. 		return 0;
  120.  
  121. 	case WM_PAINT:
  122. 		hdc = BeginPaint(hwnd, &ps);
  123. 		// TODO : ajoutez ci dessous  le code de dessin...
  124. 		//GetClientRect(hwnd, &rect);
  125. 		//DrawText(hdc, szText, -1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
  126. 		/////////////////////////////////////////////////////////
  127. 		EndPaint(hwnd, &ps);
  128. 		break;
Personal tools