3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
Hello Today I come to let the source code for 3D camera + mini-maps + sky, where i was working this last time... (that is nothing but a compilation of other sources) + Offsets for main.exe v1.07P+
Nemesis.cpp
Code:
#include <cstdlib>
#include <iostream>
#include "Stdafx.h"
#include "Nemesis.h"
#include "Sky.h"
extern "C" _declspec(dllexport) void Init()
{
DWORD OldProtect;
if(VirtualProtect(LPVOID(0x401000),4310016,PAGE_EXECUTE_READWRITE,&OldProtect))
{
KeyboardSetHook(true);
MouseSetHook(true);
}
else {
MessageBoxA(NULL,"Cannot load Nemesis.dll","Mu Online",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_END){
*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_HOME){
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(TEXT("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) + 6000;
*Camera_ClipY = 2400 + (abs(*Camera_PosZ - 150) * 3) + 4000;
*Camera_GlClip = 3000 + (abs(*Camera_PosZ - 150) * 3) + 1500;
}
}
}
}
return CallNextHookEx(MouseHook, code, wParam, lParam);
}
struct FRGB
{
float r, g, b;
};
AUX_RGBImageRec* blankimage;
AUX_RGBImageRec* images[32][6];
unsigned int textures[32][6];
int skycolordirection;
int DisplayInitialized, MiniMapInitialized;
FRGB skycolor;
typedef int(*TSkyHook)();
TSkyHook SkyHook = (TSkyHook) 0x4A8F9E;
typedef int(*TBlend) (int);
TBlend Blend = (TBlend) 0x626570;
int *MainState = (int*)0x915D44;
int *Map = (int*)0x61E97D; //Mini-Map Main 1.07P+ Research by Nemesis
typedef int(*TUnBlend) ();
TUnBlend UnBlend = (TUnBlend) 0x6264F1;
int Sky = GetPrivateProfileIntA("Nemesis", "Sky", 0, ".\\Nemesis.ini");
int SkyDayNight = GetPrivateProfileIntA("Nemesis", "SkyTimer", 0, ".\\Nemesis.ini");
bool FileExists(char * name)
{
if(CreateFile(name,0,0,0,OPEN_EXISTING,0,0) == INVALID_HANDLE_VALUE)
return false;
return true;
}
void GetCamCoords(double* x_cam, double* y_cam, double* z_cam)
{
double m[16];
glGetDoublev(GL_MODELVIEW_MATRIX, m);
*x_cam = -m[12] * m[0] - m[13] * m[1] - m[14] * m[2];
*y_cam = -m[12] * m[4] - m[13] * m[5] - m[14] * m[6];
*z_cam = -m[12] * m[8] - m[13] * m[9] - m[14] * m[10];
}
void ChangeSky()
{
SYSTEMTIME sm;
GetLocalTime(&sm);
int hourstate = sm.wHour % 2;
float minutestate = (float)sm.wMinute / 60.0f;
if(hourstate == 0)
{
skycolor.r = minutestate;
skycolor.g = minutestate;
skycolor.b = minutestate;
}
else
{
skycolor.r = 1.0f - minutestate;
skycolor.g = 1.0f - minutestate;
skycolor.b = 1.0f - minutestate;
}
}
void CALLBACK SkyTimerProc(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime)
{
ChangeSky();
}
void InitDisplay()
{
SetTimer(FindWindow(TEXT("MU"), NULL),3,60000,(TIMERPROC)
int(Sky));
{
char texturepath[256];
sprintf_s(texturepath,"%s",".\\Data\\Sky\\Null.bmp");
if(!FileExists(texturepath))
{
MessageBox(0,"Cannot find Null.bmp","Error",0);
ExitProcess(0);
}
blankimage = auxDIBImageLoad(texturepath);
try
{
for(int i=0 ; i<30; i++)
{
for(int j=0; j<6; j++)
{
images[i][j] = blankimage;
}
sprintf_s(texturepath,".\\Data\\Sky\\World%d\\Back.bmp",i+1);
if(FileExists(texturepath))
images[i][0] = auxDIBImageLoad(texturepath);
sprintf_s(texturepath,".\\Data\\Sky\\World%d\\Bottom.bmp",i+1);
if(FileExists(texturepath))
images[i][1] = auxDIBImageLoad(texturepath);
sprintf_s(texturepath,".\\Data\\Sky\\World%d\\Front.bmp",i+1);
if(FileExists(texturepath))
images[i][2] = auxDIBImageLoad(texturepath);
sprintf_s(texturepath,".\\Data\\Sky\\World%d\\Left.bmp",i+1);
if(FileExists(texturepath))
images[i][3] = auxDIBImageLoad(texturepath);
sprintf_s(texturepath,".\\Data\\Sky\\World%d\\Right.bmp",i+1);
if(FileExists(texturepath))
images[i][4] = auxDIBImageLoad(texturepath);
sprintf_s(texturepath,".\\Data\\Sky\\World%d\\Top.bmp",i+1);
if(FileExists(texturepath))
images[i][5] = auxDIBImageLoad(texturepath);
}
}
catch(...){}
for(int i=0 ; i<30; i++)
{
for(int j=0; j<6; j++)
{
glGenTextures(1, &textures[i][j]);
glBindTexture(GL_TEXTURE_2D, textures[i][j]);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexImage2D(GL_TEXTURE_2D, 0, 3, images[i][j]->sizeX, images[i][j]->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, images[i][j]->data);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
}
}
skycolor.r = 1.0f;
skycolor.g = 1.0f;
skycolor.b = 1.0f;
if(SkyDayNight)
{
skycolordirection = 1;
SetTimer(FindWindow(TEXT("MU"), NULL),2,5000,(TIMERPROC)SkyTimerProc);
ChangeSky();
}
}
DisplayInitialized = 1;
}
bool CanDrawSky()
{
char texturepath[256];
sprintf_s(texturepath,".\\Data\\Sky\\World%d\\Top.bmp",*Map+1);
if(FileExists(texturepath))
return true;
return false;
}
void Display()
{
SkyHook();
*MainState = 5;
if(*MainState == 5/* && !unhautorized*/)
{
if(!DisplayInitialized)
InitDisplay();
if(Sky && CanDrawSky())
{
double x_cam, y_cam, z_cam;
GetCamCoords(&x_cam,&y_cam,&z_cam);
Blend(1);
glColor3d(skycolor.r,skycolor.g,skycolor.b);
glBindTexture(GL_TEXTURE_2D, textures[*Map][5]);
glBegin(GL_QUADS);
//TOP
glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam-3000, y_cam+3000, 1500);
glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam+3000, y_cam+3000, 1500);
glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam+3000, y_cam-3000, 1500);
glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam-3000, y_cam-3000, 1500);
glEnd();
glBindTexture(GL_TEXTURE_2D, textures[*Map][1]);
glBegin(GL_QUADS);
//BOTTOM
glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam-3000, y_cam+3000, 0);
glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam+3000, y_cam+3000, 0);
glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam+3000, y_cam-3000, 0);
glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam-3000, y_cam-3000, 0);
glEnd();
glBindTexture(GL_TEXTURE_2D, textures[*Map][2]);
glBegin(GL_QUADS);
//FRONT
glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam-3000, y_cam+3000, 1500);
glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam+3000, y_cam+3000, 1500);
glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam+3000, y_cam+3000, 0);
glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam-3000, y_cam+3000, 0);
glEnd();
glBindTexture(GL_TEXTURE_2D, textures[*Map][0]);
glBegin(GL_QUADS);
//BACK
glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam-3000, y_cam-3000, 1500);
glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam+3000, y_cam-3000, 1500);
glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam+3000, y_cam-3000, 0);
glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam-3000, y_cam-3000, 0);
glEnd();
glBindTexture(GL_TEXTURE_2D, textures[*Map][3]);
glBegin(GL_QUADS);
//LEFT
glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam-3000, y_cam-3000, 1500);
glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam-3000, y_cam+3000, 1500);
glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam-3000, y_cam+3000, 0);
glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam-3000, y_cam-3000, 0);
glEnd();
glBindTexture(GL_TEXTURE_2D, textures[*Map][4]);
glBegin(GL_QUADS);
//RIGHT
glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam+3000, y_cam-3000, 1500);
glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam+3000, y_cam+3000, 1500);
glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam+3000, y_cam+3000, 0);
glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam+3000, y_cam-3000, 0);
glEnd();
UnBlend();
}
}
}
void HookExactOffset(DWORD my, DWORD tohook, BYTE type)
{
*(BYTE*)tohook = type;
*(DWORD*)(tohook+1) = my;
}
void HookThis(DWORD dwMyFuncOffset,DWORD dwJmpOffset)
{
*(DWORD*)(dwJmpOffset+1)=dwMyFuncOffset-(dwJmpOffset+5);
}
void ChangePath(const char* Map, ...)
{
memcpy((DWORD*)0x931AF0,Map,17);
HookExactOffset(0x931AF0,0x00711AD5,0x68);
}
void LoadImageJgpForMap(char* ImagePatch, DWORD PrintCode)
{
_asm
{
Mov Edi, 0x006F329E
Push 0x1
Push 0x2900
Push 0x2601
Push 0x7B69
Push 0x931AF0
Call Edi
Add Esp,0x14
}
}
int LoadMap(int Map)
{
char FullMapName[200];
sprintf_s(FullMapName,"World%d\\Map1.jpg",Map+1);
ChangePath(FullMapName);
LoadImageJgpForMap(FullMapName, 0x7B69);
return Map;
}
bool MapChecker1(int Map)
{
if( Map == 0 || Map == 1 || Map == 2 || Map == 3 || Map == 4 || Map == 7 || Map == 8 ||
Map == 10 || Map == 24 || Map == 30 || Map == 33 || Map == 34 || Map == 37 || Map == 38 ||
Map == 41 || Map == 51 || Map == 56 || Map == 57 || Map == 63)
{
return 1;
}
return 0;
}
char FullMapName[200];
void MapChecker2(int Map)
{
if( Map == 0 || Map == 1 || Map == 2 || Map == 3 || Map == 4 || Map == 7 || Map == 8 ||
Map == 10 || Map == 24 || Map == 30 || Map == 33 || Map == 34 || Map == 37 || Map == 38 ||
Map == 41 || Map == 51 || Map == 56 || Map == 57 || Map == 63)
{
LoadMap(Map);
_asm
{
MOV EDI, 0x007B61D6
CALL EDI
MOV ECX,EAX
MOV EDI, 0x007B6564
CALL EDI
MOV ECX,EAX
MOV EDI, 0x0070FBCE
CALL EDI
}
Sleep(100);
}
else if( Map == 77 || Map == 78)
{
*(BYTE*)(0x0070FB69) = 0x75;
}
else
{
*(BYTE*)(0x0070FB69) = 0x75;
}
}
void MiniLoad()
{
int Map;
char FullMapName[200];
Map = *(unsigned char*)0x0091A3E4;
if( Map == 0 || Map == 1 || Map == 2 || Map == 3 || Map == 4 || Map == 7 || Map == 8 ||
Map == 10 || Map == 24 || Map == 30 || Map == 33 || Map == 34 || Map == 37 || Map == 38 ||
Map == 41 || Map == 51 || Map == 56 || Map == 57 || Map == 63)
{
sprintf_s(FullMapName,"World%d\\Map1.jpg",Map+1);
*(BYTE*)(0x00707647) = 0xEB;
memcpy((DWORD*)0x91CD90,FullMapName,17);
}
else if( Map == 77 || Map == 78)
{
*(BYTE*)(0x0070FB69) = 0x75;
}
else
{
*(BYTE*)(0x0070FB69) = 0x75;
}
}
void MiniMap()
{
*(BYTE*)(0x007680DD) = 0x90;
*(BYTE*)(0x007680DD+1) = 0x90;
HookThis((DWORD)&MapChecker1, 0x0070FB5A);
HookThis((DWORD)&MapChecker2, 0x0061E97D);
}
Full Source Codes for 3D+Mini-Maps+Sky
PS: That person and / or people who want to contribute to this source, are free to set about it, because the truth I'm new to all this Programming Language C++, so it is acceptable that mistakes are...
Credits: FOR ALL MU ONLINE COMMUNITY
DLL Compiled 3D Camera + Mini-Maps + Sky: http://www.multiupload.com/NYXEV2G843
Special Credits to: Sobieh, ZergNM, Leo123, vcorp,MyGSFun, Mulegend, chris05, SirMaster (Old ASM Programmer & A Good Friend)
Re: 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
Credits: vcorp. not all mu online community
Re: 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
drakelv Sorry, I fix it right now ^^, but I let the credits are for any Mu Online community because there are many people who helped me with this.. that are not vcorp.
PS: drakelv: Not if you looked good ... but this is not the same vcorp source code, and that the wording of 3D camera are made by: Sobieh, zergNM & Leo123.
PS: drakelv: If you have time .. and not too much trouble for you .. could you help me test this source code? (Do not want to bother, so if you say you do not have time to understand saber).
Re: 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
All the codes is mess up.
Its good all offsets to be defined in .h file.
And can you upload your main?
Re: 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
Download any main.exe v1.07P+ - 1.07.42 Cracked or crack it you! is easy.. :):
PS: For all those people who do not want to do a research to find all other modifiable offsets this main.exe (modifiable say referring to the routine).. Here I give the load limits Items, texture, Proc Glow's and other things..
Link: Modifications Offsets by Nemesis
PS 2: I'm not a Mu Coder, but I am not a Noob.
Re: 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
Quote:
Originally Posted by
drakelv
Credits: vcorp. not all mu online community
bullshit
vcorp just toke leo idea and write it in 1 dll
leo123 made the first mini map
subish (not sure the name) made the first 3D cam
tnx nemesis for shearing the offsets :D
edit:
just for know what this number means in this line - 4310016 ?
if(VirtualProtect(LPVOID(0x401000),4310016,PAGE_EXECUTE_READWRITE,&OldProtect))
tnx for the answer
Re: 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
These is a part of source (Virtual Protect Default for C++ Dinamic DLL Files), not is a offset value, don't worry!
Re: 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
credit for offsets going to chris05 (he gave u 1 week ago in other topic for main 1.07p)
nemesis.cpp nemesis.h ? haha xD
Re: 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
And add it to chris05 in the credits, so I recommend that you upgrade your browser my friend and you start to read before rebut a topic... :):
PS: if I do not think I've made some small modifications, but are important in order to compile the source code... then please look at this and compare.
A line of source of 3d cam (only) posted by saintus:
Code:
HWND MuWnd = FindWindow("MU", NULL);
My modification of error of compilation:
Code:
HWND MuWnd = FindWindow(TEXT("MU"), NULL);
and so as that there are many more things in the file: Nemesis.cpp :cool:
Re: 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
Sky's is in the past, look, what i have done - YouTube - Mu Online In Game Timer ^_^
Re: 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
Quote:
Originally Posted by
SmallHabit
SmallHabit: Can you help me improve this source code, adding things like increased range of camera 3D vision, style mini-map radar (as ariethmu), smoke effect (no fog), smooth texture, and other things you have demonstrated expertise. :?:
Re: 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
mauro07 you will never be a good coder, if all time will ask for a help... If you have some problems on coding something - ask google.
Re: 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
Quote:
Originally Posted by
SmallHabit
Nice!!!
For Sky + minimap offsets, lean about ASM and debug Main mauro07 ;)
Re: 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
As I can do to find the offsets for the sky in other versions of main.exe?, ie what kind of search should be done when you are trying to establish a relationship between 2 main? that as: Strings ... can not find the same offsets in other main, and not Float. as Hex .. either, as no text. Then someone explain in detail how it is done to find these offsets (step by step)
Re: 3D+Mini-Maps+Sky DLL by Nemesis BETA 0.1
Quote:
Originally Posted by
boncha
bullshit
vcorp just toke leo idea and write it in 1 dll
leo123 made the first mini map
subish (not sure the name) made the first 3D cam
tnx nemesis for shearing the offsets :D
edit:
just for know what this number means in this line - 4310016 ?
if(VirtualProtect(LPVOID(0x401000),4310016,PAGE_EXECUTE_READWRITE,&OldProtect))
tnx for the answer
first minimap was done by sobieh xD, and vcorp continued this development all the time (most succesfuly) and the source is his, dont matter that he uses same idea for 3d and shits.
and 4310016 means end offset for virtualprotect in main.exe