This is an old piece of code I made like 5-7 years ago.
Code:
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include <iostream>
#include <tchar.h>
#include <exception>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdlib.h>
#include <stdio.h>
#include "MemoryFunctions.h"
#include "shield.h"
#define DLL_EXPORT extern "C" __declspec(dllexport)
BOOL STARTED = false;
BOOL(WINAPI* pMove)
(HWND, int, int, int, int, BOOL) = MoveWindow;
void WriteValueExp(char* lpAppName, char* lpKeyName, int a3)
{
char a[100];
sprintf(a, "%d", a3);
WritePrivateProfileStringA((lpAppName), (lpKeyName), a, "ini\\info.ini");
}
void load_gui(int width, int height)
{
wchar_t width_s[5], height_s[5];
wsprintf(width_s, L"%d", width);
wsprintf(height_s, L"%d", height);
WritePrivateProfileString(TEXT("0-0"), TEXT("w"), width_s, TEXT("ini\\GUI.ini"));
WritePrivateProfileString(TEXT("0-0"), TEXT("h"), height_s, TEXT("ini\\GUI.ini"));
int x = ((width - 1024) / 2);
wchar_t x_s[5];
wsprintf(x_s, L"%d", x);
int y = 627 + (height - 768);
wchar_t y_s[5];
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-130"), TEXT("w"), width_s, TEXT("ini\\GUI.ini"));
WritePrivateProfileString(TEXT("0-130"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
WritePrivateProfileString(TEXT("0-130"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
x = 82 + ((width - 1024) / 2);
x_s[5];
wsprintf(x_s, L"%d", x);
y = (height - 71);
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-145"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
WritePrivateProfileString(TEXT("0-145"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
x = 935 + ((width - 1024));
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-304"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 315 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-357"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
y = 650 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-339"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
x = 276 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-339"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 663 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-272"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
x = 276 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-272"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
// + btn
x = 984 + ((width - 1024));
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-1199"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
// - btn
x = 1004 + ((width - 1024));
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-1200"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
// chat btn
x = 610 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-3"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 650 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-3"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
// options
x = 327 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-138"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 237 + ((height - 768) / 2);
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-138"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
// options
x = 380 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-141"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
//Chat btns
x = 254 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-174"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 452 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-174"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
//PK Modes
x = 734 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-191"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 670 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-191"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
// left btn
y = 283 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-1198"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
// guild btn
x = 680 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-371"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 615 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-371"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
// main emoji btn
x = 574 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-367"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 520 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-367"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
// emoji btn
x = 574 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-274"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 550 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-274"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
// emoji btn
x = 574 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-360"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 550 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-360"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
// emoji btn
x = 574 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-140"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 550 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-140"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
//Shopping mall
x = 132 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-289"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 653 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-289"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
//Arena
x = 325 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-403"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 650 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-403"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
//Lock
x = 223 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-328"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 654 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-328"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
//Mentor
x = 165 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-325"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 639 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-325"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
//Hide
x = 90 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-484"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 670 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-484"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
//Inventory
x = 754 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-153"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-153"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
//Arrows
x = 724 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-272"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 975 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-272"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
//Events box
x = 770 + ((width - 1024));
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-464"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
//Dance
x = 574 + ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-421"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = 541 + ((height - 768));
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("0-421"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
// ARENA 412-2482
x = ((width - 1024) / 2);
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("412-2482"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
y = height - 768;
wsprintf(y_s, L"%d", y);
WritePrivateProfileString(TEXT("412-2482"), TEXT("y"), y_s, TEXT("ini\\GUI.ini"));
x = 650 + ((width - 1024));
wsprintf(x_s, L"%d", x);
WritePrivateProfileString(TEXT("0-258"), TEXT("x"), x_s, TEXT("ini\\GUI.ini"));
WriteValueExp("ExpShowPos", "Exp_YPos", 673 + (height - 768));
WriteValueExp("ExpShowPos", "AddExp_YPos", 673 + (height - 768));
WriteValueExp("ExpShowPos", "Exp_XPos", 485 + ((width - 1024) / 2));
WriteValueExp("ExpShowPos", "AddExp_XPos", 575 + ((width - 1024) / 2));
}
int y_p = 0, width_p = 0;
int Edited = 0, width = 0, height = 0;
BOOL __stdcall move_wind(HWND hWnd,
int X,
int Y,
int nWidth,
int nHeight,
BOOL bRepaint)
{
if (Y == y_p && nWidth == width_p && X == 0)// width_p : screen width && y_p = 627 + (height - 768);
{
X = ((width_p - 1024) / 2);
}
return pMove(hWnd, X, Y, nWidth, nHeight, bRepaint);
}
extern "C" int __declspec(dllexport) __cdecl EntryPoint() {
if (STARTED) return 0;
STARTED = true;
RECT desktop;
const HWND hDesktop = GetDesktopWindow();
// Get the size of screen to the variable desktop
GetWindowRect(hDesktop, &desktop);
// The top left corner will have coordinates (0,0)
// and the bottom right corner will have coordinates
// (horizontal, vertical)
int m_width = desktop.right;
int m_height = desktop.bottom;
TCHAR sAbsolutePathBuffer[2048] = _T("");
int fs = 0, FPS = 40;
if (GetFullPathName(TEXT("config.ini"), sizeof(sAbsolutePathBuffer) / sizeof(TCHAR), sAbsolutePathBuffer, NULL))
{
FPS = GetPrivateProfileInt(TEXT("Screen"), TEXT("FPS"), 40, sAbsolutePathBuffer);
width = GetPrivateProfileInt(TEXT("Screen"), TEXT("Width"), 1024, sAbsolutePathBuffer);
height = GetPrivateProfileInt(TEXT("Screen"), TEXT("Height"), 768, sAbsolutePathBuffer);
if (width > m_width) width = m_width;
if (height > m_height) height = m_height;
if (width < 1024) width = 1024;
if (height < 768) height = 768;
if (FPS > 900) FPS = 900;
if (FPS < 40) FPS = 40;
}
load_gui(width, height);
width_p = width;
y_p = 627 + (height - 768);
int a;
//start_hp();
//start_hp();
DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourAttach(&(PVOID&)pMove, move_wind);
if (DetourTransactionCommit() != NO_ERROR)
{
exit(0);
return 0;
}
HookMe((void*)0x005AB540, (1000 / FPS), 1); // FPS
HookMe((void*)0x005AB549, (1000 / FPS), 1); // FPS 005AB547 . 83C1 19 ADD ECX,19
HookMe((void*)0x005D7EAA, width, 5);
HookMe((void*)0x005D7EAF, height, 5);
HookMe((void*)0x0063A15E, width, 5);
HookMe((void*)0x0063A177, height, 5);
HookMe((void*)0x0063A185, height, 5);
return 1;
}
BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
break;
}
case DLL_THREAD_ATTACH:
{
EntryPoint();
break;
}
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
Maybe rubbish? TRUE. Good luck!