Reklam
#include "PearlGui.h"
#include "Timer.h"
#include "resource.h"
#include <future>
#include "CSpell.h"
#include "FunctionGuard.h"
#include "../resource.h"
#include <d3dx9.h>
#pragma comment(lib, "d3dx9.lib")
using namespace std;
extern bool ischeatactive;
// FPS Hesaplama ve Çizim Değişkenleri
float g_fFPS = 0.0f;
int g_iFrameCount = 0;
DWORD g_dwLastFPSTime = 0;
LPD3DXFONT g_pFontFPS = NULL;
HRESULT WINAPI HookCreateDevice();
#define HOOK(func,addy) o##func = (t##func)DetourFunction((PBYTE)addy,(PBYTE)hk##func)
#define D3D_RELEASE(D3D_PTR) if( D3D_PTR ){ D3D_PTR->Release(); D3D_PTR = NULL; }
#define ES 0
#define DIP 1
#define RES 2
#define FOX 3
HRESULT WINAPI hkReset(LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS*);
typedef HRESULT(WINAPI* tEndScene)(LPDIRECT3DDEVICE9);
typedef HRESULT(WINAPI* tReset)(LPDIRECT3DDEVICE9, D3DPRESENT_PARAMETERS*);
typedef HRESULT(WINAPI* mySendMessage) (HWND, UINT, WPARAM, LPARAM);
typedef HRESULT(WINAPI* CreateDevice_t)(IDirect3D9* Direct3D_Object, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow,
DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters,
IDirect3DDevice9** ppReturnedDeviceInterface);
HRESULT WINAPI D3DCreateDevice_hook(IDirect3D9* Direct3D_Object, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow,
DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters,
IDirect3DDevice9** ppReturnedDeviceInterface);
CreateDevice_t D3DCreateDevice_orig;
typedef HRESULT(WINAPI* tSetScissorRect)(LPDIRECT3DDEVICE9 pDevice, D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9* ppSB);
tSetScissorRect oSetScissorRect;
HRESULT WINAPI SetScissorRect(LPDIRECT3DDEVICE9 pDevice, D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9* ppSB)
{
HRESULT ret = oSetScissorRect(pDevice, Type, ppSB);
ischeatactive = true;
return ret;
}
PDWORD IDirect3D9_vtable = NULL;
#define CREATEDEVICE_VTI 16
DWORD VTable[4] = { 0 };
DWORD D3DEndScene;
DWORD D3DReset;
tReset oReset;
tEndScene oPresent;
tEndScene oEndScene;
WNDPROC oWndProc;
static int myfpslimit = 60;
static bool isfpslimit = false;
static bool sendHooked = false;
static bool reset = false;
static bool itsMe = false;
LPDIRECT3DVERTEXBUFFER9 g_pVB = NULL;
LPDIRECT3DINDEXBUFFER9 g_pIB = NULL;
HWND window = 0;
NOTIFYICONDATA nid;
bool hiddenWindow = false;
bool isF12Pressed = false;
LRESULT __stdcall WndProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
switch (uMsg)
{
case WM_APP + 1:
switch (lParam)
{
case WM_LBUTTONDBLCLK:
if (Engine) {
if (!IsWindowVisible(window)) {
ShowWindow(window, SW_SHOW);
hiddenWindow = false;
}
}
break;
}
break;
}
return CallWindowProc(oWndProc, hWnd, uMsg, wParam, lParam);
}
HRESULT WINAPI hkReset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS* Present)
{
// EKRAN SIFIRLANDIĞINDA FONTU TEMİZLE (Çökmeyi Önler)
if (g_pFontFPS) { g_pFontFPS->Release(); g_pFontFPS = NULL; }
if (!Engine) return oReset(pDevice, Present);
if (Engine->m_SettingsMgr == NULL)
Engine->m_SettingsMgr = new CSettingsManager();
Present->Windowed = Engine->m_SettingsMgr->m_iRealFullScreen == 1 ? false : true;
Present->PresentationInterval = Engine->m_SettingsMgr->m_iVsync == 1 ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE;
if (Engine->m_SettingsMgr->m_iVsync == 1)
Present->FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
reset = true;
return oReset(pDevice, Present);
}
extern CSpell* GetSkillBase(int iSkillID);
DWORD adresdd = 0x33C;
ULONGLONG thtime = GetTickCount64();
HRESULT WINAPI hkEndScene(LPDIRECT3DDEVICE9 pDevice)
{
if (!Engine) return oEndScene(pDevice);
if (!Engine->render || !Engine->power) return oEndScene(pDevice);
if (GetAsyncKeyState(VK_F12) & 0x8000)
{
if (!isF12Pressed)
{
isF12Pressed = true;
if (GetForegroundWindow() == window) {
ShowWindow(window, false);
hiddenWindow = true;
}
}
}
else
{
isF12Pressed = false;
}
if (!sendHooked)
{
sendHooked = true;
Engine->m_UiMgr = new CUIManager();
Engine->m_UiMgr->Init(pDevice);
Engine->InitSendHook();
Engine->InitRecvHook();
Engine->InitSetString();
for (uint32 i = 101001; i <= 610159; i++)
{
CSpell* spell = GetSkillBase(i);
if (spell) {
Engine->skillmap.insert({ spell->dwID, *spell });
SpellCRC crc(crc32((uint8*)(DWORD)spell, 0xA8, -1), crc32((uint8*)((DWORD)spell + 0xB4), 0x2C, -1));
Engine->skillcrc.insert({ spell->dwID + 2031, crc });
Engine->skillmapBackup.insert({ spell->dwID, *spell });
}
}
}
if (reset)
{
reset = false;
if (Engine->uiTaskbarMain) Engine->uiTaskbarMain->UpdatePosition();
}
// YÜKLEME EKRANINI VE ÇİZİM OLMAYAN MODLARI ATLA
if (!Engine->drawMode || Engine->Loading == true)
return oEndScene(pDevice);
// ---> SADECE OYUN İÇİNDE ÇİZDİRME KONTROLÜ (LOGIN HARİÇ) <---
// NOT: Aşağıdaki true değerini kendi dosyanızdaki InGame (oyunda olma) koşulu ile değiştirin.
// Örnek: bool isKarakterOyunda = (Engine->m_iZone > 0);
// Yeni Hali: (Karakter objesi bellekte oluştuysa FPS çizilir)
bool isKarakterOyunda = (Engine->m_PlayerBase != NULL);
if (isKarakterOyunda)
{
// --- FPS HESAPLAMA VE ÇİZİM BAŞLANGIÇ ---
DWORD dwCurrentTime = GetTickCount();
g_iFrameCount++;
if (dwCurrentTime - g_dwLastFPSTime >= 1000)
{
g_fFPS = (float)g_iFrameCount / ((dwCurrentTime - g_dwLastFPSTime) / 1000.0f);
g_dwLastFPSTime = dwCurrentTime;
g_iFrameCount = 0;
}
if (g_pFontFPS == NULL && pDevice != NULL)
{
D3DXCreateFontA(pDevice, 15, 0, FW_BOLD, 1, FALSE, DEFAULT_CHARSET,
OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial", &g_pFontFPS);
}
if (g_pFontFPS)
{
char szFPS[32];
sprintf_s(szFPS, "FPS: %.0f", g_fFPS);
// Konum Değerleri
int xPos = 329;
int yPos = 25;
int bgWidth = 65;
int bgHeight = 18;
// 1. GARANTİLİ SİYAH ARKA PLAN ÇİZİMİ
D3DRECT rect = { xPos, yPos, xPos + bgWidth, yPos + bgHeight };
pDevice->Clear(1, &rect, D3DCLEAR_TARGET, D3DCOLOR_ARGB(255, 0, 0, 0), 0, 0);
// 2. FPS YAZISI ÇİZİMİ
RECT rcFPS = { xPos + 5, yPos + 1, xPos + bgWidth, yPos + bgHeight };
g_pFontFPS->DrawTextA(NULL, szFPS, -1, &rcFPS, DT_NOCLIP, D3DCOLOR_ARGB(255, 0, 255, 0));
}
// --- FPS HESAPLAMA VE ÇİZİM BİTİŞ ---
}
if (Engine->uiLogin == NULL)
{
Engine->uiLogin = new CUILogin();
if (Engine->uiLogin->m_bGroupLogin == NULL)
Engine->uiLogin = NULL;
}
if (Engine->uiAnvil) Engine->uiAnvil->Tick();
if (Engine->uiSeedHelperPlug) Engine->uiSeedHelperPlug->Tick();
if (Engine->uiState) Engine->uiState->Tick();
if (Engine->uiTradePrice) Engine->uiTradePrice->Tick();
if (Engine->uiSkillPage) Engine->uiSkillPage->Tick();
if (Engine->uiScoreBoard) Engine->uiScoreBoard->Tick();
if (Engine->m_UiMgr) {
Engine->m_UiMgr->Tick();
Engine->m_UiMgr->Render();
}
if (Engine->uiLottery) Engine->uiLottery->Tick();
if (Engine->uiCindirella) Engine->uiCindirella->Tick();
if (Engine->uiHPBarPlug) Engine->uiHPBarPlug->Tick();
if (Engine->uiWheel) Engine->uiWheel->Tick();
if (Engine->IsCRActive && Engine->uiCollection)
Engine->uiCollection->Tick();
if (Engine->AutoUpThread) ResumeThread(Engine->AutoUpThread);
ULONGLONG currentTime = GetTickCount64();
if (currentTime > thtime) {
if (Engine->MainThread) ResumeThread(Engine->MainThread);
if (Engine->AliveThread) ResumeThread(Engine->AliveThread);
if (Engine->ScanThread) ResumeThread(Engine->ScanThread);
if (Engine->TitleThread) ResumeThread(Engine->TitleThread);
if (Engine->LisansThread) ResumeThread(Engine->LisansThread);
if (Engine->ClassThread) ResumeThread(Engine->ClassThread);
thtime = currentTime + 1000;
}
if (Engine->uiEventShowList) Engine->uiEventShowList->Tick();
if (Engine->uiQuestPage) Engine->uiQuestPage->Tick();
if (Engine->uiGenieMain) Engine->uiGenieMain->Tick();
return oEndScene(pDevice);
}
LRESULT CALLBACK MsgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
void DX_Init(DWORD* table)
{
WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, xorstr("DX"), NULL };
RegisterClassEx(&wc);
HWND hWnd = CreateWindow(xorstr("DX"), NULL, WS_OVERLAPPEDWINDOW, 100, 100, 300, 300, GetDesktopWindow(), NULL, wc.hInstance, NULL);
LPDIRECT3D9 pD3D = Direct3DCreate9(D3D_SDK_VERSION);
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.Windowed = TRUE;
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
LPDIRECT3DDEVICE9 pd3dDevice;
itsMe = true;
pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED, &d3dpp, &pd3dDevice);
itsMe = false;
DWORD* pVTable = (DWORD*)pd3dDevice;
pVTable = (DWORD*)pVTable[0];
table[FOX] = pVTable[17];
table[ES] = pVTable[42];
table[DIP] = pVTable[82];
table[RES] = pVTable[16];
D3D_RELEASE(pd3dDevice);
D3D_RELEASE(pD3D);
DestroyWindow(hWnd);
}
DWORD FindDevice(DWORD Len)
{
DWORD dwObjBase = 0;
dwObjBase = (DWORD)LoadLibraryA("d3d9.dll");
while (dwObjBase++ < dwObjBase + Len)
if ((*(WORD*)(dwObjBase + 0x00)) == 0x06C7 && (*(WORD*)(dwObjBase + 0x06)) == 0x8689 && (*(WORD*)(dwObjBase + 0x0C)) == 0x8689) {
dwObjBase += 2; break;
}
return(dwObjBase);
}
DWORD GetDeviceAddress(int VTableIndex)
{
PDWORD VTableBase;
*(DWORD*)&VTableBase = *(DWORD*)FindDevice(0x128000);
return VTableBase[VTableIndex];
}
DWORD WINAPI InitGUI()
{
while (GetModuleHandle(xorstr("d3d9.dll")) == NULL)
{
Sleep(250);
}
DX_Init(VTable);
HOOK(EndScene, VTable[ES]);
HOOK(Reset, VTable[RES]);
char buff[50];
ZeroMemory(buff, 50);
sprintf_s(buff, "BUHUR 2369 Client[%d]", GetCurrentProcessId());
oSetScissorRect = (tSetScissorRect)DetourFunction((PBYTE)GetDeviceAddress(59), (PBYTE)SetScissorRect);
window = NULL;
while (window == NULL) {
Sleep(100);
window = FindWindowA(NULL, buff);
}
oWndProc = (WNDPROC)SetWindowLongPtr(window, GWL_WNDPROC, (LONG_PTR)WndProc);
std::memset(&nid, 0, sizeof(nid));
nid.cbSize = sizeof(nid);
nid.hWnd = window;
nid.uID = 0;
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage = WM_APP + 1;
nid.hIcon = LoadIcon(GetModuleHandle("BuhuR.dll"), MAKEINTRESOURCE(IDI_ICON1));
lstrcpy(nid.szTip, buff);
Shell_NotifyIcon(NIM_ADD, &nid);
Shell_NotifyIcon(NIM_SETVERSION, &nid);
return 0;
}
void UIMain()
{
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)InitGUI, NULL, NULL, NULL);
}
BYTE ByteExt(DWORD ulBase)
{
if (!IsBadReadPtr((VOID*)ulBase, sizeof(BYTE)))
{
return(*(BYTE*)(ulBase));
}
return 0;
}
const DWORD KO_MULTI_CAP = 0xC93EBC;
const DWORD KO_MUTEX = 0xA99F11;
DWORD WINAPI MultiPatch()
{
char buff[50];
sprintf_s(buff, "Buhur 2369 Client[%d]", GetCurrentProcessId());
memcpy((LPVOID)KO_MULTI_CAP, buff, 50);
return 1;
}
void PatchMulti()
{
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)MultiPatch, NULL, NULL, NULL);
}
HRESULT WINAPI HookCreateDevice()
{
IDirect3D9* device = Direct3DCreate9(D3D_SDK_VERSION);
if (!device)
return D3DERR_INVALIDCALL;
IDirect3D9_vtable = (DWORD*)*(DWORD*)device;
device->Release();
DWORD protectFlag;
if (VirtualProtect(&IDirect3D9_vtable[CREATEDEVICE_VTI], sizeof(DWORD), PAGE_READWRITE, &protectFlag))
{
*(DWORD*)&D3DCreateDevice_orig = IDirect3D9_vtable[CREATEDEVICE_VTI];
*(DWORD*)&IDirect3D9_vtable[CREATEDEVICE_VTI] = (DWORD)D3DCreateDevice_hook;
if (!VirtualProtect(&IDirect3D9_vtable[CREATEDEVICE_VTI], sizeof(DWORD), protectFlag, &protectFlag))
{
return D3DERR_INVALIDCALL;
}
}
else
return D3DERR_INVALIDCALL;
return D3D_OK;
}
HRESULT WINAPI D3DCreateDevice_hook(IDirect3D9* Direct3D_Object, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface)
{
if (!itsMe)
{
if (Engine && Engine->m_SettingsMgr == NULL)
Engine->m_SettingsMgr = new CSettingsManager();
if (Engine && Engine->m_SettingsMgr) {
pPresentationParameters->Windowed = Engine->m_SettingsMgr->m_iRealFullScreen == 1 ? false : true;
pPresentationParameters->PresentationInterval = Engine->m_SettingsMgr->m_iVsync == 1 ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE;
if (Engine->m_SettingsMgr->m_iVsync == 1)
pPresentationParameters->FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
}
}
return D3DCreateDevice_orig(Direct3D_Object, Adapter, DeviceType, hFocusWindow, BehaviorFlags | D3DCREATE_MULTITHREADED, pPresentationParameters, ppReturnedDeviceInterface);
}
DeafSoft projesinde yok knka2369 projelerde zaten var
ekli ise ben keşfedemedim.2369 projelerde zaten var
uif lik bir durum yok direk çalıştırıyorEline saglık teşekkür ederiz
Gönderi otomatik olarak birleştirildi:
ui de yapcaagımız bişi yok demi sadece direk eklersek çalışır yani
ms de eklersek cok iyi olur aslında onuda yapayzekadan yapılır heralde paylaştıgın için teşekkür ederizuif lik bir durum yok direk çalıştırıyor
bence çalışır. yapay zekaya PearlGui.h kodlarını at ona göre bir düzenleme yaparusta bu 2383 e oluyor mu
Oluyor aynı şekil kopyala çalışırusta bu 2383 e oluyor mu
// Yeni Hali: (Karakter objesi bellekte oluştuysa FPS çizilir) bool isKarakterOyunda = (Engine->m_PlayerBase != NULL); if (isKarakterOyunda)jr falan basmıyor bunu ekleyince sorun var kodda
oo pig bile eklemişsin2369 dan kaynaklı sıfırdan yazdım uyguladım eline saglık senden baka baka yaptm zaten 2383 e
Ekli dosyayı görüntüle 17355
valal yalanmı dogrumu bilmiyorm local suan test edecemoo pig bile eklemişsinMS de ekle
kodları paylaş kralvalal yalanmı dogrumu bilmiyorm local suan test edecem
Eski ben biliyorsun bana wp engelle neden ne olduvalal yalanmı dogrumu bilmiyorm local suan test edecem