Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
SleepyFish-YT authored Mar 21, 2024
1 parent c16ee8d commit e7a648a
Show file tree
Hide file tree
Showing 33 changed files with 2,796 additions and 0 deletions.
17 changes: 17 additions & 0 deletions CMakeLists.txt
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)
30 changes: 30 additions & 0 deletions Inject.cpp
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;

}
29 changes: 29 additions & 0 deletions README.MD
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
Loading

0 comments on commit e7a648a

Please sign in to comment.