Ejemplo n.º 1
0
	TargetsInfo(float myCoords[], float enemyCoords[], float aim[])
	{
		distance = Get3dDistance(myCoords, enemyCoords);

		float width = (ESPwidth / distance) * 0.5;
		float height = (ESPheight / distance) * 0.65;

		AimXY[0] = aim[0];
		AimXY[1] = aim[1];		

		float xdist = (AimXY[0] - (SCREEN_WIDTH / 2));
		float ydist = (AimXY[1] - (SCREEN_HEIGHT / 2));
		AimDistance = sqrt(pow(ydist, 2) + pow(xdist, 2));

		
		
	}
Ejemplo n.º 2
0
void CEntity::Read(int Index)
{
	Address = Process->ReadMemory<DWORD>(GlobalVariables::ClientAddress + Offsets::EntityList + (Index * 0x10));
	if (Address == NULL)
	{
		Valid = false;
		return;
	}
	Health = Process->ReadMemory<int>(Address + 0xFC);
	if (Health <= 0)
	{
		Valid = false;
		return;
	}
	LifeState = Process->ReadMemory<BYTE>(Address + 0x25B);
	if (LifeState != 0)
	{
		Valid = false;
		return;
	}
	Team = Process->ReadMemory<int>(Address + 0xF0);


	Valid = true;

	Position = Process->ReadMemory<Vector3D>(Address + 0x134);
	weaponHandle = Process->ReadMemory<DWORD>(Address + 0x12C0);
	weaponIDFirst = weaponHandle & 0xFFF;
	WeaponAddress = Process->ReadMemory<DWORD>(GlobalVariables::ClientAddress + Offsets::EntityList + ((weaponIDFirst - 1) * 0x10));
	WeaponID = Process->ReadMemory<int>(WeaponAddress + 0x0000168c);
	Clip1 = Process->ReadMemory<int>(WeaponAddress + 0x000015c0);
	//Clip2 = Process->ReadMemory<int>(WeaponAddress + 0x000015c4);
	ShotsFired = Process->ReadMemory<int>(Address + 0x00001d60);
	IsLocalPlayer = Process->ReadMemory<bool>(Address + 0x19c0);
	if (IsLocalPlayer)
	{
		Valid = false;
		LocalPlayer->weaponHandle = weaponHandle;
		LocalPlayer->weaponIDFirst = weaponIDFirst;
		LocalPlayer->WeaponAddress = WeaponAddress;
		LocalPlayer->WeaponID = WeaponID;
		LocalPlayer->Clip1 = Clip1;
		LocalPlayer->Clip2 = Clip2;
		LocalPlayer->ShotsFired = ShotsFired;
		return;
	}
	
	IsOnScreen = WorldToScreen(Position, PosOnScreen);
	PseudoHeadPosInGame = Vector3D{ Position.x, Position.y, Position.z + 70.0f };
	PseudoHeadIsOnScreen = WorldToScreen(PseudoHeadPosInGame, PseudoHeadPosOnScreen);
	if (!IsOnScreen && !PseudoHeadIsOnScreen && !IsLocalPlayer)
	{
		return;
	}
	Spotted = Process->ReadMemory<bool>(Address + 0x935);
	BoneAddress = Process->ReadMemory<DWORD>(Address + 0xA78);
	//MoveSpeed = Process->ReadMemory<float>(Address + 0xAD0);
	flags = Process->ReadMemory<int>(Address + 0x100);
	Velocity = Process->ReadMemory<Vector3D>(Address + 0x110);

	BoxHeight = PosOnScreen.y - PseudoHeadPosOnScreen.y;
	BoxWidth = BoxHeight*0.35;

	Box.left = PosOnScreen.x - BoxWidth/2;
	Box.top = PseudoHeadPosOnScreen.y;
	Box.right = PosOnScreen.x + BoxWidth/2;
	Box.bottom = PosOnScreen.y;


	Distance = Get3dDistance(Position, LocalPlayer->Position);

	if (BoneAddress != NULL)
	{
		ValidBones = true;
		ReadBonesMatrix();
		ReadBoneFromMatrix(10);
		ReadBoneFromMatrix(5);
		ReadBoneFromMatrix(4);
		ReadBoneFromMatrix(2);
		if (Get3dDistance(Position, Bone[2].PositionInGame) > 100)
			ValidBones = false;
	}
}
Ejemplo n.º 3
0
void render_frame(void)
{


	d3ddev->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_ARGB(0, 0, 0, 0), 1.0f, 0);

	d3ddev->BeginScene();


	if (radar)
	{
		for (int i = 0; i < 64; i++)
		{
			int playerX = playersInfo[i].Position[0] - localPlayerStruct.Position[0];
			int playerY = playersInfo[i].Position[1] - localPlayerStruct.Position[1];

			float radarPosX = 116;
			float radarPosY = 150;

			if (localPlayerStruct.Position != playersInfo[i].Position)
			{
				if (playersInfo[i].teamNum == vLTeamNum && playersInfo[i].Health > 0 && playersInfo[i].Health <= 100 && playersInfo[i].lifeState != 0)
				{
					DrawRect((radarPosX + (playerX / RectSize)), (radarPosY + -(playerY / RectSize)), 5, 5, D3DCOLOR_ARGB(255, 0, 0, 255));
					
					if (WorldToScreen(playersInfo[i].Position, PlayerXY))
					{
						DrawESP(playersInfo[i].Health, PlayerXY[0] - m_Rect.left, PlayerXY[1] - m_Rect.top, Get3dDistance(localPlayerStruct.Position, playersInfo[i].Position), D3DCOLOR_XRGB(0, 0, 255));
					}
					
				}
				else if (playersInfo[i].teamNum != vLTeamNum && playersInfo[i].Health > 0 && playersInfo[i].Health <= 100 && playersInfo[i].lifeState != 0)
				{
					DrawRect((radarPosX + (playerX / RectSize)), (radarPosY + -(playerY / RectSize)), 5, 5, D3DCOLOR_ARGB(255, 0, 255, 0));
					if (WorldToScreen(playersInfo[i].Position, EnemyXY))
					{
						std::stringstream os;
						os << playersInfo[i].Health;
						DrawESP(playersInfo[i].Health, EnemyXY[0] - m_Rect.left, EnemyXY[1] - m_Rect.top, Get3dDistance(localPlayerStruct.Position, playersInfo[i].Position), D3DCOLOR_XRGB(255, 0, 0));
						DrawString(EnemyXY[0] - m_Rect.left, EnemyXY[1] - m_Rect.top, 12, D3DCOLOR_XRGB(255, 255, 0), pFont, (LPCSTR)os.str().c_str());
					}
					if (WorldToScreen(playersInfo[i].boneXYZ, BoneXY))
					{
						DrawRect(BoneXY[0], BoneXY[1], 5, 5, D3DCOLOR_XRGB(255, 0, 0));
					}
				}
			}
			

			//std::stringstream Test;
			//Test << playersInfo[i].vis ;

			

			//playersInfo[i].x = 0;
			//playersInfo[i].y = 0;
			//playersInfo[i].Health = 0;
			playersInfo[i].lifeState = 0;
		}
	}
	
	
	//DrawESP(ESPx, ESPy, ESPd, D3DCOLOR_XRGB(255, 255, 255));

	DrawBox((SCREEN_WIDTH / 2) - aimbotSize, (SCREEN_HEIGHT / 2) - aimbotSize, aimbotSize * 2, aimbotSize * 2, D3DCOLOR_XRGB(255, 0, 180));
	
	d3ddev->EndScene();

	d3ddev->Present(NULL, NULL, NULL, NULL);

}
Ejemplo n.º 4
0
int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
                     _In_opt_ HINSTANCE hPrevInstance,
                     _In_ LPTSTR    lpCmdLine,
                     _In_ int       nCmdShow)
{
	HWND hWnd;
	WNDCLASSEX wc;

	ZeroMemory(&wc, sizeof(WNDCLASSEX));

	wc.cbSize = sizeof(WNDCLASSEX);
	wc.style = CS_HREDRAW | CS_VREDRAW;
	wc.lpfnWndProc = WndProc;
	wc.hInstance = hInstance;
	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
	wc.hbrBackground = (HBRUSH)RGB(0, 0, 0);
	wc.lpszClassName = "WindowClass";

	RegisterClassEx(&wc);	

		hWnd = CreateWindowEx(NULL,
			"WindowClass",
			"DirectX Test",
			WS_EX_TOPMOST | WS_POPUP,
			0, 0,
			SCREEN_WIDTH, SCREEN_HEIGHT,
			NULL,
			NULL,
			hInstance,
			NULL);


	SetWindowLong(hWnd, GWL_EXSTYLE, (int)GetWindowLong(hWnd, GWL_EXSTYLE) | WS_EX_LAYERED | WS_EX_TRANSPARENT);
	//SetLayeredWindowAttributes(hWnd, RGB(0, 0, 0), 0, ULW_COLORKEY);
	SetLayeredWindowAttributes(hWnd, RGB(0, 0, 0), 255, LWA_ALPHA);

	ShowWindow(hWnd, nCmdShow);

	// set up and initialize Direct3D
	initD3D(hWnd);	

	DWORD   dwThreadIdArray[MAX_THREADS];
	HANDLE  hThreadArray[MAX_THREADS];
	
	for (int i = 0; i < MAX_THREADS; i++)
	{
		hThreadArray[i] = CreateThread(
			NULL,
			0,
			(LPTHREAD_START_ROUTINE)mainThread,
			NULL,
			0,
			&dwThreadIdArray[i]);
	}
	
	m_Rect.left = 0;
	m_Rect.top = 0;
	m_Rect.right = SCREEN_WIDTH;
	m_Rect.bottom = SCREEN_HEIGHT;

	D3DXCreateFont(d3ddev, 10, 0, FW_BOLD, 1, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &pFont);
	// enter the main loop:
	MSG msg;
	::SetWindowPos(FindWindow(NULL, LGameWindow), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
	while (TRUE)
	{		
		Sleep(10);		
		::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, NULL);		
		
		while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}

		if (msg.message == WM_QUIT)
			break;

		HWND hGameWindow = NULL;
		HANDLE hProcHandle = NULL;
		float vPunchX = NULL;
		float vPunchY = NULL;
		float vPunchZ = NULL;

		if (GetAsyncKeyState(VK_OEM_PLUS))
		{
			RectSize += 0.1f;
		}

		if (GetAsyncKeyState(VK_OEM_MINUS))
		{
			if (RectSize > 1)
			{
				RectSize -= 0.1f;
			}
		}

		if (GetAsyncKeyState(VK_NUMPAD7))
		{
			aimbotSize += 1;
		}
		if (GetAsyncKeyState(VK_NUMPAD8))
		{
			aimbotSize -= 1;
		}

		if (GetAsyncKeyState(VK_NUMPAD5))
		{
			readBone += 1;
			Sleep(200);
		}
		if (GetAsyncKeyState(VK_NUMPAD6) && readBone != 0)
		{
			readBone -= 1;
			Sleep(200);
		}

		hGameWindow = FindWindow(NULL, LGameWindow);
		if (hGameWindow)
		{
			GetWindowThreadProcessId(hGameWindow, &dwProcID);
			if (dwProcID != 0)
			{
				hProcHandle = OpenProcess(PROCESS_ALL_ACCESS, false, dwProcID);
				if (hProcHandle == INVALID_HANDLE_VALUE || hProcHandle == NULL)
				{
					IsGameAvail = false;
				}
				else
				{
					IsGameAvail = true;
				}
			}
		}

		if (IsGameAvail)
		{
			GetWindowRect(FindWindow(NULL, LGameWindow), &m_Rect);

			if (GetAsyncKeyState(VK_NUMPAD9))
			{
				toggle = false;
				radar = false;
				trigger = false;
				norecoil = false;
			}

			if (GetAsyncKeyState(VK_NUMPAD1))
			{
				toggle = true;
			}

			if (GetAsyncKeyState(VK_NUMPAD2))
			{
				radar = true;
			}

			if (GetAsyncKeyState(VK_NUMPAD3))
			{
				trigger = true;
			}

			if (GetAsyncKeyState(VK_NUMPAD4))
			{
				norecoil = true;
			}

			if (toggle)
			{

				DWORD ClientBase = Module("client.dll");
				DWORD temp1 = ClientBase + LocalPlayer;
				ReadProcessMemory(hProcHandle, (LPCVOID)temp1, &dwLocalPlayer, 4, NULL);

				/* Reads the value of InCross */
				DWORD inCross = dwLocalPlayer + InCrosshair;
				DWORD ReadInCross = inCross;

				DWORD Lpitch = dwLocalPlayer + viewOffsetX;
				DWORD Lyaw = dwLocalPlayer + viewOffsetY;

				ReadProcessMemory(hProcHandle, (LPCVOID)Lpitch, &localPlayerStruct.pitch, sizeof(localPlayerStruct.viewAng), 0);
				ReadProcessMemory(hProcHandle, (LPCVOID)Lyaw, &localPlayerStruct.yaw, sizeof(localPlayerStruct.yaw), 0);

				ReadProcessMemory(hProcHandle, (LPCVOID)ReadInCross, &vInCross, sizeof(vInCross), 0);

				/* Read the value of LocalPlayer-TeamNum */
				DWORD LTeamNum = dwLocalPlayer + teamNumber;
				DWORD ReadLTeamNum = LTeamNum;
				
				ReadProcessMemory(hProcHandle, (LPCVOID)ReadLTeamNum, &vLTeamNum, sizeof(vLTeamNum), 0);

				DWORD LPosX = dwLocalPlayer + PositionX;
				DWORD LPosY = dwLocalPlayer + PositionY;
				DWORD LPosZ = dwLocalPlayer + PositionZ;

				ReadProcessMemory(hProcHandle, (LPCVOID)LPosX, &localPlayerStruct.Position[0], sizeof(localPlayerStruct.Position[0]), 0);
				ReadProcessMemory(hProcHandle, (LPCVOID)LPosY, &localPlayerStruct.Position[1], sizeof(localPlayerStruct.Position[1]), 0);
				ReadProcessMemory(hProcHandle, (LPCVOID)LPosZ, &localPlayerStruct.Position[2], sizeof(localPlayerStruct.Position[2]), 0);

				localPlayerStruct.teamNum = vLTeamNum;


				DWORD temp51 = ClientBase + ViewMatrix;
				ReadProcessMemory(hProcHandle, (LPCVOID)temp51, &localPlayerStruct.WorldToScreenMatrix, sizeof(localPlayerStruct.WorldToScreenMatrix), 0);

				TargetsInfo* targetsInfo = new TargetsInfo[64];

				DWORD temp100 = Module("client.dll") + 0x4A3554C + 0x50;
				DWORD temp101;

				ReadProcessMemory(hProcHandle, (LPCVOID)temp100, &temp101, sizeof(temp101), NULL);

				int targetLoop = 0;
				/* Read the Value of EnityList-TeamNum */
				for (int i = 0; i < 64; i++)
				{
					DWORD temp2 = ClientBase + EntityList + (i * EntitySize);
					ReadProcessMemory(hProcHandle, (LPCVOID)temp2, &playersInfo[i].playerAddress, sizeof(playersInfo[i].playerAddress), NULL);
					DWORD temp3 = playersInfo[i].playerAddress + teamNumber;
					ReadProcessMemory(hProcHandle, (LPCVOID)temp3, &playersInfo[i].teamNum, sizeof(playersInfo[i].teamNum), NULL);

					DWORD posX = playersInfo[i].playerAddress + PositionX;
					DWORD posY = playersInfo[i].playerAddress + PositionY;
					DWORD posZ = playersInfo[i].playerAddress + PositionZ;

					DWORD temp102 = temp101 + 0x1E0 * i;

					DWORD temp103 = temp102 + 0x24;

					ReadProcessMemory(hProcHandle, (LPCVOID)temp103, &playersInfo[i].Name, sizeof(playersInfo[i].Name), NULL);

					ReadProcessMemory(hProcHandle, (LPCVOID)posX, &playersInfo[i].Position[0], sizeof(playersInfo[i].Position[0]), NULL);
					ReadProcessMemory(hProcHandle, (LPCVOID)posY, &playersInfo[i].Position[1], sizeof(playersInfo[i].Position[1]), NULL);
					ReadProcessMemory(hProcHandle, (LPCVOID)posZ, &playersInfo[i].Position[2], sizeof(playersInfo[i].Position[2]), NULL);

					DWORD LifeState = playersInfo[i].playerAddress + LifeStatus;

					ReadProcessMemory(hProcHandle, (LPCVOID)LifeState, &playersInfo[i].lifeState, sizeof(playersInfo[i].lifeState), NULL);

					DWORD boneAddress = playersInfo[i].playerAddress + BoneMatrix;

					ReadProcessMemory(hProcHandle, (LPCVOID)boneAddress, &playersInfo[i].boneMatrixAddress, sizeof(playersInfo[i].boneMatrixAddress), NULL);

					GetBonePosition(readBone, i, hProcHandle);

					// Read the value of Health
					DWORD LHealth = playersInfo[i].playerAddress + HealthOff;
					DWORD ReadLHealth = LHealth;
					ReadProcessMemory(hProcHandle, (LPCVOID)ReadLHealth, &vLHealth, sizeof(vLHealth), 0);
					playersInfo[i].Health = vLHealth;

					playersInfo[i].distance = Get3dDistance(localPlayerStruct.Position, playersInfo[i].Position);

					float width = (ESPwidth / playersInfo[i].distance) * 0.5;
					float height = (ESPheight / playersInfo[i].distance) * 0.65;

					if (playersInfo[i].teamNum == localPlayerStruct.teamNum)
						continue;

					if (playersInfo[i].Health < 1)
						continue;

					if (playersInfo[i].lifeState == 0)
						continue;

					if (!WorldToScreen(playersInfo[i].boneXYZ, BoneXY))
						continue;

					if (BoneXY[0] < (SCREEN_WIDTH / 2) - aimbotSize || BoneXY[0] > (SCREEN_WIDTH / 2) + aimbotSize)
						continue;

					if (BoneXY[1] < (SCREEN_HEIGHT / 2) - aimbotSize || BoneXY[1] > (SCREEN_HEIGHT / 2) + aimbotSize)
						continue;

					targetsInfo[targetLoop] = TargetsInfo(localPlayerStruct.Position, playersInfo[i].Position, BoneXY);
					

					targetLoop++;

					
				}
				
				if (targetLoop > 0)
				{
					std::sort(targetsInfo, targetsInfo + targetLoop, CompareTargetEnArray());

					if (GetAsyncKeyState(0x45))
					{
						mouse_event(MOUSEEVENTF_ABSOLUTE, targetsInfo[0].AimXY[0] - (m_Rect.right / 2),
							targetsInfo[0].AimXY[1] - (m_Rect.bottom / 2), 0, 0);
					}
				}

				targetLoop = 0;

				delete [] targetsInfo;

				if (vInCross < 64 && vInCross > 0)
				{
					if (vLTeamNum != playersInfo[vInCross - 1].teamNum
						&& playersInfo[vInCross - 1].lifeState != 0
						&& !GetAsyncKeyState(0x01)
						&& trigger)
					{
						mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
						mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
					}
				}
				/*
				if (GetAsyncKeyState(0x01) && norecoil)
				{
					DWORD Lpitch = dwLocalPlayer + viewOffsetX;
					DWORD Lyaw = dwLocalPlayer + viewOffsetY;

					ReadProcessMemory(hProcHandle, (LPCVOID)Lpitch, &localPlayerStruct.pitch, sizeof(localPlayerStruct.viewAng), 0);
					ReadProcessMemory(hProcHandle, (LPCVOID)Lyaw, &localPlayerStruct.yaw, sizeof(localPlayerStruct.yaw), 0);

					DWORD anglePunchX = dwLocalPlayer + PunchX;
					DWORD anglePunchY = dwLocalPlayer + PunchY;

					float aPunchX;
					float aPunchY;

					ReadProcessMemory(hProcHandle, (LPCVOID)anglePunchX, &aPunchX, sizeof(aPunchX), NULL);
					ReadProcessMemory(hProcHandle, (LPCVOID)anglePunchY, &aPunchY, sizeof(aPunchY), NULL);

					DWORD temp40 = Module("engine.dll") + EPointer;
					DWORD temp41;
					
					ReadProcessMemory(hProcHandle, (LPCVOID)temp40, &temp41, sizeof(temp41), NULL);

					DWORD temp42 = temp41 + 0x4C90;
					DWORD temp43 = temp41 + 0x4C94;

					if (aPunchX < 0.001f && aPunchY < 0.001f)
						continue;

					localPlayerStruct.pitch -= aPunchX * 2.0f;
					localPlayerStruct.yaw -= aPunchY * 2.0f;
					WriteProcessMemory(hProcHandle, (LPVOID)temp42, &localPlayerStruct.pitch, sizeof(localPlayerStruct.pitch), NULL);
					WriteProcessMemory(hProcHandle, (LPVOID)temp43, &localPlayerStruct.yaw, sizeof(localPlayerStruct.yaw), NULL);
					
				}*/
			}
		}
	}

	// clean up DirectX and COM
	cleanD3D();
}