Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "include.h"
- #include "Hook.h"
- #include "temalar.h"
- #include "detours.h"
- #include "esp.h"
- #pragma comment(lib, "detours.lib")
- #pragma region External
- extern LRESULT ImGui_ImplDX9_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
- #pragma endregion
- #pragma region D3DStuff
- DWORD *VTable;
- UINT Offset = 0;
- UINT Stride = 0;
- LPDIRECT3DVERTEXBUFFER9 Stream_Data;
- LPDIRECT3DDEVICE9 pDevice1, g_pDevice, r_pDevice;
- WNDPROC oriWndProc = NULL;
- #pragma endregion
- #pragma region BoolandETC
- bool isImGUiOK = false, testbool;
- float testslider;
- bool bShowMenu;
- #pragma endregion
- HRESULT WINAPI hkEndScene(LPDIRECT3DDEVICE9 pDevice)
- {
- return ((tEndScene)oEndScene)(pDevice);
- }
- HRESULT WINAPI hkReset(IDirect3DDevice9* pDevice, D3DPRESENT_PARAMETERS* pPresentationParameters)
- {
- ImGui_ImplDX9_InvalidateDeviceObjects();
- return oReset(pDevice, pPresentationParameters);
- ImGui_ImplDX9_CreateDeviceObjects();
- return oReset(pDevice, pPresentationParameters);
- }
- HANDLE MEMORY = OpenProcess(PROCESS_ALL_ACCESS, 0, GetCurrentProcessId());
- bool testchk;
- int tabb = 1;
- void MenuRender()
- {
- if (!bShowMenu)
- return;
- static int pdx = 0;
- HANDLE hProcess;
- hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, pdx);
- pdx = pEx("Wolfteam.bin");
- uintptr_t CShellBase = iGMBase(pdx, "csh");
- uintptr_t CShellSize = iGMBase(pdx, "csh", true);
- uintptr_t dwNameEspPtr = FindPatternEx(hProcess, CShellBase, CShellSize, "\x75\x31\x38\x00\x00\x00\x00\x00\x75\x29", "xxx?????xx");
- DWORD nameesp = (dwNameEspPtr - CShellBase);
- ImGui_ImplDX9_NewFrame(); //ImGui Startup Point
- if (ImGui::Begin("test", 0, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_ShowBorders))
- {
- ImGui::Text("Coded by; #Coder");
- if (ImGui::Button("Visual", ImVec2(65, 40)))
- {
- tabb = 1;
- }
- ImGui::SameLine();
- if (ImGui::Button("Weapon", ImVec2(65, 40)))
- {
- tabb = 2;
- }
- ImGui::BeginChild(1, ImVec2(500, 300), true);
- switch (tabb)
- {
- case 1:
- {
- ImGui::Checkbox("deneme", &testchk);
- if (testchk)
- {
- DWORD ADRES = nameesp;
- DWORD VALUE = 2251829620;// name esp kapalı
- WriteProcessMemory(MEMORY, (LPVOID)ADRES, &VALUE, 4, NULL);
- }
- }
- break;
- case 2:
- {
- ImGui::Text("2");
- }
- break;
- default:
- break;
- }
- ImGui::EndChild();
- ImGui::End();
- }
- ImGui::Render(); //Calling ImGui to Render our Stuff*/
- }
- HRESULT WINAPI hkPresent(LPDIRECT3DDEVICE9 pDevice, const RECT *a, const RECT *b, HWND c, const RGNDATA *d)
- {
- if (!isImGUiOK)
- {
- ImGuiIO& io = ImGui::GetIO();
- io.DeltaTime = 1.0f / 60.0f;
- D3DDEVICE_CREATION_PARAMETERS d3dcp{ 0 };
- pDevice->GetCreationParameters(&d3dcp);
- io.Fonts->AddFontDefault();
- ImGui_ImplDX9_Init(d3dcp.hFocusWindow, pDevice); // Render ImGui
- ColdHack();
- //isImGUiOK = true;
- }
- if (GetAsyncKeyState(VK_INSERT) & 1)
- {
- bShowMenu = !bShowMenu;
- }
- MenuRender();
- //Do ur Memory editing here or make your own thread
- ImGui::GetIO().MouseDrawCursor = bShowMenu;
- return oPresent(pDevice, a, b, c, d);
- }
- HRESULT WINAPI hkDrawIndexedPrimitive(LPDIRECT3DDEVICE9 pDevice, D3DPRIMITIVETYPE Type, int BaseVertexIndex, UINT MinIndex, UINT NumVertices, UINT StartIndex, UINT PrimCount)
- {
- if (!g_pDevice)
- {
- g_pDevice = pDevice;
- }
- if (pDevice->GetStreamSource(0, &Stream_Data, &Offset, &Stride) == D3D_OK)
- Stream_Data->Release();
- //Charm Hack Ready , code it yourself or google for source
- return oDrawIndexedPrimitive(pDevice, Type, BaseVertexIndex, MinIndex, NumVertices, StartIndex, PrimCount);
- }
- LRESULT CALLBACK hWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
- {
- if (ImGui_ImplDX9_WndProcHandler(hwnd, uMsg, wParam, lParam) && GetKeyState(VK_INSERT) == 1)
- {
- return 1l;
- }
- return CallWindowProc(oriWndProc, hwnd, uMsg, wParam, lParam);
- }
- //Change Title
- DWORD __stdcall Thread(void * pParam)
- {
- UNREFERENCED_PARAMETER(pParam);
- oriWndProc = (WNDPROC)SetWindowLongPtr(FindWindow(NULL, "WolfTeam"),GWL_WNDPROC, (LONG)(LONG_PTR)hWndProc);
- return TRUE;
- }
- DWORD WINAPI Hook(LPVOID lpAlgs)
- {
- DWORD dwD3D9 = 0;
- while (!dwD3D9) {
- Sleep(100);
- dwD3D9 = (DWORD)GetModuleHandle("d3d9.dll");
- }
- DWORD PPPDevice = FindPattern(dwD3D9, 0x128000, (PBYTE)"\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86", "xx????xx????xx"); //C7 06 ? ? ? ? 89 86 ? ? ? ? 89 86
- memcpy(&VTable, (void *)(PPPDevice + 2), 4);
- DWORD dwVTable[5] = { 0 };
- CreateDevice(dwVTable);
- oReset = (tReset)DetourFunction((PBYTE)dwVTable[0], (PBYTE)&hkReset);
- oPresent = (tPresent)DetourFunction((PBYTE)dwVTable[1], (PBYTE)&hkPresent);
- oEndScene = (tEndScene)DetourFunction((PBYTE)dwVTable[2], (PBYTE)&hkEndScene);
- oDrawIndexedPrimitive = (tDrawIndexedPrimitive)DetourFunction((PBYTE)dwVTable[3], (PBYTE)&hkDrawIndexedPrimitive);
- return FALSE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement