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 ?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..