diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2018-07-02 01:06:39 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2018-07-02 03:08:59 +0200 |
commit | c2a2445897af17adb56a32dcf111312763a575d4 (patch) | |
tree | ad459cdd682aff3a011d11b6f2a3c518c60dec6a /csgo_wh/include |
initial commit
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'csgo_wh/include')
-rwxr-xr-x | csgo_wh/include/D9DW.h | 45 | ||||
-rwxr-xr-x | csgo_wh/include/D9DW_Config.h | 14 | ||||
-rwxr-xr-x | csgo_wh/include/D9DW_Rectangle.h | 35 | ||||
-rwxr-xr-x | csgo_wh/include/D9DW_Text.h | 36 | ||||
-rwxr-xr-x | csgo_wh/include/DLLMain.h | 36 | ||||
-rwxr-xr-x | csgo_wh/include/Game.h | 83 | ||||
-rwxr-xr-x | csgo_wh/include/Hook.h | 20 |
7 files changed, 269 insertions, 0 deletions
diff --git a/csgo_wh/include/D9DW.h b/csgo_wh/include/D9DW.h new file mode 100755 index 0000000..0ce2a44 --- /dev/null +++ b/csgo_wh/include/D9DW.h @@ -0,0 +1,45 @@ +#ifndef DDRW_HPP_INCLUDED +#define DDRW_HPP_INCLUDED + +#include <d3d9.h> +#include <d3dx9.h> +#include <d3d9types.h> +#include <stdbool.h> + +#include "Game.h" +#include "D9DW_Config.h" +#include "D9DW_Text.h" +#include "D9DW_Rectangle.h" + + +#define MENU_DISABLE 0x1 +#define MENU_ESP 0x2 + + +class D9DW +{ + +private: + IDirect3DDevice9* pDevice; + + void drawESP(UINT32 idx, ENTITY *ent, FLOAT pos[3]); + + void doESP(Game *game); + + void __stdcall doMenu(Game *game, int startx, int starty, int heightpad); + +public: + D9DW_Text pTxt; + D9DW_Rectangle pRec; + + void Create(IDirect3DDevice9 *pDev); + + void Release(void); + + void __stdcall Render(Game* game, bool bActive); + + HRESULT checkDxDevice(void); + +}; + +#endif // DDRW_HPP_INCLUDED diff --git a/csgo_wh/include/D9DW_Config.h b/csgo_wh/include/D9DW_Config.h new file mode 100755 index 0000000..bbf65f4 --- /dev/null +++ b/csgo_wh/include/D9DW_Config.h @@ -0,0 +1,14 @@ +#ifndef DDRW_CONFIG_H_INCLUDED +#define DDRW_CONFIG_H_INCLUDED + +#ifdef __cplusplus + +#define C_API extern "C" + +#else + +#define C_API + +#endif + +#endif // DDRW_CONFIG_H_INCLUDED diff --git a/csgo_wh/include/D9DW_Rectangle.h b/csgo_wh/include/D9DW_Rectangle.h new file mode 100755 index 0000000..57dea3e --- /dev/null +++ b/csgo_wh/include/D9DW_Rectangle.h @@ -0,0 +1,35 @@ +#ifndef DDRW_RECTANGLE_H_INCLUDED +#define DDRW_RECTANGLE_H_INCLUDED + +#include <d3d9.h> +#include <d3dx9.h> +#include <stdbool.h> +#include "D9DW_Config.h" + + +class D9DW_Rectangle +{ +private: + + ID3DXLine* gLine; + IDirect3DDevice9* pDev; + + inline void clearoutArea(int x, int y, int width, int height, UINT32 rgb_alpha); + +public: + HRESULT Create(IDirect3DDevice9* pDevice) + { + pDev = pDevice; + return D3DXCreateLine(pDev, &gLine); + } + + void Release(void) + { + gLine->Release(); + } + + void Draw(int x , int y, int width, int height, UINT32 rgb_alpha, bool doFill); + +}; + +#endif // DDRW_RECTANGLE_H_INCLUDED diff --git a/csgo_wh/include/D9DW_Text.h b/csgo_wh/include/D9DW_Text.h new file mode 100755 index 0000000..00f7815 --- /dev/null +++ b/csgo_wh/include/D9DW_Text.h @@ -0,0 +1,36 @@ +#ifndef D9DW_TEXT_H_INCLUDED +#define D9DW_TEXT_H_INCLUDED + +#include <d3d9.h> +#include <d3dx9.h> +#include <stdbool.h> + + +class D9DW_Text +{ + +private: + static bool bInit; + static ID3DXFont* m_pFont; + +public: + bool isInitialized(void) { + return this->bInit; + } + + void Create(IDirect3DDevice9* pDev); + + void Release(void); + + void DrawText(int x, int y, UINT32 rgb_alpha, const char *s_text, va_list p_va); + + void DrawText(int x, int y, UINT32 rgb_alpha, const char *s_text, ...) + { + va_list va; + va_start(va, s_text); + this->DrawText(x, y, rgb_alpha, s_text, va); + va_end(va); + } +}; + +#endif // D9DW_TEXT_H_INCLUDED diff --git a/csgo_wh/include/DLLMain.h b/csgo_wh/include/DLLMain.h new file mode 100755 index 0000000..a11f94a --- /dev/null +++ b/csgo_wh/include/DLLMain.h @@ -0,0 +1,36 @@ +#ifndef __MAIN_H__ +#define __MAIN_H__ + +#include <windows.h> +#include "D9DW.h" + +#define VERSION "0.3a" +#define COPYRIGHT "CS:GO_HACK (C) by lnslbrty" +#define CINTERFACE 1 + +#ifdef BUILD_DLL +#define DLL_EXPORT __declspec(dllexport) +#else +#define DLL_EXPORT __declspec(dllimport) +#endif + + +#ifdef __cplusplus +extern "C" +{ +#endif + +__declspec(dllexport) BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved); + +#ifdef ENABLE_DEBUG +#define DBG(fmt, ...) D9DW::DbgMessageBox(256, fmt, __VA_ARGS__) +void DbgMessageBox(size_t sz_len, const char *fmt, ...); +#else +#define DBG(fmt, ...) +#endif + +#ifdef __cplusplus +} +#endif + +#endif // __MAIN_H__ diff --git a/csgo_wh/include/Game.h b/csgo_wh/include/Game.h new file mode 100755 index 0000000..554ae9f --- /dev/null +++ b/csgo_wh/include/Game.h @@ -0,0 +1,83 @@ +#ifndef GAME_H_INCLUDED +#define GAME_H_INCLUDED + +#include <cstdio> +#include <windows.h> +#include <psapi.h> + +#define OFF_ENTITIES 0x49EE2E4 +#define OFF_LOCALPLAYER 0xA4CA5C + +#define MAXPLAYER 32 +#define ENTLOOP 0x10 +#define ENTPOS 0x134 +#define ENTAIMX 0xC0 +#define ENTAIMY 0x438 +#define ENTVANGL 0x158C +#define ENTTEAM 0xF0 +#define PLYFOV 0x159C + +#define TEAM_COUNTER 0x3 +#define TEAM_TERROR 0x2 + + +#ifdef ENABLE_DEBUG +#define DEBUG_VAR Game::pLogFile +#define DEBUG_FILE "./log.txt" +#define DEBUG_INIT DEBUG_VAR = fopen(DEBUG_FILE,"a+"); +#define DEBUG_FLUSH fflush(DEBUG_VAR); +#define DEBUG_CLOSE fclose(DEBUG_VAR); +#define DEBUG_LOG(msg, ...) fprintf(DEBUG_VAR, "[%s:%d] ", __FILE__, __LINE__); fprintf(DEBUG_VAR, msg, __VA_ARGS__); fprintf(DEBUG_VAR, "%s", "\r\n"); DEBUG_FLUSH; +#define WDEBUG_LOG(msg, ...) fwprintf(DEBUG_VAR, L"[%hs:%d] ", __FILE__, __LINE__); fwprintf(DEBUG_VAR, msg, __VA_ARGS__); +#else +#define DEBUG_VAR +#define DEBUG_FILE +#define DEBUG_INIT +#define DEBUG_LOG(msg, ...) +#define WDEBUG_LOG(msg, ...) +#define DEBUG_FLUSH +#define DEBUG_CLOSE +#endif // ENABLE_DEBUG + + +typedef struct _entitiy +{ + PVOID p_adr; + FLOAT p_pos[3]; + FLOAT p_aim[2]; + BYTE p_team; +} ENTITY; + +class Game +{ + +private: + bool init = false; + +public: + HMODULE h_clientDLL, h_shaderapiDLL; + MODULEINFO m_client, m_shaderapi; + UINT32 dwWidth; + UINT32 dwHeight; + UINT32 dwFov; + UINT32 dwPlayerCount = 0; + ENTITY *g_localPlayer; + ENTITY g_entities[MAXPLAYER]; + +#ifdef ENABLE_DEBUG + static FILE* pLogFile; +#endif + + bool Init(void); + + bool Reset(void); + + bool ReadEntities(void); + + void ReadCVars(void); + + static FLOAT calcVecDist(float v1[3], float v2[3]); + +}; + +#endif // GAME_H_INCLUDED diff --git a/csgo_wh/include/Hook.h b/csgo_wh/include/Hook.h new file mode 100755 index 0000000..53ee3b3 --- /dev/null +++ b/csgo_wh/include/Hook.h @@ -0,0 +1,20 @@ +#ifndef HOOK_H_INCLUDED +#define HOOK_H_INCLUDED + +#define ENDSCENE_OFFSET 0x2179F + +typedef __int32 (__stdcall* EndScene_t)(LPDIRECT3DDEVICE9); + +class Hook +{ +public: + + static bool hookEndScene(EndScene_t pHookFunc, EndScene_t *pEndScene, bool unhook); + + static BYTE* Detour(BYTE *src, const BYTE *dst); + + static void UnDetour(BYTE *src); + +}; + +#endif // HOOK_H_INCLUDED |