├── Bfv Tuturial ESP ├── PlayerManager.lib ├── InternalOverlay.lib ├── Bfv Tuturial ESP.vcxproj.user ├── PlayerManager.h ├── DX9OV.h ├── Bfv Tuturial ESP.vcxproj.filters ├── Utilities.h ├── fbsdk.h ├── Bfv Tuturial ESP.vcxproj └── dllmain.cpp ├── README.md └── Bfv Tutorial ESP.sln /Bfv Tuturial ESP/PlayerManager.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igromanru/BFV-Tutorial/HEAD/Bfv Tuturial ESP/PlayerManager.lib -------------------------------------------------------------------------------- /Bfv Tuturial ESP/InternalOverlay.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igromanru/BFV-Tutorial/HEAD/Bfv Tuturial ESP/InternalOverlay.lib -------------------------------------------------------------------------------- /Bfv Tuturial ESP/Bfv Tuturial ESP.vcxproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Bfv Tuturial ESP/PlayerManager.h: -------------------------------------------------------------------------------- 1 | #include 2 | #pragma comment(lib, "PlayerManager.lib") 3 | 4 | class PlayerManager { 5 | public: 6 | static void* GetLocalPlayer(void); 7 | static void* GetPlayerById(int); 8 | static void Detach(void); 9 | }; -------------------------------------------------------------------------------- /Bfv Tuturial ESP/DX9OV.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #pragma comment(lib, "d3dx9.lib") 7 | #pragma comment(lib, "d3d9.lib") 8 | #pragma comment(lib, "Dwmapi.lib") 9 | #pragma comment(lib, "InternalOverlay.lib") 10 | #include 11 | 12 | class Dxo; 13 | 14 | typedef void(*OverlayCallback)(Dxo* dxo, int width, int height); 15 | 16 | class Dxo 17 | { 18 | public: 19 | void DrawLine(int x0, int y0, int x1, int y1, int width, int r, int g, int b); 20 | void DrawFilledBox(int x, int y, int w, int h, int r, int g, int b, int a); 21 | void DrawBox(int x, int y, int width, int height, int px, int r, int g, int b, int a); 22 | void DrawString(const char* String, int x, int y, int r, int g, int b); 23 | void DrawStringShadow(const char* String, int x, int y, int r, int g, int b); 24 | 25 | static void SetupRenderer(OverlayCallback dxo, HWND window); 26 | static void SetupRenderer(OverlayCallback dxo); 27 | }; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BFV-Tutorial Cheat 2 | 3 | ![](https://i.imgur.com/p7K8YwV.jpg) 4 | 5 | This is an extremely easy cheat to compile and work, and it's rather simple as well. 6 | 7 | Both getting the player array, and the overlay code is in seperate static libraries. You can read up on the PlayerManager lib [here](https://www.unknowncheats.me/forum/battlefield-v/321181-playermanager-lib.html). 8 | 9 | Supports Boxes, Health, Names, Distance, and Snaplines. The code should be really easy to modify, it's built so future modification and such are easy. 10 | 11 | You'll need the [DirectX SDK](https://www.microsoft.com/en-us/download/details.aspx?id=6812) to compile, make sure you link against it. There's comments in `dllmain.cpp` to make this easy. 12 | 13 | Structure: 14 | 15 | dllmain.cpp Contains the entry point, and rendering loop for the ESP. The bulk of the code is here 16 | 17 | fbsdk.h Contains the reversed classes for the game, as well as the static offsets 18 | 19 | Utilities.h Has the math functions needed to calculate WorldToScreen and distance over 3 dimensions 20 | 21 | PlayerManager.h The header for a static lib to get players 22 | 23 | DX9OV.h The header for the static lib for rendering 24 | -------------------------------------------------------------------------------- /Bfv Tuturial ESP/Bfv Tuturial ESP.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | Header Files 25 | 26 | 27 | Header Files 28 | 29 | 30 | Header Files 31 | 32 | 33 | Header Files 34 | 35 | 36 | -------------------------------------------------------------------------------- /Bfv Tutorial ESP.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.136 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Bfv Tuturial ESP", "Bfv Tuturial ESP\Bfv Tuturial ESP.vcxproj", "{D48F415C-DF47-42C4-A8C4-835BB272611E}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {D48F415C-DF47-42C4-A8C4-835BB272611E}.Debug|x64.ActiveCfg = Debug|x64 17 | {D48F415C-DF47-42C4-A8C4-835BB272611E}.Debug|x64.Build.0 = Debug|x64 18 | {D48F415C-DF47-42C4-A8C4-835BB272611E}.Debug|x86.ActiveCfg = Debug|Win32 19 | {D48F415C-DF47-42C4-A8C4-835BB272611E}.Debug|x86.Build.0 = Debug|Win32 20 | {D48F415C-DF47-42C4-A8C4-835BB272611E}.Release|x64.ActiveCfg = Release|x64 21 | {D48F415C-DF47-42C4-A8C4-835BB272611E}.Release|x64.Build.0 = Release|x64 22 | {D48F415C-DF47-42C4-A8C4-835BB272611E}.Release|x86.ActiveCfg = Release|Win32 23 | {D48F415C-DF47-42C4-A8C4-835BB272611E}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {DEE652B8-0524-4E62-B6B3-FE045A2DD3E3} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /Bfv Tuturial ESP/Utilities.h: -------------------------------------------------------------------------------- 1 | #include "fbsdk.h" 2 | 3 | // declare some static variables necescary for WorldToScreen 4 | // don't worry about setting these manually, we'll do this dynamically in the overlay callback function 5 | static int s_Width = 1920; 6 | static int s_Height = 1080; 7 | static D3DXMATRIXA16 s_ViewProj = D3DXMATRIXA16(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 8 | 9 | // check the validity of a given pointer. Note that IsBadReadPtr is kinda slow 10 | bool IsValidPtr(void* addr) { 11 | return !IsBadReadPtr(addr, sizeof(PVOID)); 12 | } 13 | 14 | // calculates the distance between two 3d points 15 | float Distance3D(D3DXVECTOR3 v1, D3DXVECTOR3 v2) 16 | { 17 | float x_d = (v2.x - v1.x); 18 | float y_d = (v2.y - v1.y); 19 | float z_d = (v2.z - v1.z); 20 | return sqrt((x_d * x_d) + (y_d * y_d) + (z_d * z_d)); 21 | } 22 | 23 | // calculate the screen coordinates in pixels given a world coordinate 24 | bool WorldToScreen(D3DXVECTOR3 &vLocVec4) 25 | { 26 | D3DXMATRIXA16 ViewProj = s_ViewProj; 27 | float mX = s_Width / 2; 28 | float mY = s_Height / 2; 29 | 30 | float w = ViewProj(0, 3) * vLocVec4.x + ViewProj(1, 3) * vLocVec4.y + ViewProj(2, 3) * vLocVec4.z + ViewProj(3, 3); 31 | 32 | if (w < 0.65f) 33 | { 34 | vLocVec4.z = w; 35 | return false; 36 | } 37 | float x = ViewProj(0, 0) * vLocVec4.x + ViewProj(1, 0) * vLocVec4.y + ViewProj(2, 0) * vLocVec4.z + ViewProj(3, 0); 38 | float y = ViewProj(0, 1) * vLocVec4.x + ViewProj(1, 1) * vLocVec4.y + ViewProj(2, 1) * vLocVec4.z + ViewProj(3, 1); 39 | vLocVec4.x = (mX + mX * x / w); 40 | vLocVec4.y = (mY - mY * y / w); 41 | vLocVec4.z = w; 42 | return true; 43 | } -------------------------------------------------------------------------------- /Bfv Tuturial ESP/fbsdk.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | // Include our PlayerManager Code 5 | #include "PlayerManager.h" 6 | 7 | // Include our DX9 Overlay Code, along with all the DX9 includes 8 | #include "DX9OV.h" 9 | 10 | // define our static offsets 11 | // with this cheat, GameRenderer is the only static offset needed. The PlayerManager lib uses sig scanning 12 | #define OFFSET_GAMERENDERER 0x1444b5158 13 | 14 | // the class for a WeakPtr 15 | template class WeakPtr 16 | { 17 | private: 18 | T** m_ptr; 19 | public: 20 | T* GetData() 21 | { 22 | if (!IsValidPtr(m_ptr)) 23 | { 24 | return nullptr; 25 | } 26 | if (!*m_ptr) 27 | { 28 | return nullptr; 29 | } 30 | T* ptr = *m_ptr; 31 | return (T*)((DWORD64)ptr - 0x8); 32 | } 33 | }; 34 | 35 | // these are the classes reversed from the game, using ReClass 36 | 37 | // Created with ReClass.NET by KN4CK3R 38 | 39 | class HealthComponent 40 | { 41 | public: 42 | char pad_0000[32]; //0x0000 43 | float currentHealth; //0x0020 44 | float maxHealth; //0x0024 45 | char pad_0028[1056]; //0x0028 46 | }; //Size: 0x0448 47 | 48 | class ClientSoldierEntity 49 | { 50 | public: 51 | char pad_0000[584]; //0x0000 52 | class HealthComponent* healthComponent; //0x0248 53 | char pad_0250[1544]; //0x0250 54 | uint8_t poseType; //0x0858 55 | char pad_0859[194]; //0x0859 56 | uint8_t occluded; //0x091B 57 | char pad_091C[532]; //0x091C 58 | D3DXVECTOR3 location; //0x0B30 59 | char pad_0B3C[1296]; //0x0B3C 60 | }; //Size: 0x104C 61 | 62 | 63 | class ClientPlayer 64 | { 65 | public: 66 | char pad_0000[24]; //0x0000 67 | char* name; //0x0018 68 | char pad_0020[7208]; //0x0020 69 | uint8_t teamId; //0x1C48 70 | char pad_1C49[255]; //0x1C49 71 | WeakPtr clientSoldierEntity; //0x1D48 72 | char pad_1D50[752]; //0x1D50 73 | }; //Size: 0x2040 74 | 75 | class RenderView 76 | { 77 | public: 78 | char pad_0000[1264]; //0x0000 79 | D3DXMATRIXA16 viewProj; //0x04F0 80 | char pad_0530[368]; //0x0530 81 | D3DXVECTOR3 cameraPos; //0x06A0 82 | char pad_06AC[4632]; //0x06AC 83 | }; //Size: 0x05C0 84 | 85 | class GameRenderer 86 | { 87 | public: 88 | char pad_0000[96]; //0x0000 89 | class RenderView* renderView; //0x0060 90 | char pad_0068[32]; //0x0068 91 | static GameRenderer* GetInstance() 92 | { 93 | return *(GameRenderer**)OFFSET_GAMERENDERER; 94 | } 95 | }; //Size: 0x0088 96 | -------------------------------------------------------------------------------- /Bfv Tuturial ESP/Bfv Tuturial ESP.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 15.0 23 | {D48F415C-DF47-42C4-A8C4-835BB272611E} 24 | BfvTuturialESP 25 | 10.0.17763.0 26 | Bfv Tutorial ESP 27 | 28 | 29 | 30 | Application 31 | true 32 | v141 33 | MultiByte 34 | 35 | 36 | Application 37 | false 38 | v141 39 | true 40 | MultiByte 41 | 42 | 43 | Application 44 | true 45 | v141 46 | MultiByte 47 | 48 | 49 | DynamicLibrary 50 | false 51 | v141 52 | true 53 | MultiByte 54 | false 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | $(VC_IncludePath);$(WindowsSDK_IncludePath);$(DXSDK_DIR)\Include; 76 | $(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);$(NETFXKitsDir)Lib\um\x64;$(DXSDK_DIR)\Lib\x64; 77 | 78 | 79 | 80 | Level3 81 | Disabled 82 | true 83 | true 84 | 85 | 86 | 87 | 88 | Level3 89 | Disabled 90 | true 91 | true 92 | 93 | 94 | 95 | 96 | Level3 97 | MaxSpeed 98 | true 99 | true 100 | true 101 | true 102 | 103 | 104 | true 105 | true 106 | 107 | 108 | 109 | 110 | Level3 111 | MaxSpeed 112 | true 113 | true 114 | true 115 | true 116 | 117 | 118 | true 119 | true 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /Bfv Tuturial ESP/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #include "Utilities.h" 2 | //https://i.imgur.com/p7K8YwV.jpg 3 | // include our utilities header, which has special math functions and includes the fbsdk, dx9ov, and PlayerManager 4 | 5 | // some helper pre-processor directives to make sure you build it right 6 | #ifdef _DEBUG 7 | #error Compile in Release mode 8 | #endif 9 | #ifndef _WIN64 10 | #error Compile as 64 bit 11 | #endif 12 | #ifndef _WINDLL 13 | #error Compile as a DLL 14 | #endif 15 | 16 | #ifndef __D3DX9_H__ 17 | #error you must include the DirectX SDK 18 | // go to Project->Properties->VC++ Directories, and add 19 | // $(DXSDK_DIR)\Include; 20 | // and 21 | // $(DXSDK_DIR)\Lib\x64; 22 | // to the Include and Library directories, respectively 23 | // should reside in C:\Program Files (x86)\Microsoft DirectX SDK (June 2010) 24 | #endif 25 | 26 | // we'll use this to simplifiy checking of settings. Hover over an implimentation to see what it expands to 27 | #define checkSetting(teamval, enemyval) (((pLocalPlayer->teamId == pPlayer->teamId) && teamval) || ((pLocalPlayer->teamId != pPlayer->teamId) && enemyval)) 28 | 29 | // be lazy and paste colors 30 | #define pasteColor(x) x.r, x.g, x.b 31 | #define pasteColorA(x) x.r, x.g, x.b, x.a 32 | 33 | // chance these settings to your liking 34 | namespace Settings { 35 | // our colors to set players to 36 | D3DXCOLOR teamColor = D3DXCOLOR(0, 255, 0, 255); 37 | D3DXCOLOR occludedEnemyColor = D3DXCOLOR(255, 0, 0, 255); 38 | D3DXCOLOR visibleEnemyColor = D3DXCOLOR(255, 255, 0, 255); 39 | 40 | // the boxes to be drawn around enemies 41 | bool enemyBoxes = true; 42 | bool teamBoxes = true; 43 | 44 | // draw their names above their heads 45 | bool enemyNames = true; 46 | bool teamNames = true; 47 | 48 | // draw the distance from our player to theirs 49 | bool enemyDistance = true; 50 | bool teamDistance = true; 51 | 52 | // draw lines from the bottom of the screen to their foot 53 | bool enemySnaplines = true; 54 | bool teamSnaplines = true; 55 | 56 | // draw healthbars next to the players 57 | bool enemyHealth = true; 58 | bool teamHealth = true; 59 | 60 | // the width of our lines to be drawn, for boxes and snaplines 61 | int lineWidth = 2; 62 | } 63 | 64 | 65 | // this function will get called once every frame of the overlay 66 | void drawLoop(Dxo* dxo, int width, int height) { 67 | // set our static variables for W2S to work 68 | s_Width = width; 69 | s_Height = height; 70 | 71 | // Get the view projection matrix 72 | GameRenderer* pGameRenderer = GameRenderer::GetInstance(); 73 | // check that the RenderView class is valid 74 | if (!IsValidPtr(pGameRenderer) || !IsValidPtr(pGameRenderer->renderView)) return; 75 | // set our static ViewProjection for W2S to work 76 | s_ViewProj = pGameRenderer->renderView->viewProj; 77 | 78 | // Get the LocalPlayer 79 | ClientPlayer* pLocalPlayer = (ClientPlayer*)PlayerManager::GetLocalPlayer(); 80 | 81 | // make sure the player is valid 82 | if (!IsValidPtr(pLocalPlayer)) return; 83 | if (!IsValidPtr(pLocalPlayer->name)) return; 84 | 85 | // Get the LocalSoldier 86 | ClientSoldierEntity* pLocalSoldier = pLocalPlayer->clientSoldierEntity.GetData(); 87 | 88 | // make sure the soldier is valid 89 | if (!IsValidPtr(pLocalSoldier)) return; 90 | 91 | // start our player loop 92 | for (size_t i = 0; i < 64; i++) { 93 | 94 | // Get the player by it's index 95 | ClientPlayer* pPlayer = (ClientPlayer*)PlayerManager::GetPlayerById(i); 96 | 97 | // check the pointer's validity 98 | if (!IsValidPtr(pPlayer)) continue; 99 | 100 | // make sure the player isn't the localplayer 101 | if (pPlayer == pLocalPlayer) continue; 102 | 103 | // get the ClientSoldierEntity 104 | ClientSoldierEntity* pSoldier = pPlayer->clientSoldierEntity.GetData(); 105 | 106 | // check it's pointer to make sure they're spawned 107 | if (!IsValidPtr(pSoldier)) continue; 108 | 109 | // check that their health component is valid 110 | if (!IsValidPtr(pSoldier->healthComponent)) continue; 111 | 112 | // check that their health is above 0 113 | if (pSoldier->healthComponent->currentHealth <= 0) continue; 114 | 115 | // set up our color to render with 116 | D3DXCOLOR chosenColor; 117 | // if the team IDs are the same 118 | if (pPlayer->teamId == pLocalPlayer->teamId) { 119 | // set the color to the predefined teamcolor 120 | chosenColor = Settings::teamColor; 121 | } 122 | else { 123 | // the soldier is an enemy, now check if they're occluded (not visible) 124 | if (pSoldier->occluded) { 125 | // if they aren't visible, set the color to their occluded color 126 | chosenColor = Settings::occludedEnemyColor; 127 | } 128 | else { 129 | // otherwise set it to Settings::visibleEnemyColor 130 | chosenColor = Settings::visibleEnemyColor; 131 | } 132 | } 133 | 134 | // get the position of the players foot, and their head 135 | D3DXVECTOR3 footLocation = pSoldier->location; 136 | D3DXVECTOR3 headLocation = footLocation; 137 | // hardcode a head height offset, based on pose 138 | 139 | // poseType 0 = standing 140 | // poseType 1 = crouching 141 | // poseType 2 = prone 142 | if (pSoldier->poseType == 0) headLocation.y += 1.6; 143 | if (pSoldier->poseType == 1) headLocation.y += 1; 144 | if (pSoldier->poseType == 2) headLocation.y += .5; 145 | 146 | 147 | // Convert their world coordinates to screen coordinates 148 | if (WorldToScreen(footLocation) && WorldToScreen(headLocation)) { 149 | // calculate the pixels between the top and bottom of the soldier 150 | float w2sHeight = Distance3D(footLocation, headLocation); 151 | float w2sWidth = w2sHeight; 152 | // adjust the w2sWidth so the boxes aren't proportional 153 | if (pSoldier->poseType == 0) w2sWidth /= 2; 154 | if (pSoldier->poseType == 1) w2sWidth /= 1.5; 155 | 156 | // get the (world) distance between the localplayer and the enemy player 157 | float distanceToPlayer = Distance3D(pLocalSoldier->location, pSoldier->location); 158 | 159 | // if the localplayer and the pPlayer are on the same teams and teamboxes are enabled, 160 | // or 161 | // if the localplayer and the pPlayer are on opposite teams and enemyboxes are enabled: 162 | if checkSetting(Settings::teamBoxes, Settings::enemyBoxes) { 163 | // draw a box around them 164 | dxo->DrawBox(headLocation.x - w2sWidth / 2, headLocation.y, w2sWidth, w2sHeight, Settings::lineWidth, pasteColorA(chosenColor)); 165 | } 166 | 167 | // check if snapliens are to be drawn 168 | if (checkSetting(Settings::teamSnaplines, Settings::enemySnaplines)) { 169 | // if so, draw a line from the middle bottom of the screen, to their foot location 170 | dxo->DrawLine(s_Width / 2, s_Height, footLocation.x, footLocation.y, Settings::lineWidth, pasteColor(chosenColor)); 171 | } 172 | 173 | // draw their names 174 | if (checkSetting(Settings::teamNames, Settings::enemyNames)) { 175 | dxo->DrawString(pPlayer->name, headLocation.x, headLocation.y + 20, pasteColor(chosenColor)); 176 | } 177 | 178 | // draw distances 179 | if (checkSetting(Settings::teamDistance, Settings::enemyDistance)) { 180 | dxo->DrawString(std::to_string((int)distanceToPlayer).c_str(), footLocation.x, footLocation.y + 20, pasteColor(chosenColor)); 181 | } 182 | 183 | // draw healthBars 184 | if (checkSetting(Settings::teamHealth, Settings::enemyHealth)) { 185 | // divide the health 186 | float health = (pSoldier->healthComponent->currentHealth / pSoldier->healthComponent->maxHealth) * 255; 187 | 188 | // Calculate the color to draw the boxes 189 | D3DXCOLOR boxColor(255 - health, health, 0, 255); 190 | float border = 2; 191 | float box_width = 10; 192 | float boxOffset = w2sWidth * .75f; 193 | // draw a black box first 194 | dxo->DrawFilledBox(headLocation.x + boxOffset, headLocation.y, 10, w2sHeight, 0, 0, 0, 255); 195 | // now draw a colored box with a height value based off of their health 196 | dxo->DrawFilledBox(headLocation.x + boxOffset + border, headLocation.y + border, box_width - (2 * border), (w2sHeight - (2 * border))*(health / 255), pasteColorA(boxColor)); 197 | } 198 | 199 | 200 | } // end of w2s check 201 | } // end of player-loop 202 | } // end of drawing callback 203 | 204 | // the thread where we'll be setting up our hack stuff 205 | DWORD WINAPI hackThread(LPVOID lpParam) { 206 | 207 | // Create our overlay and start rendering 208 | // The first arg, drawLoop, is the address of our callback function 209 | // it'll be called once per frame of our overlay 210 | Dxo::SetupRenderer(drawLoop); 211 | 212 | // keep this thread idling 213 | for (;;) { Sleep(500); } 214 | } 215 | 216 | // the DllMain, the entry point of our module 217 | BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) 218 | { 219 | // check if the dll was attached to a process 220 | if (ul_reason_for_call == DLL_PROCESS_ATTACH) { 221 | // create a thread to set up our stuff. Pass the handle to our module for ejection 222 | CreateThread(NULL, NULL, hackThread, hModule, NULL, NULL); 223 | } 224 | 225 | // check if the dll is being unloaded 226 | if (ul_reason_for_call == DLL_PROCESS_DETACH) { 227 | // need to unhook our PlayerManager stuff 228 | PlayerManager::Detach(); 229 | } 230 | return TRUE; 231 | } --------------------------------------------------------------------------------