Показать сообщение отдельно

  #6367  
Старый 22.08.2022, 22:00
savva7906
Новичок
Регистрация: 22.08.2022
Сообщений: 2
С нами: 1962541

Репутация: 1
По умолчанию

Как объединить 2 main в 1 и привязать к imgui меню?

Цитата:
Сообщение от Спойлер  


Код:





Код:
#include "memory.h"
#include "vector.h"
#include 
namespace
offset
{
constexpr
::
std
::
ptrdiff_t  localPlayer
=
0xDC04CC
;
constexpr
::
std
::
ptrdiff_t  flags
=
0x104
;
constexpr
::
std
::
ptrdiff_t  forceJump
=
0x52868EC
;
constexpr
::
std
::
ptrdiff_t  entityList
=
0x52868EC
;
constexpr
::
std
::
ptrdiff_t  teamNum
=
0xF4
;
// клиент
constexpr
::
std
::
ptrdiff_t dwLocalPlayer
=
0xDC04CC
;
constexpr
::
std
::
ptrdiff_t dwEntityList
=
0x4DDC90C
;
// двигатель
constexpr
::
std
::
ptrdiff_t dwClientState
=
0x58CFDC
;
constexpr
::
std
::
ptrdiff_t dwClientState_ViewAngles
=
0x4D90
;
constexpr
::
std
::
ptrdiff_t dwClientState_GetLocalPlayer
=
0x180
;
// организация
constexpr
::
std
::
ptrdiff_t m_dwBoneMatrix
=
0x26A8
;
constexpr
::
std
::
ptrdiff_t m_bDormant
=
0xED
;
constexpr
::
std
::
ptrdiff_t m_iTeamNum
=
0xF4
;
constexpr
::
std
::
ptrdiff_t m_lifeState
=
0x25F
;
constexpr
::
std
::
ptrdiff_t m_vecOrigin
=
0x138
;
constexpr
::
std
::
ptrdiff_t m_vecViewOffset
=
0x108
;
constexpr
::
std
::
ptrdiff_t m_aimPunchAngle
=
0x303C
;
constexpr
::
std
::
ptrdiff_t m_bSpottedByMask
=
0x980
;
}
constexpr
Vector3
CalculateAngle
(
const
Vector3
&
localPosition
,
const
Vector3
&
enemyPosition
,
const
Vector3
&
viewAngles
)
noexcept
{
return
(
(
enemyPosition
-
localPosition
)
.
ToAngle
(
)
-
viewAngles
)
;
}
main
(
)
{
// инициализировать класс памяти
const
auto
memory
=
Memory
{
"csgo.exe"
}
;
// адреса модулей
const
auto
client
=
memory
.
GetModuleAddress
(
"client.dll"
)
;
const
auto
engine
=
memory
.
GetModuleAddress
(
"engine.dll"
)
;
// бесконечный цикл
while
(
true
)
{
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
1
)
)
;
// кнопка aimbot
if
(
!
GetAsyncKeyState
(
VK_XBUTTON2
)
)
continue
;
// получить местнахождения игрока
const
auto
localPlayer
=
memory
.
Read

(
client
+
offset
::
dwLocalPlayer
)
;
const
auto
localTeam
=
memory
.
Read

(
localPlayer
+
offset
::
m_iTeamNum
)
;
// eye position = origin + viewOffset
const
auto
localEyePosition
=
memory
.
Read

(
localPlayer
+
offset
::
m_vecOrigin
)
+
memory
.
Read

(
localPlayer
+
offset
::
m_vecViewOffset
)
;
const
auto
clientState
=
memory
.
Read

(
engine
+
offset
::
dwClientState
)
;
const
auto
localPlayerId
=
memory
.
Read

(
clientState
+
offset
::
dwClientState_GetLocalPlayer
)
;
const
auto
viewAngles
=
memory
.
Read

(
clientState
+
offset
::
dwClientState_ViewAngles
)
;
const
auto
aimPunch
=
memory
.
Read

(
localPlayer
+
offset
::
m_aimPunchAngle
)
*
2
;
// значение fov aimbot
auto
bestFov
=
8.f
;
auto
bestAngle
=
Vector3
{
}
;
for
(
auto
i
=
1
;
i

(
client
+
offset
::
dwEntityList
+
i
*
0x10
)
;
if
(
memory
.
Read

(
player
+
offset
::
m_iTeamNum
)
==
localTeam
)
continue
;
if
(
memory
.
Read

(
player
+
offset
::
m_bDormant
)
)
continue
;
if
(
memory
.
Read

(
player
+
offset
::
m_lifeState
)
)
continue
;
if
(
memory
.
Read

(
player
+
offset
::
m_bSpottedByMask
)
&
(
1

(
player
+
offset
::
m_dwBoneMatrix
)
;
// положение головы игрока в 3D-пространстве
//индекс костей
const
auto
playerHeadPosition
=
Vector3
{
memory
.
Read

(
boneMatrix
+
0x30
*
8
+
0x0C
)
,
memory
.
Read

(
boneMatrix
+
0x30
*
8
+
0x1C
)
,
memory
.
Read

(
boneMatrix
+
0x30
*
8
+
0x2C
)
}
;
const
auto
angle
=
CalculateAngle
(
localEyePosition
,
playerHeadPosition
,
viewAngles
+
aimPunch
)
;
const
auto
fov
=
std
::
hypot
(
angle
.
x
,
angle
.
y
)
;
if
(
fov

(
clientState
+
offset
::
dwClientState_ViewAngles
,
viewAngles
+
bestAngle
/
1.f
)
;
// значение smoothing
}
}
main
(
)
{
const
auto
memory
=
Memory
{
"csgo.exe"
}
;
const
auto
client
=
memory
.
GetModuleAddress
(
"client.dll"
)
;
while
(
true
)
{
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
1
)
)
;
const
auto
localPlayer
=
memory
.
Read

(
client
+
offset
::
localPlayer
)
;
if
(
!
localPlayer
)
continue
;
const
auto
localPlayerTeam
=
memory
.
Read

(
localPlayer
+
offset
::
teamNum
)
;
const
auto
localPlayerFlags
=
memory
.
Read

(
localPlayer
+
offset
::
flags
)
;
// сам бхоп
if
(
GetAsyncKeyState
(
VK_SPACE
)
)
(
localPlayerFlags
&
(
1

(
client
+
offset
::
forceJump
,
6
)
:
memory
.
Write

(
client
+
offset
::
forceJump
,
4
)
;
}
}


 
Ответить с цитированием