-
Автор темы
- #1
esp.h
ESP.cpp
[/CODE]
Всем добрый/ое утро/день/вечер, Не могу решить ошибку при компиляции,
Последний файл main.cpp
Код:
#pragma once
#include "includes.h"
#include "framework/il2cpp-appdata.h"
#include "Addrs.h"
using namespace app;
class PlayerDataArray {
public:
char pad_0012[0xF];
PlayerData* Player[40];
};
class Vector2WH
{
public:
Vector2 pos[2];
};
class ESP {
public:
inline void RRender();
inline bool GetPlayerPos(int i, Vector2WH* posInScreenTrue);
inline bool GetPlayerIsSpawnProtect(int i);
inline PlayerData* GetPlayerData(int i);
bool teamcheck;
bool espActive;
float colorWh[4] = { 0.780f, 0.031f, 0.756f,1.0f };
float colorWhS[4] = { 0.007, 0.152f, 0.788f,1.0f };
};
C++:
#include <cmath>
#include "framework/il2cpp-appdata.h"
#include "includes.h"
PlayerData* ESP::GetPlayerData(int i) {
PlayerDataArray* pdataA = (PlayerDataArray*)(*PLH__TypeInfo)->static_fields->player;
if (pdataA->Player[i] == nullptr)
return nullptr;
if (pdataA->Player[i]->fields._currweapon_k__BackingField == nullptr)
return nullptr;
if (pdataA->Player[i]->fields.bstate == 5)
return nullptr;
if (teamcheck == true) {
if ((*Controll__TypeInfo)->static_fields->pl->fields.team == pdataA->Player[i]->fields.team) {
return nullptr;
}
}
return pdataA->Player[i];
}
inline bool ESP::GetPlayerPos(int i, Vector2WH* posArray) {
PlayerData* enemy = GetPlayerData(i);
if (enemy == nullptr)
return false;
Vector3 posHead = Transform_get_position(GameObject_get_transform(enemy->fields.goHead, nullptr),nullptr);
Vector3 WorldPosHead = Camera_WorldToScreenPoint((*Controll__TypeInfo)->static_fields->csCam, posHead, Camera_MonoOrStereoscopicEye__Enum_Mono, nullptr);
Vector3 WorldPosLeg = Camera_WorldToScreenPoint((*Controll__TypeInfo)->static_fields->csCam, {posHead.x,posHead.y - 2,posHead.z}, Camera_MonoOrStereoscopicEye__Enum_Mono, nullptr);
if (WorldPosHead.z <= 1.0f) {
return false;
}
if (WorldPosLeg.z <= 1.0f) {
return false;
}
posArray->pos[0] = { WorldPosLeg.x,Screen_get_height(nullptr) - WorldPosLeg.y };
posArray->pos[1] = { WorldPosLeg.x,Screen_get_height(nullptr) - WorldPosHead.y };
float width = abs(posArray->pos[0].y - posArray->pos[1].y) * 0.3f;
posArray->pos[0] = { posArray->pos[0].x + width, posArray->pos[0].y };
posArray->pos[1] = { posArray->pos[1].x - width, posArray->pos[1].y };
return true;
}
inline bool ESP::GetPlayerIsSpawnProtect(int i) {
PlayerData* enemy = GetPlayerData(i);
if (enemy == nullptr) {
return false;
}
if (enemy->fields.spawnprotect) {
return true;
}
return false;
}
inline void ESP::RRender() {
for (int i = 0; i < 40; i++) {
Vector2WH pos;
if (GetPlayerPos(i, &pos)) {
int SpawnProtectEnemy = GetPlayerIsSpawnProtect(i);
if (SpawnProtectEnemy == 0) {
ImGui::GetBackgroundDrawList()->AddRect({ pos.pos[0].x,pos.pos[0].y }, { pos.pos[1].x,pos.pos[1].y }, ImColor{ colorWh[0],colorWh[1],colorWh[2],colorWh[3] }, 0, 15, 3);
}
else
ImGui::GetBackgroundDrawList()->AddRect({ pos.pos[0].x,pos.pos[0].y }, { pos.pos[1].x,pos.pos[1].y }, ImColor{ colorWhS[0],colorWhS[1],colorWhS[2],colorWhS[3] }, 0, 15, 3);
}
}
}
main.cpp
[CODE]#pragma once
#include "includes.h"
#include "framework/il2cpp-appdata.h"
#include "Addrs.h"
using namespace app;
class PlayerDataArray {
public:
char pad_0012[0xF];
PlayerData* Player[40];
};
class Vector2WH
{
public:
Vector2 pos[2];
};
class ESP {
public:
inline void RRender();
inline bool GetPlayerPos(int i, Vector2WH* posInScreenTrue);
inline bool GetPlayerIsSpawnProtect(int i);
inline PlayerData* GetPlayerData(int i);
bool teamcheck;
bool espActive;
float colorWh[4] = { 0.780f, 0.031f, 0.756f,1.0f };
float colorWhS[4] = { 0.007, 0.152f, 0.788f,1.0f };
};
C++:
#include "includes.h"
extern LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
Present oPresent;
HWND window = NULL;
WNDPROC oWndProc;
ID3D11Device* pDevice = NULL;
ID3D11DeviceContext* pContext = NULL;
ID3D11RenderTargetView* mainRenderTargetView;
ESP esp;
void InitImGui()
{
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
io.ConfigFlags = ImGuiConfigFlags_NoMouseCursorChange;
ImGui_ImplWin32_Init(window);
ImGui_ImplDX11_Init(pDevice, pContext);
}
LRESULT __stdcall WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
if (true && ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam))
return true;
return CallWindowProc(oWndProc, hWnd, uMsg, wParam, lParam);
}
bool init = false;
HRESULT __stdcall hkPresent(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags)
{
if (!init)
{
if (SUCCEEDED(pSwapChain->GetDevice(__uuidof(ID3D11Device), (void**)& pDevice)))
{
pDevice->GetImmediateContext(&pContext);
DXGI_SWAP_CHAIN_DESC sd;
pSwapChain->GetDesc(&sd);
window = sd.OutputWindow;
ID3D11Texture2D* pBackBuffer;
pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)& pBackBuffer);
pDevice->CreateRenderTargetView(pBackBuffer, NULL, &mainRenderTargetView);
pBackBuffer->Release();
oWndProc = (WNDPROC)SetWindowLongPtr(window, GWLP_WNDPROC, (LONG_PTR)WndProc);
InitImGui();
init = true;
}
else
return oPresent(pSwapChain, SyncInterval, Flags);
}
ImGui_ImplDX11_NewFrame();
ImGui_ImplWin32_NewFrame();
ImGui::NewFrame();
ImGui::Begin("BlockPost Cheat PC by Neit");
ImGui::Checkbox("ESP", &esp.espActive);
//ImGui::ColorEdit4("ESP COLOR", esp.colorWh);
if (esp.espActive)
esp.RRender();
ImGui::End();
ImGui::Render();
pContext->OMSetRenderTargets(1, &mainRenderTargetView, NULL);
ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData());
return oPresent(pSwapChain, SyncInterval, Flags);
}
DWORD WINAPI MainThread(LPVOID lpReserved)
{
bool init_hook = false;
do
{
if (kiero::init(kiero::RenderType::D3D11) == kiero::Status::Success)
{
kiero::bind(8, (void**)& oPresent, hkPresent);
init_hook = true;
}
} while (!init_hook);
return TRUE;
}
BOOL WINAPI DllMain(HMODULE hMod, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hMod);
CreateThread(nullptr, 0, MainThread, hMod, 0, nullptr);
break;
case DLL_PROCESS_DETACH:
kiero::shutdown();
break;
}
return TRUE;
}
Пожалуйста, авторизуйтесь для просмотра ссылки.
, как бы жалуется из-за того что в public, а если в private то не могу подключить к main.cpp для ImGui, замкнутый круг.Последний файл main.cpp