Ich habe folgenden Code um Spieler in dem Spiel Infestation anzuzeigen:
Code:
#include <Windows.h>
#include <d3dx9.h>
#include <d3d9.h>
#include "WarZClasses.h"
#pragma comment(lib, "d3dx9.lib")
#pragma comment(lib, "d3d9.lib")
IDirect3D9Ex* dx_Object = NULL;
IDirect3DDevice9Ex* dx_Device = NULL;
D3DPRESENT_PARAMETERS dx_Param;
ID3DXFont* dx_Font = 0;
int D3DIniti(HWND hWnd)
{
if (FAILED(Direct3DCreate9Ex(D3D_SDK_VERSION, &dx_Object)))
exit(1);
dx_Param.BackBufferFormat = D3DFMT_A8R8G8B8;
dx_Param.hDeviceWindow = hWnd;
dx_Param.MultiSampleQuality = DEFAULT_QUALITY;
dx_Param.SwapEffect = D3DSWAPEFFECT_DISCARD;
dx_Param.Windowed = true;
if (FAILED(dx_Object->CreateDeviceEx(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &dx_Param, 0, &dx_Device)))
exit(1);
D3DXCreateFont(dx_Device, 15, 0, 0, 0, false, DEFAULT_CHARSET, OUT_CHARACTER_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH, "Verdana", &dx_Font);
return 0;
}
void DrawFilledBox(int x, int y, int w, int h, int r, int g, int b, int a)
{
static ID3DXLine* pLine;
if (!pLine)
D3DXCreateLine(dx_Device, &pLine);
D3DXVECTOR2 vLine[2];
pLine->SetWidth(w);
pLine->SetAntialias(false);
pLine->SetGLLines(true);
vLine[0].x = x + w / 2;
vLine[0].y = y;
vLine[1].x = x + w / 2;
vLine[1].y = y + h;
pLine->Begin();
pLine->Draw(vLine, 2, D3DCOLOR_RGBA(r, g, b, a));
pLine->End();
}
void DrawBox(int x, int y, int width, int height, int px, int r, int g, int b, int a)
{
DrawFilledBox(x, y + height, width, px, r, g, b, a);
DrawFilledBox(x - px, y, px, height, r, g, b, a);
DrawFilledBox(x, y - px, width, px, r, g, b, a);
DrawFilledBox(x + width, y, px, height, r, g, b, a);
}
int DrawText(char* String, int x, int y, int r, int g, int b)
{
RECT Font;
Font.bottom = 0;
Font.left = x;
Font.top = y;
Font.right = 0;
dx_Font->DrawTextA(0, String, strlen(String), &Font, DT_NOCLIP, D3DCOLOR_ARGB(255, r, g, b));
return 0;
}
int DrawShadowText(char* String, int x, int y, int r, int g, int b)
{
RECT Font;
Font.bottom = 0;
Font.left = x;
Font.top = y;
Font.right = 0;
RECT Fonts;
Fonts.bottom = 0;
Fonts.left = x + 1;
Fonts.top = y + 1;
Fonts.right = 0;
dx_Font->DrawTextA(0, String, strlen(String), &Fonts, DT_NOCLIP, D3DCOLOR_ARGB(255, 1, 1, 1));
dx_Font->DrawTextA(0, String, strlen(String), &Font, DT_NOCLIP, D3DCOLOR_ARGB(255, r, g, b));
return 0;
}
void Draw();
int RenderIt()
{
dx_Device->Clear(0, 0, D3DCLEAR_TARGET, 0, 1.0f, 0);
dx_Device->BeginScene();
//DrawBox(189, 96, 181, 21, 1, 200, 200, 200, 200);
//DrawFilledBox(190, 97, 180, 20, 100, 100, 100 , 200);
DrawText("Simple ESP", 200, 100, 255, 255, 255);
Draw();
dx_Device->EndScene();
dx_Device->PresentEx(0, 0, 0, 0, 0);
return 0;
}
//==============================================================================================================================
//==============================================================================================================================
DWORD GameOffset = 0x8BC568;
DWORD GameWorldOffset = 0x8BCD70;
DWORD GameXOR = 0x1735146A;
DWORD GameWorldXOR = 0xFC5AD98D;
DWORD locationAddress = 0x24;
DWORD ObjectManagerID = 0x310;
DWORD Renderer = 0xE1B1BC;
DWORD LocalPlayerOffset = 0xCE92C;
DWORD LocalPlayerXOR = 0x8347816F;
//===============================================================
#define PLAYER 0x22
INT ESP_PLAYER_NAME = FALSE;
#define OBJTYPE_DroppedItem 0x230005
//#define Red D3DCOLOR_ARGB(255,204,46,46)
#define Green D3DCOLOR_ARGB(255,34,161,52)
#define Blue D3DCOLOR_ARGB(255,45,105,196)
//===============================================================
extern Memory memory;
DWORD GetGame(){
DWORD GameAddress;
GameAddress = memory.read<DWORD>(GameOffset + memory.BaseAddress());
GameAddress ^= GameXOR;
return GameAddress;
}
DWORD GetGameWorld(){
DWORD GameWorldAddress;
GameWorldAddress = memory.read<DWORD>(GameWorldOffset + memory.BaseAddress());
GameWorldAddress ^= GameWorldXOR;
return GameWorldAddress;
}
bool World2Screen(D3DXVECTOR3 Pos, D3DXVECTOR3 *Out){
r3dRenderer WTS;
WTS = memory.read<r3dRenderer>(memory.read<DWORD>((memory.BaseAddress() + Renderer)));
WTS.set(dx_Device);
if (WTS.WorldToScreen(&Pos, Out))
return true;
return false;
}
float getDistance(D3DXVECTOR3 me, D3DXVECTOR3 you){
float tempx, tempy, tempz, tempA;
tempx = (me.x - you.x)*(me.x - you.x);
tempy = (me.y - you.y)*(me.y - you.y);
tempz = (me.z - you.z)*(me.z - you.z);
tempA = tempx + tempy + tempz;
if (tempA < 0)
tempA = (tempA * (-1));
return sqrt(tempA);
}
void Draw(){
//=======================================================================
//Local Player
//=======================================================================
DWORD LocalPlayerAddress;
D3DXVECTOR3 LocalPlayerPos;
LocalPlayerAddress = memory.read<DWORD>(GetGame() + LocalPlayerOffset);
LocalPlayerAddress ^= LocalPlayerXOR;
LocalPlayerPos = memory.read<D3DXVECTOR3 >(LocalPlayerAddress + locationAddress);
//=======================================================================
//Objects + Zombies
//=======================================================================
CGameWorld gw = memory.read<CGameWorld>(GetGameWorld());
int maxObjects = gw.GetMaxObjects();
for (int x = 0; x < maxObjects; x++){
D3DCOLOR color = NULL;
DWORD objAddress = memory.read<int>(gw.GetObject(x));
D3DXVECTOR3 pvPos = memory.read<D3DXVECTOR3 >(objAddress + locationAddress);
D3DXVECTOR3 pvOut;
if (150 >= getDistance(LocalPlayerPos, pvPos)){
if (World2Screen(pvPos, &pvOut)){
if (GetAsyncKeyState(VK_NUMPAD7) & 1){
ESP_PLAYER_NAME = !ESP_PLAYER_NAME; //look ! it means inverse.
}
if (ESP_PLAYER_NAME){
if (memory.read<int>(objAddress + ObjectManagerID) == PLAYER)
DrawFilledBox(pvOut.x, pvOut.y, 10, 10, 204, 46, 46, 200);
else if (memory.read<int>(objAddress + ObjectManagerID) == OBJTYPE_DroppedItem)
DrawFilledBox(pvOut.x, pvOut.y, 10, 10, 34, 161, 52, 200);
}
}
}
}
//=======================================================================
//Players
//=======================================================================
ClientGame gc = memory.read<ClientGame>(GetGame());
for (int x = 0; x < 128; x++){
DWORD objAddress = (DWORD)gc.GetPlayerByIndex(x);
if (memory.read<int>(objAddress + ObjectManagerID) == PLAYER){
D3DXVECTOR3 pvPos = memory.read<D3DXVECTOR3 >(objAddress + locationAddress);
D3DXVECTOR3 pvOut;
if (World2Screen(pvPos, &pvOut)){
DrawFilledBox(pvOut.x, pvOut.y, 10, 10, 45, 105, 196, 200);
}
}
}
}
Mein Problem:
Wenn man einen roten Punkt sieht (Spieler) und sich um 180° dreht, sieht man ihn immernoch auf dem Bildschirm. Also ist es sehr verwirrend. Kann man das irgendwie fixxen?
Bei Skype würde ich das ganze Project versenden, falls mir da jemand helfen kann ._.
Wäre dem jenigen SEHR dankbar
Das ganze ist eine Exe, also ein externes Overlay.
Mfg. Easy






