Skip to content

Commit

Permalink
Cleaned up dllmain & changed default fly key to V
Browse files Browse the repository at this point in the history
  • Loading branch information
chadlrnsn committed Jun 17, 2024
1 parent 22752e6 commit a1d4080
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 20 deletions.
4 changes: 1 addition & 3 deletions cheat-library/src/Features/Fly.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ class Fly : Feature
float fZSpeedMin = 10.0f;
float fZSpeedMax = 2000.0f;

KeyBindToggle kbToggle = KeyBindToggle(KeyBind::KeyCode::F);
//KeyBind kbUp = KeyBind::isPressed(KeyBind::KeyCode::SPACE);
//KeyBind kbDown = KeyBindToggle(KeyBind::KeyCode::LCTRL);
KeyBindToggle kbToggle = KeyBindToggle(KeyBind::KeyCode::V);

private:
float fOldSpeed = 0.0f;
Expand Down
16 changes: 3 additions & 13 deletions cheat-library/src/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@ void CreateRenderTarget(IDXGISwapChain* pSwapChain)
}

LRESULT __stdcall WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
//switch (uMsg) {
//case WM_SIZE:
// if (pDevice != nullptr && wParam != SIZE_MINIMIZED) {
// UINT width = LOWORD(lParam);
// UINT height = HIWORD(lParam);
// ResizeSwapChain(pSwapChain, pDevice, pContext, &mainRenderTargetView, width, height);
// }
// break;
//}

ImGuiIO& io = ImGui::GetIO();
io.MouseDrawCursor = menu.IsOpened();

Expand Down Expand Up @@ -135,19 +125,19 @@ DWORD WINAPI KeyHandler(LPVOID lpReserved)


if (GetAsyncKeyState(QuitKey) & 1) {
g_bUnload = true;
kiero::shutdown();
ExitProcess(EXIT_SUCCESS);

FreeLibraryAndExitThread((HMODULE)lpReserved, 0);
// Temporary disabled due to crash
//DllSelfUnloading((HMODULE)hModule);

return 0;
}

Sleep(100);
}

return TRUE;
return 0;
}

DWORD WINAPI FeaturesThread(LPVOID lpReserved)
Expand Down
7 changes: 3 additions & 4 deletions cheat-library/src/dllmain.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@

typedef HRESULT(__stdcall* ResizeBuffers)(IDXGISwapChain* pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags);
ResizeBuffers oResizeBuffers = nullptr;

typedef HRESULT(__stdcall* Present) (IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags);
Present oPresent;

typedef LRESULT(CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
typedef uintptr_t PTR;

Expand All @@ -38,7 +39,6 @@ HRESULT ResizeSwapChain(IDXGISwapChain* pSwapChain, ID3D11Device* pDevice, ID3D1
ID3D11RenderTargetView** pRenderTargetView, UINT Width, UINT Height);

volatile bool g_bUnload = false;
Present oPresent;
HWND window = NULL;
WNDPROC oWndProc;
ID3D11Device* pDevice = NULL;
Expand All @@ -56,8 +56,7 @@ void CleanupRenderTarget();

LRESULT __stdcall WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
HRESULT __stdcall hkPresent(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags);
HRESULT ResizeSwapChain(IDXGISwapChain* pSwapChain, ID3D11Device* pDevice, ID3D11DeviceContext* pContext,
ID3D11RenderTargetView** pRenderTargetView, UINT Width, UINT Height);
HRESULT __stdcall hkResizeBuffers(IDXGISwapChain* pSwapChain, UINT BufferCount, UINT Width, UINT Height, DXGI_FORMAT NewFormat, UINT SwapChainFlags);

// Hack stuff
DWORD WINAPI KeyHandler(LPVOID lpReserved);
Expand Down

0 comments on commit a1d4080

Please sign in to comment.