Created
February 24, 2021 17:17
-
-
Save user-grinch/44f503c3836e2a07542c458afdbef4e7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#include <Windows.h> | |
#include <stdio.h> | |
void(*LoadObjectData)(const char*) = (void(*)(const char*))0x5B5360; | |
void Thread(void *param) | |
{ | |
Sleep(3000); | |
HMODULE hModule = GetModuleHandle(NULL); | |
HANDLE dir; | |
WIN32_FIND_DATA file_data; | |
if ((dir = FindFirstFile("./ObjectDat/*", &file_data)) == INVALID_HANDLE_VALUE) | |
return; | |
do { | |
const CHAR* file_name = file_data.cFileName; | |
CHAR full_file_name[128]; | |
sprintf_s(full_file_name, "./ObjectDat/%s", file_name); | |
const BOOL is_directory = (file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; | |
if (!(file_name[0] == '.' && is_directory)) | |
LoadObjectData(full_file_name); | |
} while (FindNextFile(dir, &file_data)); | |
FreeLibraryAndExitThread(hModule, 0); | |
} | |
BOOL WINAPI DllMain(HINSTANCE hDllHandle, DWORD nReason, LPVOID Reserved) | |
{ | |
if (nReason == DLL_PROCESS_ATTACH) | |
CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)&Thread,NULL,NULL,NULL); | |
return TRUE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment