Jump to content

Recommended Posts

Posted
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&&current_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 ?

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock