Noticias:

SMF - Just Installed!

Menú principal

Source Auto Login Button V4 Save password

Publicado por Dakosmu, Jun 11, 2023, 07:04 PM

Tema anterior - Siguiente tema

Dakosmu

Source Auto Login Button V4 Save password

Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión



INFORMACION
Primero debemos agregar los archivos AutoLogin.h AutoLogin.cpp CustomFont.h CustomFont.cpp
a nuestra carpeta de Source Main y remplazar si ya tienes otro archivos con el mismo nombre


Luego creamos los Filtros Custom, SwitchServer, Login luego agregamos los elementos .h .cpp

FILTROS
Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión


ELEMENTOS
Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión







Luego vamos a Main.cpp

y agregamos
#include "AutoLogin.h"Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión


AutoLogin.cpp

#include "stdafx.h"
#include "AutoLogin.h"
#include "Util.h"
#include "Interface.h"
#include "CustomFont.h"

cAutoLogin AutoLogin;


cAutoLogin::cAutoLogin()
{
}

cAutoLogin::~cAutoLogin()
{
}

float getX(float x) {
return x / g_fScreenRate_x;
}
float getY(float y) {
return y / g_fScreenRate_x;
}

bool IsCursorInZone(short x, short y, short x2, short y2) {
return pCursorX >= x && pCursorX <= x + x2 && pCursorY >= y && pCursorY <= y + y2;
}

bool WriteString(const std::string& name, const std::string& value) {
HKEY hKey = NULL;
DWORD dwDisp;
DWORD dwSize = value.size();

if (ERROR_SUCCESS != RegCreateKeyEx(HKEY_CURRENT_USER, "SOFTWARE\\Webzen\\Mu\\Config", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisp))
return false;

RegSetValueEx(hKey, name.c_str(), 0L, REG_SZ, (CONST BYTE*)value.c_str(), dwSize);
RegCloseKey(hKey);
return true;
}

bool WriteDword(const std::string& name, DWORD value) {
HKEY hKey = NULL;
DWORD dwDisp;
DWORD dwSize = sizeof(DWORD);

if (ERROR_SUCCESS != RegCreateKeyEx(HKEY_CURRENT_USER, "SOFTWARE\\Webzen\\Mu\\Config", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisp))
return false;

RegSetValueEx(hKey, name.c_str(), 0L, REG_DWORD, (BYTE*)&value, dwSize);
RegCloseKey(hKey);
return true;
}

void DoRequestLogin()
{
int Struct = _Instance() + 16968;

InputBox_GetText(*(DWORD*)(Struct + 848), AutoLogin.iUser, 11);
InputBox_GetText(*(DWORD*)(Struct + 852), AutoLogin.iPassword, 11);
if (AutoLogin.savePass) {
WriteString("ID", AutoLogin.iUser);
WriteString("PW", AutoLogin.iPassword);
WriteDword("SavePass", 1);
}
else {
WriteDword("SavePass", 0);
}
//do it
RequestLogin(_Instance() + 16968);
}

