MinBrack1
20-10-10, 09:49 PM
3D Camera cpp.
#include "Stdafx.h"
#include "3DCamera.h"
extern "C" _declspec(dllexport) void MU()
{
DWORD OldProtect;
if(VirtualProtect(LPVOID(0x401000),4310016,PAGE_EX ECUTE_READWRITE,&OldProtect))
{
KeyboardSetHook(true);
MouseSetHook(true);
}
else {
MessageBoxA(NULL,"Your text here!","MuOnline Season 5",MB_OK);
}
}
int APIENTRY DllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved){
switch(dwReason){
case DLL_PROCESS_DETACH:
KeyboardSetHook(false);
MouseSetHook(false);
break;
}
return true;
}
BOOL KeyboardSetHook(BOOL set_or_remove){
if(set_or_remove == TRUE){
if(KeyboardHook == NULL){
KeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)KeyboardProc, hInstance, GetCurrentThreadId());
if(!KeyboardHook){ return FALSE; }
}
} else {
return UnhookWindowsHookEx(KeyboardHook);
KeyboardHook = NULL;
}
return TRUE;
}
BOOL MouseSetHook(BOOL set_or_remove){
if(set_or_remove == TRUE){
if(MouseHook == NULL){
MouseHook = SetWindowsHookEx(WH_MOUSE, MouseProc, hInstance, GetCurrentThreadId());
if(!MouseHook){ return FALSE; }
}
} else { return UnhookWindowsHookEx(MouseHook); }
return TRUE;
}
LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam){
if(((lParam>>31)&1) && (nCode == HC_ACTION)){
if(wParam == VK_F9){
*Camera_RotY = -48.5;
*Camera_RotZ = -45;
*Camera_PosZ = 150;
*Camera_ClipX = 1190;
*Camera_ClipY = 2400;
*Camera_GlClip = 3000;
*Camera_Zoom = 35;
}
if(wParam == VK_TAB){
if(!InitCamera)
{ InitCamera = true;
} else {
InitCamera = false;
}
}
}
return CallNextHookEx(KeyboardHook, nCode, wParam, lParam);
}
LRESULT CALLBACK MouseProc(int code, WPARAM wParam, LPARAM lParam){
MOUSEHOOKSTRUCTEX* mhs = (MOUSEHOOKSTRUCTEX*)lParam;
HWND MuWnd = FindWindow("MU", NULL);
if(GetForegroundWindow() == MuWnd){
if(InitCamera == true){
Camera.ClipX = *Camera_ClipX;
Camera.ClipY = *Camera_ClipY;
Camera.GlClip = *Camera_GlClip;
Camera.PosZ = *Camera_PosZ;
Camera.RotY = *Camera_RotY;
Camera.RotZ = *Camera_RotZ;
Camera.Zoom = *Camera_Zoom;
}
if(InitCamera == true) {
if(wParam == WM_MBUTTONDOWN){
MoveCamera = true;
}
if(wParam == WM_MBUTTONUP){
MoveCamera = false;
}
if(wParam == WM_MOUSEWHEEL){
int direction = mhs->mouseData;
if(direction > 0){
if(*Camera_Zoom < 60){ *Camera_Zoom += 2; }
}
else if(direction < 0){
if(*Camera_Zoom > 12){ *Camera_Zoom -= 2; }
}
*Camera_ClipX = 1190 + (abs(*Camera_PosZ - 150) * 3) + 3000;
*Camera_ClipY = 2400 + (abs(*Camera_PosZ - 150) * 3) + 3000;
*Camera_GlClip = 3000 + (abs(*Camera_PosZ - 150) * 3) + 1500;
}
else if(wParam == WM_MBUTTONDOWN){
MouseX = mhs->pt.x;
MouseY = mhs->pt.y;
}
else if(wParam == WM_MOUSEMOVE){
if(MoveCamera){
if(MouseX < mhs->pt.x){
*Camera_RotZ += 8;
if (*Camera_RotZ > 315) *Camera_RotZ = -45;
}
else if(MouseX > mhs->pt.x){
*Camera_RotZ -= 8;
if (*Camera_RotZ < -405) *Camera_RotZ = -45;
}
if(MouseY < mhs->pt.y){
if(*Camera_RotY < -45){
*Camera_PosZ -= 44;
*Camera_RotY += (float)2.42;
}
}
else if(MouseY > mhs->pt.y){
if(*Camera_RotY > -90){
*Camera_PosZ += 44;
*Camera_RotY -= (float)2.42;
}
}
MouseX = mhs->pt.x;
MouseY = mhs->pt.y;
*Camera_ClipX = 1190 + (abs(*Camera_PosZ - 150) * 3) + 1500;
*Camera_ClipY = 2400 + (abs(*Camera_PosZ - 150) * 3) + 1500;
*Camera_GlClip = 3000 + (abs(*Camera_PosZ - 150) * 3) + 1500;
}
}
}
}
return CallNextHookEx(MouseHook, code, wParam, lParam);
}3D Camera h.
#pragma once
#include "Stdafx.h"
#pragma data_seg(".SHAREDDATA")
static HHOOK KeyboardHook = NULL;
static HHOOK MouseHook = NULL;
#pragma data_seg()
#pragma comment(linker, "/SECTION:.SHAREDDATA,RWS")
static HINSTANCE hInstance;
bool MoveCamera = false;
bool InitCamera = true;
int MouseX, MouseY;
float *Camera_Zoom = (float*) 0x00509DF8;
float *Camera_RotY = (float*) 0x008E2F80;
float *Camera_RotZ = (float*) 0x004A433A;
float *Camera_PosZ = (float*) 0x0046D01F;
float *Camera_ClipX = (float*) 0x008E2F90;
float *Camera_ClipY = (float*) 0x005C1883;
float *Camera_GlClip = (float*) 0x004B8A67;
struct CameraStruct {
float Zoom;
float RotY;
float RotZ;
float PosZ;
float ClipX;
float ClipY;
float GlClip;
} Camera;
LRESULT CALLBACK KeyboardProc(int, WPARAM, LPARAM);
LRESULT CALLBACK MouseProc(int, WPARAM, LPARAM);
BOOL MouseSetHook(BOOL);
BOOL KeyboardSetHook(BOOL);
Các bạn chú ý phần bôi đậm , thay offset đó cho phù hợp với main của bạn.
hiện nay các bạn chủ yếu dùng main 1.07x và 1.07h
Offset 3d của main 1.07x tôi đã share bên box develop
và đây là offset 3d của main 1.07h:
Camera_Zoom = (float*) 0x61E7F9;
Camera_GlClip = (float*) 0x61E9E4;
Camera_RotY = (float*) 0x8D22CC;
Camera_RotZ = (float*) 0x81772B8;
Camera_PosZ = (float*) 0x8D1350;
Camera_ClipX = (float*) 0x8D2194;
Camera_ClipY = (float*) 0x5C8829;
Credits:
sobieh
Leo123
zergnm [BoR]
Nguồn : ragezone.com
#include "Stdafx.h"
#include "3DCamera.h"
extern "C" _declspec(dllexport) void MU()
{
DWORD OldProtect;
if(VirtualProtect(LPVOID(0x401000),4310016,PAGE_EX ECUTE_READWRITE,&OldProtect))
{
KeyboardSetHook(true);
MouseSetHook(true);
}
else {
MessageBoxA(NULL,"Your text here!","MuOnline Season 5",MB_OK);
}
}
int APIENTRY DllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpReserved){
switch(dwReason){
case DLL_PROCESS_DETACH:
KeyboardSetHook(false);
MouseSetHook(false);
break;
}
return true;
}
BOOL KeyboardSetHook(BOOL set_or_remove){
if(set_or_remove == TRUE){
if(KeyboardHook == NULL){
KeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC)KeyboardProc, hInstance, GetCurrentThreadId());
if(!KeyboardHook){ return FALSE; }
}
} else {
return UnhookWindowsHookEx(KeyboardHook);
KeyboardHook = NULL;
}
return TRUE;
}
BOOL MouseSetHook(BOOL set_or_remove){
if(set_or_remove == TRUE){
if(MouseHook == NULL){
MouseHook = SetWindowsHookEx(WH_MOUSE, MouseProc, hInstance, GetCurrentThreadId());
if(!MouseHook){ return FALSE; }
}
} else { return UnhookWindowsHookEx(MouseHook); }
return TRUE;
}
LRESULT CALLBACK KeyboardProc(int nCode, WPARAM wParam, LPARAM lParam){
if(((lParam>>31)&1) && (nCode == HC_ACTION)){
if(wParam == VK_F9){
*Camera_RotY = -48.5;
*Camera_RotZ = -45;
*Camera_PosZ = 150;
*Camera_ClipX = 1190;
*Camera_ClipY = 2400;
*Camera_GlClip = 3000;
*Camera_Zoom = 35;
}
if(wParam == VK_TAB){
if(!InitCamera)
{ InitCamera = true;
} else {
InitCamera = false;
}
}
}
return CallNextHookEx(KeyboardHook, nCode, wParam, lParam);
}
LRESULT CALLBACK MouseProc(int code, WPARAM wParam, LPARAM lParam){
MOUSEHOOKSTRUCTEX* mhs = (MOUSEHOOKSTRUCTEX*)lParam;
HWND MuWnd = FindWindow("MU", NULL);
if(GetForegroundWindow() == MuWnd){
if(InitCamera == true){
Camera.ClipX = *Camera_ClipX;
Camera.ClipY = *Camera_ClipY;
Camera.GlClip = *Camera_GlClip;
Camera.PosZ = *Camera_PosZ;
Camera.RotY = *Camera_RotY;
Camera.RotZ = *Camera_RotZ;
Camera.Zoom = *Camera_Zoom;
}
if(InitCamera == true) {
if(wParam == WM_MBUTTONDOWN){
MoveCamera = true;
}
if(wParam == WM_MBUTTONUP){
MoveCamera = false;
}
if(wParam == WM_MOUSEWHEEL){
int direction = mhs->mouseData;
if(direction > 0){
if(*Camera_Zoom < 60){ *Camera_Zoom += 2; }
}
else if(direction < 0){
if(*Camera_Zoom > 12){ *Camera_Zoom -= 2; }
}
*Camera_ClipX = 1190 + (abs(*Camera_PosZ - 150) * 3) + 3000;
*Camera_ClipY = 2400 + (abs(*Camera_PosZ - 150) * 3) + 3000;
*Camera_GlClip = 3000 + (abs(*Camera_PosZ - 150) * 3) + 1500;
}
else if(wParam == WM_MBUTTONDOWN){
MouseX = mhs->pt.x;
MouseY = mhs->pt.y;
}
else if(wParam == WM_MOUSEMOVE){
if(MoveCamera){
if(MouseX < mhs->pt.x){
*Camera_RotZ += 8;
if (*Camera_RotZ > 315) *Camera_RotZ = -45;
}
else if(MouseX > mhs->pt.x){
*Camera_RotZ -= 8;
if (*Camera_RotZ < -405) *Camera_RotZ = -45;
}
if(MouseY < mhs->pt.y){
if(*Camera_RotY < -45){
*Camera_PosZ -= 44;
*Camera_RotY += (float)2.42;
}
}
else if(MouseY > mhs->pt.y){
if(*Camera_RotY > -90){
*Camera_PosZ += 44;
*Camera_RotY -= (float)2.42;
}
}
MouseX = mhs->pt.x;
MouseY = mhs->pt.y;
*Camera_ClipX = 1190 + (abs(*Camera_PosZ - 150) * 3) + 1500;
*Camera_ClipY = 2400 + (abs(*Camera_PosZ - 150) * 3) + 1500;
*Camera_GlClip = 3000 + (abs(*Camera_PosZ - 150) * 3) + 1500;
}
}
}
}
return CallNextHookEx(MouseHook, code, wParam, lParam);
}3D Camera h.
#pragma once
#include "Stdafx.h"
#pragma data_seg(".SHAREDDATA")
static HHOOK KeyboardHook = NULL;
static HHOOK MouseHook = NULL;
#pragma data_seg()
#pragma comment(linker, "/SECTION:.SHAREDDATA,RWS")
static HINSTANCE hInstance;
bool MoveCamera = false;
bool InitCamera = true;
int MouseX, MouseY;
float *Camera_Zoom = (float*) 0x00509DF8;
float *Camera_RotY = (float*) 0x008E2F80;
float *Camera_RotZ = (float*) 0x004A433A;
float *Camera_PosZ = (float*) 0x0046D01F;
float *Camera_ClipX = (float*) 0x008E2F90;
float *Camera_ClipY = (float*) 0x005C1883;
float *Camera_GlClip = (float*) 0x004B8A67;
struct CameraStruct {
float Zoom;
float RotY;
float RotZ;
float PosZ;
float ClipX;
float ClipY;
float GlClip;
} Camera;
LRESULT CALLBACK KeyboardProc(int, WPARAM, LPARAM);
LRESULT CALLBACK MouseProc(int, WPARAM, LPARAM);
BOOL MouseSetHook(BOOL);
BOOL KeyboardSetHook(BOOL);
Các bạn chú ý phần bôi đậm , thay offset đó cho phù hợp với main của bạn.
hiện nay các bạn chủ yếu dùng main 1.07x và 1.07h
Offset 3d của main 1.07x tôi đã share bên box develop
và đây là offset 3d của main 1.07h:
Camera_Zoom = (float*) 0x61E7F9;
Camera_GlClip = (float*) 0x61E9E4;
Camera_RotY = (float*) 0x8D22CC;
Camera_RotZ = (float*) 0x81772B8;
Camera_PosZ = (float*) 0x8D1350;
Camera_ClipX = (float*) 0x8D2194;
Camera_ClipY = (float*) 0x5C8829;
Credits:
sobieh
Leo123
zergnm [BoR]
Nguồn : ragezone.com