-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c16ee8d
commit e7a648a
Showing
33 changed files
with
2,796 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Set the minimum required cmake version | ||
cmake_minimum_required(VERSION 3.27) | ||
|
||
# Declare project | ||
project(Example) | ||
|
||
# Set your c++ version here | ||
set(CMAKE_CXX_STANDARD 20) | ||
|
||
# This will be containing all of your files | ||
add_library(Example SHARED Inject.cpp | ||
me/sleepy/example/Example.cpp | ||
me/sleepy/example/Example.h | ||
) | ||
|
||
# Add all libraries here | ||
target_link_libraries(Example PRIVATE winmm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include <windows.h> | ||
#include "me/sleepy/example/Example.h" | ||
|
||
// Function called when injected | ||
void Init(HMODULE mod) { | ||
Example::Inject(); | ||
|
||
// Change this to a boolean so you can detach later with a button in your ImGui | ||
while (!GetAsyncKeyState(VK_BACK)) { | ||
} | ||
|
||
FreeLibrary(mod); | ||
} | ||
|
||
BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved) { | ||
|
||
if (dwReason == DLL_PROCESS_ATTACH) { | ||
DisableThreadLibraryCalls(hModule); | ||
|
||
const HANDLE hThread = CreateThread ( | ||
0, 0, (LPTHREAD_START_ROUTINE) (Init), hModule, 0, 0 | ||
); | ||
|
||
if (hThread) | ||
CloseHandle(hThread); | ||
} | ||
|
||
return TRUE; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# CLion DLL Example | ||
|
||
This is a free to use CLion DLL Example. | ||
Use it for litterly anything but give credits. | ||
|
||
### Use Visual Studio Toolchain | ||
![settingUp](https://i.imgur.com/3QTid34.png) | ||
|
||
### Additional Information | ||
- Change the toolchain to Visual Studio to work. If your not doing so you are unable to use any std:: functions. | ||
- If you want to use stuff like PlaySoundA then add this to your CMakeLists: (I already added this on default) | ||
|
||
```cmake | ||
target_link_libraries(Example PRIVATE winmm) | ||
``` | ||
|
||
### If you're not using Visual Studio Toolchain read this ! | ||
- You can not use `std::cout << "Random text \n";` instead use `printf("Random text \n");` | ||
- Don't use `std::string random;` and instead use `char* random;` | ||
|
||
### Why CLion and not Visual Studio ? | ||
- CLion is for rich kids | ||
- Clion looks better | ||
- CLion has refactors that actually work | ||
- CLion has better functionalities | ||
- CLion has a better Package manager | ||
- CLion project files are smaller | ||
|
||
###### Im a IntelliJ Kid |
Oops, something went wrong.