void CButtonAutoLogin(int This, int a2)
{
CUIRenderText_SetFont((int)pTextThis(), *(int*)0xE8C594);

float startX = (640.0 - getX(329)) / 2,
startY = (480.0 - getY(245)) * 2.0 / 3.0;

int Struct = _Instance() + 16968;

if (IsCursorInZone(startX + getX(246.0), startY + getY(156), 15, 15)) {
if (pIsKeyRelease(VK_LBUTTON))
{
pDrawButton(0x7B69, startX + getX(246.0), startY + getY(156), 15, 15, 0, 0);
AutoLogin.savePass = !AutoLogin.savePass;
PlayBuffer(25, 0, 0);
}
}
if (AutoLogin.savePass) {
switch (pWinWidth)
{
//1024
case 1024:
RenderBitmap(0x7B69, (startX + 374) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 82, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.02999999747, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX + getX(91), startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
//1280
case 1280:
RenderBitmap(0x7B69, (startX + 482) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 84, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.02999999747, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX + getX(60), startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
//1366
case 1366:
RenderBitmap(0x7B69, (startX + 520) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 82, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.02999999747, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX + getX(41), startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
//1440
case 1440:
RenderBitmap(0x7B69, (startX + 553) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 84, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.02999999747, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX + getX(32), startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
//1600
case 1600:
RenderBitmap(0x7B69, (startX + 626) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 84, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.02999999747, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX + getX(5), startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
//1680
case 1680:
RenderBitmap(0x7B69, (startX + 662) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 84, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.02999999747, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX - 4, startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
//1920
case 1920:
RenderBitmap(0x7B69, (startX + 774) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 84, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.02999999747, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX - 15, startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
//600 o 800
default:
RenderBitmap(0x7B69, (startX + 292) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 82, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.02999999747, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX + getX(130), startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
}
}
else {
switch (pWinWidth)
{
//1024
case 1024:
RenderBitmap(0x7B69, (startX + 374) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 82, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.5, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX + getX(91), startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
//1280
case 1280:
RenderBitmap(0x7B69, (startX + 482) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 84, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.5, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX + getX(60), startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
//1366
case 1366:
RenderBitmap(0x7B69, (startX + 520) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 82, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.5, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX + getX(41), startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
//1440
case 1440:
RenderBitmap(0x7B69, (startX + 553) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 84, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.5, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX + getX(32), startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
//1600
case 1600:
RenderBitmap(0x7B69, (startX + 626) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 84, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.5, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX + getX(5), startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
//1680
case 1680:
RenderBitmap(0x7B69, (startX + 662) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 84, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.5, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX - 4, startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
//1920
case 1920:
RenderBitmap(0x7B69, (startX + 774) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 84, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.5, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX - 15, startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
//600 o 800
default:
RenderBitmap(0x7B69, (startX + 292) / g_fScreenRate_x, (MAX_WIN_HEIGHT / 2) - (15 / 2) + 82, 20 / g_fScreenRate_x, 15 / g_fScreenRate_y, 0.01, 0.5, 0.8799999952, 0.3700000346, 1, 1, 0);
CustomFont.Draw(CustomFont.FontNormal, startX + getX(130), startY + getY(160), 0xffffffD1, 0x0, 92, 0, 4, "Save password");
break;
}

}
}


void DoLoginWinCreate(int)
{
int Struct = _Instance() + 16968;
LoginWinCreate(Struct);
if (AutoLogin.savePass) {
InputBox_SetText(*(DWORD*)(Struct + 848), AutoLogin.iUser);
InputBox_SetText(*(DWORD*)(Struct + 852), AutoLogin.iPassword);
}
}

void cAutoLogin::Load()
{
//read data
HKEY hKey;
DWORD dwDisp;
DWORD dwSize;
if (ERROR_SUCCESS == RegCreateKeyEx(HKEY_CURRENT_USER, "SOFTWARE\\Webzen\\Mu\\Config", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &dwDisp))
{
dwSize = 11;
if (RegQueryValueEx(hKey, "ID", 0, NULL, (LPBYTE)AutoLogin.iUser, &dwSize) != ERROR_SUCCESS)
{
ZeroMemory(AutoLogin.iUser, sizeof(AutoLogin.iUser));
}
dwSize = 11;
if (RegQueryValueEx(hKey, "PW", 0, NULL, (LPBYTE)AutoLogin.iPassword, &dwSize) != ERROR_SUCCESS)
{
ZeroMemory(AutoLogin.iPassword, sizeof(AutoLogin.iPassword));
}
dwSize = sizeof(int);
if (RegQueryValueEx(hKey, "SavePass", 0, NULL, (LPBYTE)&AutoLogin.savePass, &dwSize) != ERROR_SUCCESS)
{
AutoLogin.savePass = false;
}
}

//end

SetCompleteHook(0xE8, 0x0040B5A9, &CButtonAutoLogin);
SetCompleteHook(0xE8, 0x0040B400, &DoRequestLogin);
SetCompleteHook(0xE8, 0x0040B44F, &DoRequestLogin);
SetCompleteHook(0xE8, 0x00483711, &DoLoginWinCreate);
}

AutoLogin.h

#pragma once
#define InputBox_GetText ((void(__thiscall*)(int thisa, LPSTR lpString, int nMaxCount)) 0x004217D0)
#define InputBox_SetText ((void(__thiscall*)(int thisa, const char* pszText)) 0x00421830)
#define RequestLogin ((int(__thiscall*)(int This)) 0x0040B7B0)
#define Sprite_SetPosition ((void(__thiscall*)(BYTE * CButton, int cx, int cy, int eChangedPram)) 0x00416640)
#define CUIRenderText_SetFont ((int(__thiscall*)(int This, int a2)) 0x00420120)
#define pTextThis ((LPVOID(*)()) 0x0041FE10)
#define _Instance ((int(*)()) 0x00482B70)
#define SEASON3B_CheckMouseIn ((bool(__cdecl*)(int a1, int a2, int a3, int a4)) 0x00790B10)
#define g_fScreenRate_x *(float*)0xE7C3D4
#define g_fScreenRate_y *(float*)0xE7C3D8
#define IsPress ((int(__cdecl*)(int VKBUTTON)) 0x00791070)
#define RenderBitmap ((void(__cdecl*)(int a1, float a2, float a3, float a4, float a5, float a6, float a7, float a8, float a9, char a10, char a11, float a12)) 0x00637C60)
#define PlayBuffer ((signed int(__cdecl*)(int a1, int a2, int a3)) 0x006D6C20)
#define LoginWinCreate ((void(__thiscall*)(int This)) 0x0040AD70)
#define pIsKeyRelease         ((bool(__cdecl*)(int)) 0x791050)

class cAutoLogin
{
public:
cAutoLogin();
~cAutoLogin();
void Load();
BOOL savePass;
char iUser[32];
char iPassword[32];
private:

};

extern cAutoLogin AutoLogin;


CustomFont.cpp

#include "stdafx.h"
#include "CustomFont.h"
#include "Interface.h"

eCustomFont CustomFont;

eCustomFont::eCustomFont()
{
}

eCustomFont::~eCustomFont()
{
}

void eCustomFont::load()
{
DWORD Width = 0;
DWORD Italic = 0;
DWORD UnderLine = 0;
DWORD StrikeOut = 0;
DWORD Quality = 3;

this->FontNormal = CreateFontA(13, Width, 0, 0, 400, Italic, UnderLine, StrikeOut, 0x1, 0, 0, Quality, 0, "Tahoma");
this->FontBold = CreateFontA(13, Width, 0, 0, 700, Italic, UnderLine, StrikeOut, 0x1, 0, 0, Quality, 0, "Tahoma");
this->FontSize15 = CreateFontA(15, Width, 0, 0, 400, Italic, UnderLine, StrikeOut, 0x1, 0, 0, Quality, 0, "Tahoma");
this->FontSize18 = CreateFontA(18, Width, 0, 0, 400, Italic, UnderLine, StrikeOut, 0x1, 0, 0, Quality, 0, "Tahoma");
}

eColor eCustomFont::SinWaveColor(float frc1, float frc2, float frc3, BYTE phs1, BYTE phs2, BYTE phs3, BYTE center, BYTE width, BYTE step) {
eColor result;

result.red = std::sin(frc1 * step + phs1) * width + center;
result.grn = std::sin(frc2 * step + phs2) * width + center;
result.blu = std::sin(frc3 * step + phs3) * width + center;
result.opl = 0xff;

return result;
}

void eCustomFont::Draw(HFONT font, int PosX, int PosY, DWORD color, DWORD bkcolor, int Width, int Height, BYTE Align, LPCTSTR Text, ...) {
char Buff[2048];
int BuffLen = sizeof(Buff) - 1;
ZeroMemory(Buff, BuffLen);

va_list args;
va_start(args, Text);
int Len = vsprintf_s(Buff, BuffLen, Text, args);
va_end(args);

int LineCount = 0;

char* Line = strtok(Buff, "\n");

while (Line != NULL)
{
pSetTextSize(pTextThis(), font);
pSetTextColor(pTextThis(), (color & 0xff000000) >> 24, (color & 0x00ff0000) >> 16, (color & 0x0000ff00) >> 8, color & 0x000000ff);
pSetBackgroundTextColor(pTextThis(), (bkcolor & 0xff000000) >> 24, (bkcolor & 0x00ff0000) >> 16, (bkcolor & 0x0000ff00) >> 8, bkcolor & 0x000000ff);
pDrawText(pTextThis(), PosX, PosY, Line, Width, Height, (LPINT)Align, 0);
PosY += 10;
Line = strtok(NULL, "\n");
}
}

void eCustomFont::DrawMultipleColor(HFONT font, int PosX, int PosY, DWORD bkcolor, int Width, int Height, BYTE Align, LPCTSTR Text, ...) {
char Buff[2048];
int BuffLen = sizeof(Buff) - 1;
ZeroMemory(Buff, BuffLen);

va_list args;
va_start(args, Text);
int Len = vsprintf_s(Buff, BuffLen, Text, args);
va_end(args);

int LineCount = 0;

char* Line = strtok(Buff, "\n");
BYTE len = strlen(Line);

char filter[10];
char bufer[255];
while (Line != NULL)
{
pSetTextSize(pTextThis(), font);

pSetBackgroundTextColor(pTextThis(), (bkcolor & 0xff000000) >> 24, (bkcolor & 0x00ff0000) >> 16, (bkcolor & 0x0000ff00) >> 8, bkcolor & 0x000000ff);
for (BYTE i = 0; i < len; i++) {
eColor mColor = CustomFont.SinWaveColor(0.1f, 0.1f, 0.1f, 0, 2, 4, 128, 127, i + GetTickCount() / 100 % 255);
pSetTextColor(pTextThis(), mColor.red, mColor.grn, mColor.blu, mColor.opl);
sprintf(filter, "%%.%ds", len - i);
sprintf(bufer, filter, Line);
pDrawText(pTextThis(), PosX, PosY, bufer, Width, Height, (LPINT)Align, 0);
}
PosY += 10;
Line = strtok(NULL, "\n");
}
}

CustomFont.h

#define pFontNormal *(HGDIOBJ*)0x00E8C588 //AutoLogin
#define pFontBold *(HGDIOBJ*)0x00E8C58C //AutoLogin
#define pTextThis ((LPVOID(*)()) 0x0041FE10)
#define pTextFormat ((int(__cdecl*)(char * Buffer, int Arg2, int LineSize, LPCTSTR Text, int LineWidth, bool Arg6, BYTE Arg7)) 0x540880)
#define pDrawColorText ((int(__cdecl*)(LPCTSTR Text, int PosX, int PosY, int Width, int Arg5, int Color, int Arg7, int Align)) 0x7D0380)
#define pGetTextLine ((LPCSTR(__thiscall*)(LPVOID This, int LineNumber)) 0x00402320)
#define pMakeColor ((DWORD(__cdecl*)(BYTE, BYTE, BYTE, BYTE)) 0x00412D20)
#define pSetTextColor ((void(__thiscall*)(LPVOID This, int r, int g, int b, int h)) 0x00420040)
#define pSetBackgroundTextColor ((void(__thiscall*)(LPVOID This, int r, int g, int b, int h)) 0x004200B0)
#define pSetTextSize ((int(__thiscall*)(LPVOID This, HFONT a2)) 0x00420120)
#define pSetTextFont ((int(__thiscall*)(LPVOID This, HFONT a2)) 0x00420120)
#define pDrawText ((int(__thiscall*)(LPVOID This, int PosX, int PosY, LPCTSTR Text, int Width, int Height, LPINT Align, int unknow)) 0x00420150)
#define pUnknow00420080 ((DWORD(__cdecl*)(LPVOID This, char Arg1)) 0x00420080)
#define pUnknow004200F0 ((DWORD(__cdecl*)(LPVOID This, char Arg1)) 0x004200F0)
#define pSetBlend ((void(__cdecl*)(BYTE Mode)) 0x635FD0)
#define pGetTextNumber ((int(__cdecl*)(int a1))0x009CFF45)

struct eColor {
BYTE red;
BYTE grn;
BYTE blu;
BYTE opl;
};

class eCustomFont
{
public:
eCustomFont();
~eCustomFont();
void load();
void Draw(HFONT font, int PosX, int PosY, DWORD color, DWORD bkcolor, int Width, int Height, BYTE Align, LPCTSTR Text, ...);
void DrawMultipleColor(HFONT font, int PosX, int PosY, DWORD bkcolor, int Width, int Height, BYTE Align, LPCTSTR Text, ...);
eColor SinWaveColor(float frc1, float frc2, float frc3, BYTE phs1, BYTE phs2, BYTE phs3, BYTE center, BYTE width, BYTE step);

HFONT FontNormal;
HFONT FontBold;
HFONT FontSize15;
HFONT FontSize18;
};

extern eCustomFont CustomFont;


luego buscamos en el mismo Main.cpp

Buscamos
gCustomMap.Load();
y agregamos
AutoLogin.Load();
Los visitantes no pueden visualizar imágenes en los mensajes, por favor Regístrate o Inicia Sesión



ARCHIVOS Descarga

sendspace
https://www.sendspace.com/file/l7rcnm


MEGA
You require the following to view this post content:
  • You require a post count of at least 6, you need another 6 posts.
[/hide] Por la Guia
Bon Dia

🡱 🡳