77upup Posted August 15, 2022 Posted August 15, 2022 On 2/6/2022 at 11:13 PM, wongerlt said: you can do with dll. example: main.cpp (its good or no idk, but its working fine.) #include "main.h" #include "Winuser.h" #include <process.h> void TitleReplaceHookThread(void *param) { DWORD pid = 0; DWORD current_pid = GetCurrentProcessId(); while(true) { Sleep(50); HWND hWnd = FindWindow(NULL, "Lineage II"); GetWindowThreadProcessId(hWnd,&pid); if(hWnd&¤t_pid==pid) { SetWindowText(hWnd, "My Server Name"); break; } } } extern "C" DLL_EXPORT BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { switch (fdwReason) { case DLL_PROCESS_ATTACH: HANDLE hThread; hThread = (HANDLE)_beginthread(TitleReplaceHookThread, 0, NULL); CloseHandle(hThread); break; } return TRUE; } main.h #ifndef __MAIN_H__ #define __MAIN_H__ #include <windows.h> #ifdef BUILD_DLL #define DLL_EXPORT __declspec(dllexport) #else #define DLL_EXPORT __declspec(dllimport) #endif #endif compile and put ur dll file to ur l2 system folder. to compile you can use simple tool `CodeBlocks` and then use CFF Explorer 1. Open window.dll 2. Click Import Adder 3. Add dll file. 4. Select Exported function `DllMain@` and click Import by Name and then click Rebuild Import table. 5. save window.dll done. The code throws an error while compiling, does anyone have an alternative code ? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.