Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Development] MiniMap Source Code (2016) to: 1.04.04 GMO

Joined
Oct 29, 2007
Messages
1,289
Reaction score
1,308
Well I must create a new Thread, because.. on: bet0x thread.. I make spam :p: (Sorry for this bro).. then here I leave a new & complete MiniMap Source Code (to client side), with offsets/information registers and etc to: 1.04.04 GMO (as I say on the thread title).

MiniMap.cpp file:
Code:
#include "stdafx.h"
#include "MiniMap.h"
#include "TMemory.h"
#include "Interface.h"

[COLOR=#b22222][B]// Buffers -> Using this method.. is not necesary mov esi, 0x00XXX or: mov edi, //0x00XX and prevents.. possible problems with information registers

[/B][/COLOR]
[COLOR=#b22222][B]DWORD LoadImg1	= 0x007721E0;[/B][/COLOR]
[COLOR=#b22222][B]DWORD LoadMap1	= 0x00860FC0;[/B][/COLOR]
[COLOR=#b22222][B]DWORD LoadMap2	= 0x008615F0;[/B][/COLOR]
[COLOR=#b22222][B]DWORD LoadMap3	= 0x00886C20;[/B][/COLOR]
[COLOR=#b22222][B]DWORD LoadMap4	= 0x004E65C0;[/B][/COLOR]


MiniMap		gMiniMap; [COLOR=#ffa07a]//Small MiniMap Class Initialization (Only for: Hook Main Function)[/COLOR]


bool IsValidMap(int MapId)
{
	char FullMapName[200];
	sprintf_s(FullMapName, "World%d\\Map1.jpg", MapId + 1);


	struct stat buffer;


	if (stat(FullMapName, &buffer)) [COLOR=#40e0d0]// -> On this way Minimap not have crashs on Event Maps... xD[/COLOR]
	{
		switch (MapId)
		{
		case 0: return true;//Lorencia
		case 1: return true;//Dungeon
		case 2: return true;//Devias
		case 3: return true;//Noria
		case 4: return true;//LostTower
		case 6: return true;//Stadium
		case 7: return true;//Atlans
		case 8: return true;//Tarkan
		case 10: return true;//Icarus
		case 24: return true;//Kalima 1
		case 25: return true;//Kalima 2
		case 26: return true;//Kalima 3
		case 27: return true;//Kalima 4
		case 28: return true;//Kalima 5
		case 29: return true;//Kalima 6
		case 30: return true;//Valley of Loren
		case 31: return true;//Land of Trials
		case 33: return true;//Aida
		case 34: return true;//Crywolf
		case 36: return true;//Kanturu 1
		case 37: return true;//Kanturu 2
		case 38: return true;//Kanturu 3
		case 42: return true;//Barracks
		case 51: return true;//Elbeland
		case 56: return true;//Swamp of Calmness
		case 57: return true;//Raklion
		case 58: return true;//Raklion Boss
		case 63: return true;//Vulcanus
		case 80: return true;//Kalrutan 1
		case 81: return true;//Kalrutan 2


		// Invalid MiniMap
		default: return false;
		}
	}
	return false;
}


void LoadImageJpgForMap(char* ImagePatch, DWORD PrintCode)
{
	_asm
	{
		PUSH 0
		PUSH 1
		PUSH 0x2900
		PUSH 0x2601
		PUSH 0x7B7A
		PUSH ImagePatch
		CALL LoadImg1 [COLOR=#ff8c00]// -> Here is not used: mov edi and anothers bad instructions to memory is only direct CALL to Main Offset[/COLOR] :D:
		ADD ESP,0x18
	}
}


int LoadMap(int Map)
{
	char FullMapName[200];
	sprintf(FullMapName, "World%d\\Map1.jpg", Map + 1);
	ChangePath(FullMapName);
	LoadImageJpgForMap(FullMapName, 0x7B7A);
	return Map;
}


void ChangePath(const char* Map)
{
	memset((DWORD*)0xD4A654, 0, 19);
	memcpy((DWORD*)0xD4A654, Map, 17);
}


bool MapCheckerCore1(int Map)
{
	if (IsValidMap(Map))
	{
		return 1;
	}
	return 0;
}


void MapCheckerCore2(int Map)
{
	if (IsValidMap(Map))
	{
		LoadMap(Map);


		_asm
		{
			CALL LoadMap1
			MOV ECX, EAX
			CALL LoadMap2
			MOV ECX, EAX
			CALL LoadMap3
		}
	}


	_asm
	{
		PUSH Map
		CALL LoadMap4 [COLOR=#ff0000]// -> Here on: 1.04d main.exe is not necesary POP EBP instruction.. I don't know why ^^ I like think that is by call convention type (__cdecl or __stdcall on original main function).[/COLOR]
	}
}


[COLOR=#ff0000]#define oMapCheckerHook1	0x007D3B6D[/COLOR]
[COLOR=#ff0000]#define oMapCheckerHook2	0x00886B87[/COLOR]
[COLOR=#ff0000]#define oMapCheckerHook3	0x0062EB3D[/COLOR]


[B][COLOR=#ee82ee]//--------------------------------------------------------------------------------------------[/COLOR][/B]
[B][COLOR=#ee82ee]// Cool Info ^^[/COLOR][/B]
[B][COLOR=#ee82ee]//--------------------------------------------------------------------------------------------[/COLOR][/B]
[B][COLOR=#ee82ee]#define oMiniMapKeyPushOffset	0x007D3B55	//0x09 = TAB - 0x10 = SHIFT[/COLOR][/B]
[B][COLOR=#ee82ee]#define oMiniMapKeyCallOffset	0x007D3B6D	//This call must be hook to MapCheckerCore1 proc[/COLOR][/B]
[B][COLOR=#ee82ee]// -------------------------------------------------------------------------------------------[/COLOR][/B]
[B][COLOR=#ee82ee]#define oScreenMapKeyOffset		0x007D3BA5	//0x09 = TAB - 0x10 = SHIFT[/COLOR][/B]


void [COLOR=#008000]MiniMap::Load()[/COLOR]
{
	[COLOR=#ff0000]SetOp((LPVOID)oMapCheckerHook1, (LPVOID)MapCheckerCore1, ASM::CALL);[/COLOR]
[COLOR=#ff0000]	SetOp((LPVOID)oMapCheckerHook2, (LPVOID)MapCheckerCore1, ASM::CALL);[/COLOR]
[COLOR=#ff0000]	SetOp((LPVOID)oMapCheckerHook3, (LPVOID)MapCheckerCore2, ASM::CALL);[/COLOR]
}

MiniMap.h file:
Code:
#pragma once
// ----------------------------------------------------------------------------------------------


#include "Import.h" [COLOR=#ff0000]// -> This is not necesary.. on my zClient Modified Source I only use this.. to make a small new mod (is TEST) xD[/COLOR]

// ----------------------------------------------------------------------------------------------


int		LoadMap(int Map);
void		LoadImageJpgForMap(char* ImagePath, DWORD PrintCode);
bool		MapCheckerCore1(int Map);
void		MapCheckerCore2(int Map);
void		ChangePath(const char*Map);
bool		IsValidMap(int MapId);


[COLOR=#008000]class MiniMap[/COLOR]
[COLOR=#008000]{[/COLOR]
[COLOR=#008000]public:[/COLOR]
[COLOR=#008000]	void		Load();[/COLOR]
[COLOR=#008000]	// ----[/COLOR]
[COLOR=#008000]}; extern MiniMap gMiniMap;[/COLOR]

PS: Sorry I don't make a external HOOK Function to change MiniMap Key... but if you change this "PUSH 9" offset: #define oMiniMapKeyPushOffset 0x007D3B55,
directly with ollydbg on your main.exe then.. your MINIMAP is SHOW/HIDE
using: Shift Keys (PUSH 10) or you can change too:
oScreenMapKeyPushOffset (is the same), but for this exists a small check
function into the main.. I mean a: "JNZ" instruction.. you must change
this too or your: Screen Map is not Close event using: Shift key xD.

PS 2: And I leave here my cool: "Patch" to any Client: 1.04d version, to
put MiniMaps on every: "WorldXX" Folder.. with every Mini Image
(Remaked from: ScreenMaps TGA and converted to: JPG, have better
quality)..

 
Newbie Spellweaver
Joined
Dec 8, 2013
Messages
7
Reaction score
1
if (stat(FullMapName, &buffer))
Error 1 error C2661: 'stat::stat' : no overloaded function takes 2 argument

Help me !
 
Skilled Illusionist
Joined
Dec 9, 2009
Messages
373
Reaction score
42
I don't know why you have this problem bro, since.. my zMain.exe + my zClient.dll (Modified) works fine.. but I thinks that maybe you don't have on your: "dllmain.cpp" this:

Code:
extern "C" __declspec(dllexport)void Init()
{
	DWORD OldProtect;
    // ----
[COLOR=#ff8c00]    if(VirtualProtect(LPVOID(0x00401000),0x00D21FFF,PAGE_EXECUTE_READWRITE,&OldProtect))[/COLOR]
    {
		#ifdef __NOVUS__
		gCraftSystem.Load();
		#endif
		gConnectEx.Load();
		gController.Load();
		gChatExpanded.Load();
		gItemPrice.Load();
		gItem.Load();
		gResetSystem.Load();
		gProtocol.Load();
		gObjUser.Load();
		gOther.Load();
		gMiniMap.Load();
		gInterface.Load();
		gVisualFix.InitVisualFix();
		g_ItemModel.Load();
		gOffTrade.Init();
		gMonster.Load();
		//gCheatGuard.Load();
		//gSocketItem.Load();
		// -----
		ItemAsmLoad();
		InitRotateDmg();
		gFiltersInit();
		// -----
		#ifdef __RMOS__
		g_ItemRank.Load(); 
		#endif
		[COLOR=#008000]// ----[/COLOR]
[COLOR=#008000]		//char szTemp[256];[/COLOR]
[COLOR=#008000]		//sprintf(szTemp,"OBJECT size is 0x%02X", sizeof(OBJECT));[/COLOR]
[COLOR=#008000]		//MessageBox(HWND_DESKTOP,szTemp,NULL,MB_OK);[/COLOR]
[COLOR=#008000]		// ----[/COLOR]
		LoadLibrary("Item.dll");
		LoadLibrary("Glow.dll");
	}
}
// ----------------------------------------------------------------------------------------------


BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
	switch(dwReason)
	{
	case DLL_PROCESS_DETACH:
		{
			[COLOR=#ff8c00]// --[/COLOR]
		}
		break;
		// --
	case DLL_PROCESS_ATTACH:
		{
			gController.Instance = hModule;
		}
		break;
	}
	// ----
	return true;
}
// ----------------------------------------------------------------------------------------------

PS: VirtualProtect Offset from: 1.04d GMO main.exe (Original, I mean.. is the last main.exe Memory offset for this version)... on this case you are using a custom: "Class" to include MiniMap to source -> "gMiniMap.Load();" but.. is necesary load all memory into the range memory offsets, and you can add on your: "MiniMap.cpp" file this:

nGO4IwX - [Development] MiniMap Source Code (2016) to: 1.04.04 GMO - RaGEZONE Forums


PS 2: Temp fix made by:
psychedelic

PS 3: Since.. this: POP EBP instruction on my: zClient.dll Source.. is make Crash to my 1.04d GMO main.exe.. then I move it.

Hi mauro,

It does not work for me, still have zMain.exe in the process after exit the game, and it takes 50mb of memory :( Adding the POP EBP also cause my main to crash, same as your. Here is my dllmain.cpp:

Code:
extern "C" __declspec(dllexport)void Init()
{
	DWORD OldProtect;
	// ----
    if(VirtualProtect(LPVOID(0x401000),0x00D21FFF,PAGE_EXECUTE_READWRITE,&OldProtect))
    {
#ifdef __NOVUS__
	gCraftSystem.Load();
#endif
	#ifdef __RMOS__
	g_ItemRank.Load(); 
#endif
	gConnectEx.Load();
	gController.Load();
	gChatExpanded.Load();
	gItemPrice.Load();
	gItem.Load();
	gResetSystem.Load();
	gProtocol.Load();
	gCheatGuard.Load();
	gObjUser.Load();
	gOther.Load();
	gInterface.Load();
	gVisualFix.InitVisualFix();
	g_ItemModel.Load();	
	gOffTrade.Init();
	gSocketItem.Load();

// Custom added
	CustomBowsLoad();
	ItemGlowLoad();
	ItemEffectLoad();
	SetSmokeEffectLoad();
	gMiniMap.Load();

// Loading .DLL
	LoadLibrary("ttlci.dll");	
	LoadLibrary("opengl32.dll");
    }
}
 

Attachments

You must be registered for see attachments list
Junior Spellweaver
Joined
Apr 14, 2011
Messages
145
Reaction score
123
here source Sky

.cpp
Code:
#include "StdAfx.h"
#include "SkyBox.h"
#include "ToolKit.h"
#include "Config.h"
struct FRGB
{
	float r, g, b;
};

FRGB skycolor;

unsigned int textures[32][6];

bool DisplayInitialized;

typedef int(*TSkyHook)();
TSkyHook SkyHook = (TSkyHook)0x005B9260;		//1.03k

typedef int(*TBlend) (int);
TBlend Blend = (TBlend)0x00635FD0;		//1.03k

typedef int(*TUnBlend) ();
TUnBlend UnBlend = (TUnBlend)0x00635F50;		//1.03k

int *MainState = (int*)0x00E609E8;			//1.03k
int *Map = (int*)0x00E61E18;			//1.03k

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;
	}
}

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 CALLBACK SkyTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
	ChangeSky();
}

void InitDisplay()
{
	SetTimer(FindWindow(__CustomTitle, NULL), 3, 60000, (TIMERPROC)int(Config.SystemSkyBox));
	{
		char texturepath[256];
		sprintf_s(texturepath, "%s", ".\\Data\\Custom\\Sky\\Null.bmp");

		if (!FileExists(texturepath))
		{
			MessageBox(0, "can't find Sky\Null.bmp", "Erro SkyBox", MB_OK | MB_ICONERROR);
			ExitProcess(0);
		}

		AUX_RGBImageRec* images[32][6];
		AUX_RGBImageRec* 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\\Custom\\Sky\\World%d\\Back.bmp", i + 1);

				if (FileExists(texturepath))
				{
					images[i][0] = auxDIBImageLoad(texturepath);
				}

				sprintf_s(texturepath, ".\\Data\\Custom\\Sky\\World%d\\Bottom.bmp", i + 1);

				if (FileExists(texturepath))
				{
					images[i][1] = auxDIBImageLoad(texturepath);
				}

				sprintf_s(texturepath, ".\\Data\\Custom\\Sky\\World%d\\Front.bmp", i + 1);

				if (FileExists(texturepath))
				{
					images[i][2] = auxDIBImageLoad(texturepath);
				}

				sprintf_s(texturepath, ".\\Data\\Custom\\Sky\\World%d\\Left.bmp", i + 1);

				if (FileExists(texturepath))
				{
					images[i][3] = auxDIBImageLoad(texturepath);
				}

				sprintf_s(texturepath, ".\\Data\\Custom\\Sky\\World%d\\Right.bmp", i + 1);

				if (FileExists(texturepath))
				{
					images[i][4] = auxDIBImageLoad(texturepath);
				}

				sprintf_s(texturepath, ".\\Data\\Custom\\Sky\\World%d\\Top.bmp", i + 1);

				if (FileExists(texturepath))
				{
					images[i][5] = auxDIBImageLoad(texturepath);
				}
			}
		}
		catch (...)
		{
			/* NOPE */
		}

		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 (Config.SystemDayNight)
		{
			SetTimer(FindWindow(__CustomTitle, NULL), 2, 5000, (TIMERPROC)SkyTimerProc);

			ChangeSky();
		}
	}

	DisplayInitialized = true;
}

bool CanDrawSky()
{
	char texturepath[64];
	sprintf_s(texturepath, ".\\Data\\Custom\\Sky\\World%d\\Top.bmp", *Map + 1);

	if (FileExists(texturepath))
	{
		return true;
	}

	return false;
}

void Display()
{
	SkyHook();

	*MainState = 5;

	if (*MainState == 5)
	{
		if (!DisplayInitialized)
		{
			InitDisplay();
		}

		if (Config.SystemSkyBox && 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 - 2300, y_cam + 2300, 1500);
			glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam + 2300, y_cam + 2300, 1500);
			glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam + 2300, y_cam - 2300, 1500);
			glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam - 2300, y_cam - 2300, 1500);
			glEnd();

			glBindTexture(GL_TEXTURE_2D, textures[*Map][1]);
			glBegin(GL_QUADS);

			//BOTTOM
			glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam - 2300, y_cam + 2300, 0);
			glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam + 2300, y_cam + 2300, 0);
			glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam + 2300, y_cam - 2300, 0);
			glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam - 2300, y_cam - 2300, 0);
			glEnd();

			glBindTexture(GL_TEXTURE_2D, textures[*Map][2]);
			glBegin(GL_QUADS);

			//FRONT
			glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam - 2300, y_cam + 2300, 1500);
			glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam + 2300, y_cam + 2300, 1500);
			glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam + 2300, y_cam + 2300, 0);
			glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam - 2300, y_cam + 2300, 0);
			glEnd();

			glBindTexture(GL_TEXTURE_2D, textures[*Map][0]);
			glBegin(GL_QUADS);

			//BACK
			glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam - 2300, y_cam - 2300, 1500);
			glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam + 2300, y_cam - 2300, 1500);
			glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam + 2300, y_cam - 2300, 0);
			glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam - 2300, y_cam - 2300, 0);
			glEnd();

			glBindTexture(GL_TEXTURE_2D, textures[*Map][3]);
			glBegin(GL_QUADS);

			//LEFT
			glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam - 2300, y_cam - 2300, 1500);
			glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam - 2300, y_cam + 2300, 1500);
			glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam - 2300, y_cam + 2300, 0);
			glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam - 2300, y_cam - 2300, 0);
			glEnd();

			glBindTexture(GL_TEXTURE_2D, textures[*Map][4]);
			glBegin(GL_QUADS);

			//RIGHT
			glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam + 2300, y_cam - 2300, 1500);
			glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam + 2300, y_cam + 2300, 1500);
			glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam + 2300, y_cam + 2300, 0);
			glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam + 2300, y_cam - 2300, 0);
			glEnd();

			UnBlend();
		}
	}
}

void HookSky()
{
	DisplayInitialized = false;
	ToolKit.HookOffset((DWORD)&Display, 0x4D9AB7, 0xE8); //1.03k
}

.h
Code:
#ifndef _SkyBox_H
#define _SkyBox_H

#include "StdAfx.h"

#include <gl\gl.h>
#include <gl\glu.h>
#include <tlhelp32.h>

#pragma comment(lib,"OpenGL32.lib")
#pragma comment(lib,"GLu32.lib")
#pragma comment(lib,"GLaux.lib")
#pragma comment(lib,"ADVAPI32.lib")
#pragma comment(lib,"Gdi32.lib")
#pragma comment(lib,"winmm.lib") 
#pragma comment(lib,"User32.lib")

void HookSky();

#endif

dllmain.cpp
Code:
HookSky();

someone have offset mapcheck(fog) main 1.04D?
 
Newbie Spellweaver
Joined
Apr 4, 2015
Messages
45
Reaction score
59
here source Sky

.cpp
Code:
#include "StdAfx.h"
#include "SkyBox.h"
#include "ToolKit.h"
#include "Config.h"
struct FRGB
{
    float r, g, b;
};

FRGB skycolor;

unsigned int textures[32][6];

bool DisplayInitialized;

typedef int(*TSkyHook)();
TSkyHook SkyHook = (TSkyHook)0x005B9260;        //1.03k

typedef int(*TBlend) (int);
TBlend Blend = (TBlend)0x00635FD0;        //1.03k

typedef int(*TUnBlend) ();
TUnBlend UnBlend = (TUnBlend)0x00635F50;        //1.03k

int *MainState = (int*)0x00E609E8;            //1.03k
int *Map = (int*)0x00E61E18;            //1.03k

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;
    }
}

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 CALLBACK SkyTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
    ChangeSky();
}

void InitDisplay()
{
    SetTimer(FindWindow(__CustomTitle, NULL), 3, 60000, (TIMERPROC)int(Config.SystemSkyBox));
    {
        char texturepath[256];
        sprintf_s(texturepath, "%s", ".\\Data\\Custom\\Sky\\Null.bmp");

        if (!FileExists(texturepath))
        {
            MessageBox(0, "can't find Sky\Null.bmp", "Erro SkyBox", MB_OK | MB_ICONERROR);
            ExitProcess(0);
        }

        AUX_RGBImageRec* images[32][6];
        AUX_RGBImageRec* 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\\Custom\\Sky\\World%d\\Back.bmp", i + 1);

                if (FileExists(texturepath))
                {
                    images[i][0] = auxDIBImageLoad(texturepath);
                }

                sprintf_s(texturepath, ".\\Data\\Custom\\Sky\\World%d\\Bottom.bmp", i + 1);

                if (FileExists(texturepath))
                {
                    images[i][1] = auxDIBImageLoad(texturepath);
                }

                sprintf_s(texturepath, ".\\Data\\Custom\\Sky\\World%d\\Front.bmp", i + 1);

                if (FileExists(texturepath))
                {
                    images[i][2] = auxDIBImageLoad(texturepath);
                }

                sprintf_s(texturepath, ".\\Data\\Custom\\Sky\\World%d\\Left.bmp", i + 1);

                if (FileExists(texturepath))
                {
                    images[i][3] = auxDIBImageLoad(texturepath);
                }

                sprintf_s(texturepath, ".\\Data\\Custom\\Sky\\World%d\\Right.bmp", i + 1);

                if (FileExists(texturepath))
                {
                    images[i][4] = auxDIBImageLoad(texturepath);
                }

                sprintf_s(texturepath, ".\\Data\\Custom\\Sky\\World%d\\Top.bmp", i + 1);

                if (FileExists(texturepath))
                {
                    images[i][5] = auxDIBImageLoad(texturepath);
                }
            }
        }
        catch (...)
        {
            /* NOPE */
        }

        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 (Config.SystemDayNight)
        {
            SetTimer(FindWindow(__CustomTitle, NULL), 2, 5000, (TIMERPROC)SkyTimerProc);

            ChangeSky();
        }
    }

    DisplayInitialized = true;
}

bool CanDrawSky()
{
    char texturepath[64];
    sprintf_s(texturepath, ".\\Data\\Custom\\Sky\\World%d\\Top.bmp", *Map + 1);

    if (FileExists(texturepath))
    {
        return true;
    }

    return false;
}

void Display()
{
    SkyHook();

    *MainState = 5;

    if (*MainState == 5)
    {
        if (!DisplayInitialized)
        {
            InitDisplay();
        }

        if (Config.SystemSkyBox && 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 - 2300, y_cam + 2300, 1500);
            glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam + 2300, y_cam + 2300, 1500);
            glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam + 2300, y_cam - 2300, 1500);
            glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam - 2300, y_cam - 2300, 1500);
            glEnd();

            glBindTexture(GL_TEXTURE_2D, textures[*Map][1]);
            glBegin(GL_QUADS);

            //BOTTOM
            glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam - 2300, y_cam + 2300, 0);
            glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam + 2300, y_cam + 2300, 0);
            glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam + 2300, y_cam - 2300, 0);
            glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam - 2300, y_cam - 2300, 0);
            glEnd();

            glBindTexture(GL_TEXTURE_2D, textures[*Map][2]);
            glBegin(GL_QUADS);

            //FRONT
            glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam - 2300, y_cam + 2300, 1500);
            glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam + 2300, y_cam + 2300, 1500);
            glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam + 2300, y_cam + 2300, 0);
            glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam - 2300, y_cam + 2300, 0);
            glEnd();

            glBindTexture(GL_TEXTURE_2D, textures[*Map][0]);
            glBegin(GL_QUADS);

            //BACK
            glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam - 2300, y_cam - 2300, 1500);
            glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam + 2300, y_cam - 2300, 1500);
            glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam + 2300, y_cam - 2300, 0);
            glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam - 2300, y_cam - 2300, 0);
            glEnd();

            glBindTexture(GL_TEXTURE_2D, textures[*Map][3]);
            glBegin(GL_QUADS);

            //LEFT
            glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam - 2300, y_cam - 2300, 1500);
            glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam - 2300, y_cam + 2300, 1500);
            glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam - 2300, y_cam + 2300, 0);
            glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam - 2300, y_cam - 2300, 0);
            glEnd();

            glBindTexture(GL_TEXTURE_2D, textures[*Map][4]);
            glBegin(GL_QUADS);

            //RIGHT
            glTexCoord2f(0.0f, 1.0f); glVertex3d(x_cam + 2300, y_cam - 2300, 1500);
            glTexCoord2f(1.0f, 1.0f); glVertex3d(x_cam + 2300, y_cam + 2300, 1500);
            glTexCoord2f(1.0f, 0.0f); glVertex3d(x_cam + 2300, y_cam + 2300, 0);
            glTexCoord2f(0.0f, 0.0f); glVertex3d(x_cam + 2300, y_cam - 2300, 0);
            glEnd();

            UnBlend();
        }
    }
}

void HookSky()
{
    DisplayInitialized = false;
    ToolKit.HookOffset((DWORD)&Display, 0x4D9AB7, 0xE8); //1.03k
}

.h
Code:
#ifndef _SkyBox_H
#define _SkyBox_H

#include "StdAfx.h"

#include <gl\gl.h>
#include <gl\glu.h>
#include <tlhelp32.h>

#pragma comment(lib,"OpenGL32.lib")
#pragma comment(lib,"GLu32.lib")
#pragma comment(lib,"GLaux.lib")
#pragma comment(lib,"ADVAPI32.lib")
#pragma comment(lib,"Gdi32.lib")
#pragma comment(lib,"winmm.lib") 
#pragma comment(lib,"User32.lib")

void HookSky();

#endif

dllmain.cpp
Code:
HookSky();

someone have offset mapcheck(fog) main 1.04D?
Need convert .ozj in .jpg and no crash .
 
(づ。◕‿‿◕。)
Loyal Member
Joined
Jun 23, 2014
Messages
1,853
Reaction score
423
Hi mauro,

It does not work for me, still have zMain.exe in the process after exit the game, and it takes 50mb of memory :( Adding the POP EBP also cause my main to crash, same as your. Here is my dllmain.cpp:

Code:
extern "C" __declspec(dllexport)void Init()
{
    DWORD OldProtect;
    // ----
    if(VirtualProtect(LPVOID(0x401000),0x00D21FFF,PAGE_EXECUTE_READWRITE,&OldProtect))
    {
#ifdef __NOVUS__
    gCraftSystem.Load();
#endif
    #ifdef __RMOS__
    g_ItemRank.Load(); 
#endif
    gConnectEx.Load();
    gController.Load();
    gChatExpanded.Load();
    gItemPrice.Load();
    gItem.Load();
    gResetSystem.Load();
    gProtocol.Load();
    gCheatGuard.Load();
    gObjUser.Load();
    gOther.Load();
    gInterface.Load();
    gVisualFix.InitVisualFix();
    g_ItemModel.Load();    
    gOffTrade.Init();
    gSocketItem.Load();

// Custom added
    CustomBowsLoad();
    ItemGlowLoad();
    ItemEffectLoad();
    SetSmokeEffectLoad();
    gMiniMap.Load();

// Loading .DLL
    LoadLibrary("ttlci.dll");    
    LoadLibrary("opengl32.dll");
    }
}
mine works fine adding the POP EBP here

Code:
void MapCheckerCore2(int Map)
{
    if (IsValidMap(Map))
    {
        LoadMap(Map);




        _asm
        {
            CALL LoadMap1
            MOV ECX, EAX
            CALL LoadMap2
            MOV ECX, EAX
            CALL LoadMap3
        }
    }




    _asm
    {
        PUSH Map
        CALL LoadMap4 // -> Here on: 1.04d main.exe is not necesary POP EBP instruction.. I don't know why ^^ I like think that is by call convention type (__cdecl or __stdcall on original main function).
        POP EBP [COLOR=#ff0000]//here is the pop ebp[/COLOR]
    }
}
here is the main im using just in case
mauro07 is there a reason why you are using the glow.dll instead of the ItemModel.z ?
 
Joined
Oct 29, 2007
Messages
1,289
Reaction score
1,308
mine works fine adding the POP EBP here

Code:
void MapCheckerCore2(int Map)
{
    if (IsValidMap(Map))
    {
        LoadMap(Map);




        _asm
        {
            CALL LoadMap1
            MOV ECX, EAX
            CALL LoadMap2
            MOV ECX, EAX
            CALL LoadMap3
        }
    }




    _asm
    {
        PUSH Map
        CALL LoadMap4 // -> Here on: 1.04d main.exe is not necesary POP EBP instruction.. I don't know why ^^ I like think that is by call convention type (__cdecl or __stdcall on original main function).
        POP EBP [COLOR=#ff0000]//here is the pop ebp[/COLOR]
    }
}
here is the main im using just in case
@mauro07 is there a reason why you are using the glow.dll instead of the ItemModel.z ?

no.. I am using.. and I don't know for that.. xD I mean, is the same, but now I'm using.. my glow function :D is better using: vec3_t
 
Joined
Oct 29, 2007
Messages
1,289
Reaction score
1,308
I already fixed this problem with MiniMap on 1.04d (that not close process & crash).. I'm searching for a specific source code.. to make a exchange.. I like change main font.. I mean.. by: Tahoma or anothers types.. and with size change from font, option too.. all from a external: .ini file.. I know that some persons here have this source.. send me PM.
 
Experienced Elementalist
Joined
Jul 29, 2012
Messages
286
Reaction score
265
I already fixed this problem with MiniMap on 1.04d (that not close process & crash).. I'm searching for a specific source code.. to make a exchange.. I like change main font.. I mean.. by: Tahoma or anothers types.. and with size change from font, option too.. all from a external: .ini file.. I know that some persons here have this source.. send me PM.
1. hook createfonta
2. redirect it
3. directly write
choose your path!
 
Joined
Oct 29, 2007
Messages
1,289
Reaction score
1,308
1. hook createfonta
2. redirect it
3. directly write
choose your path!

Something like this ?

Code:
#include "StdAfx.h"
#include "Font.h"
#include "Utils.h"
#include "TMemory.h"


Font gFont;


void Font::Load()
{
    SetDword((PVOID)(Offset_CreateFontA1 + 1), (DWORD)&LoadNewFont - (Offset_CreateFontA1 + 5));
    SetDword((PVOID)(Offset_CreateFontA2 + 1), (DWORD)&LoadNewFont - (Offset_CreateFontA2 + 5));
    SetDword((PVOID)(Offset_CreateFontA3 + 1), (DWORD)&LoadNewFont - (Offset_CreateFontA3 + 5));
    SetDword((PVOID)(Offset_CreateFontA4 + 1), (DWORD)&LoadNewFont - (Offset_CreateFontA4 + 5));
    SetDword((PVOID)(Offset_CreateFontA5 + 1), (DWORD)&LoadNewFont - (Offset_CreateFontA5 + 5));


    SetByte((PVOID)Offset_CreateFontA1, ASM::CALL);
    SetByte((PVOID)Offset_CreateFontA2, ASM::CALL);
    SetByte((PVOID)Offset_CreateFontA3, ASM::CALL);
    SetByte((PVOID)Offset_CreateFontA4, ASM::CALL);
    SetByte((PVOID)Offset_CreateFontA5, ASM::CALL);


    SetByte((PVOID)(Offset_CreateFontA1 + 5), ASM::NOP);
    SetByte((PVOID)(Offset_CreateFontA2 + 5), ASM::NOP);
    SetByte((PVOID)(Offset_CreateFontA3 + 5), ASM::NOP);
    SetByte((PVOID)(Offset_CreateFontA4 + 5), ASM::NOP);
    SetByte((PVOID)(Offset_CreateFontA5 + 5), ASM::NOP);
}


HFONT LoadNewFont()
{
    char MyFontFaceName[100];
    HFONT MyFont;


    int Bold        = GetPrivateProfileIntA("Font","Bold",0,".\\Core.ini");
    int Height        = GetPrivateProfileIntA("Font","Size",0,".\\Core.ini");
    int Italic        = GetPrivateProfileIntA("Font","Italic",0,".\\Core.ini");
    int Unicode        = GetPrivateProfileIntA("Font","Unicode",0,".\\Core.ini");


    int Quality        = 3;
    int UnderLine    = 0;
    int Width        = 0;
    int StrikeOut    = 0;


    GetPrivateProfileStringA("Font","FontName","Arial",MyFontFaceName,100,".\\Core.ini");


    if (Bold == 0)
    {
        if (Unicode == 1)
        {
            MyFont = CreateFontA(Height, Width, 0, 0, 400, Italic, UnderLine, StrikeOut, 0x01, 0, 0, Quality, 0, MyFontFaceName);
        }
        else
        {
            MyFont = CreateFontA(Height, Width, 0, 0, 400, Italic, UnderLine, StrikeOut, 0x0, 0, 0, Quality, 0, MyFontFaceName);
        }
    }
    else
    {
        if (Unicode == 1)
        {
            MyFont = CreateFontA(Height, Width, 0, 0, 700, Italic, UnderLine, StrikeOut, 0x01, 0, 0, Quality, 0, MyFontFaceName);
        }
        else
        {
            MyFont = CreateFontA(Height, Width, 0, 0, 700, Italic, UnderLine, StrikeOut, 0x0, 0, 0, Quality, 0, MyFontFaceName);
        }
    }
    return MyFont;
}

PS: Don't work... at least no on: 1.03k JPN main.exe
 
Experienced Elementalist
Joined
Jul 29, 2012
Messages
286
Reaction score
265
Something like this ?

Code:
#include "StdAfx.h"
#include "Font.h"
#include "Utils.h"
#include "TMemory.h"


Font gFont;


void Font::Load()
{
    SetDword((PVOID)(Offset_CreateFontA1 + 1), (DWORD)&LoadNewFont - (Offset_CreateFontA1 + 5));
    SetDword((PVOID)(Offset_CreateFontA2 + 1), (DWORD)&LoadNewFont - (Offset_CreateFontA2 + 5));
    SetDword((PVOID)(Offset_CreateFontA3 + 1), (DWORD)&LoadNewFont - (Offset_CreateFontA3 + 5));
    SetDword((PVOID)(Offset_CreateFontA4 + 1), (DWORD)&LoadNewFont - (Offset_CreateFontA4 + 5));
    SetDword((PVOID)(Offset_CreateFontA5 + 1), (DWORD)&LoadNewFont - (Offset_CreateFontA5 + 5));


    SetByte((PVOID)Offset_CreateFontA1, ASM::CALL);
    SetByte((PVOID)Offset_CreateFontA2, ASM::CALL);
    SetByte((PVOID)Offset_CreateFontA3, ASM::CALL);
    SetByte((PVOID)Offset_CreateFontA4, ASM::CALL);
    SetByte((PVOID)Offset_CreateFontA5, ASM::CALL);


    SetByte((PVOID)(Offset_CreateFontA1 + 5), ASM::NOP);
    SetByte((PVOID)(Offset_CreateFontA2 + 5), ASM::NOP);
    SetByte((PVOID)(Offset_CreateFontA3 + 5), ASM::NOP);
    SetByte((PVOID)(Offset_CreateFontA4 + 5), ASM::NOP);
    SetByte((PVOID)(Offset_CreateFontA5 + 5), ASM::NOP);
}


HFONT LoadNewFont()
{
    char MyFontFaceName[100];
    HFONT MyFont;


    int Bold        = GetPrivateProfileIntA("Font","Bold",0,".\\Core.ini");
    int Height        = GetPrivateProfileIntA("Font","Size",0,".\\Core.ini");
    int Italic        = GetPrivateProfileIntA("Font","Italic",0,".\\Core.ini");
    int Unicode        = GetPrivateProfileIntA("Font","Unicode",0,".\\Core.ini");


    int Quality        = 3;
    int UnderLine    = 0;
    int Width        = 0;
    int StrikeOut    = 0;


    GetPrivateProfileStringA("Font","FontName","Arial",MyFontFaceName,100,".\\Core.ini");


    if (Bold == 0)
    {
        if (Unicode == 1)
        {
            MyFont = CreateFontA(Height, Width, 0, 0, 400, Italic, UnderLine, StrikeOut, 0x01, 0, 0, Quality, 0, MyFontFaceName);
        }
        else
        {
            MyFont = CreateFontA(Height, Width, 0, 0, 400, Italic, UnderLine, StrikeOut, 0x0, 0, 0, Quality, 0, MyFontFaceName);
        }
    }
    else
    {
        if (Unicode == 1)
        {
            MyFont = CreateFontA(Height, Width, 0, 0, 700, Italic, UnderLine, StrikeOut, 0x01, 0, 0, Quality, 0, MyFontFaceName);
        }
        else
        {
            MyFont = CreateFontA(Height, Width, 0, 0, 700, Italic, UnderLine, StrikeOut, 0x0, 0, 0, Quality, 0, MyFontFaceName);
        }
    }
    return MyFont;
}

PS: Don't work... at least no on: 1.03k JPN main.exe
looks fine check address of hooks and if you hooked them all
 
Joined
Oct 29, 2007
Messages
1,289
Reaction score
1,308
you can test it. to change font. just need put the name of font that you want use.

REMOVED

Yeah I know.. this works on: 1.03k JPN.. I have this change made from some time ago.. but since, at least on: 1.03k JPN Text.bmd from client... this create a small visual BUG on: Chaos Machine Head Text when, the Machine It's on State: Stand By... and since.. is not possible modify: Height using this method, equally, thanks Pinkof.

PS: I'm want use a font like this:


Kiosani - [Development] MiniMap Source Code (2016) to: 1.04.04 GMO - RaGEZONE Forums


With the same Size and Font Type.. I think that this Font is called: Gulim I don't sure..
 
Last edited:
Experienced Elementalist
Joined
Aug 14, 2014
Messages
203
Reaction score
176
How to set the transparency only 50 when the load Minimap?
 
Last edited:
(づ。◕‿‿◕。)
Loyal Member
Joined
Jun 23, 2014
Messages
1,853
Reaction score
423
so im trying to add this o muemu s6 1.04E main but it crashes after selecting a character, can anyone tell me if i got the right offsets?

Code:
#include "stdafx.h"
#include "MiniMap.h"
#include "Util.h"
#include <sys\stat.h>


DWORD LoadImg1	= 0x00772330;  ///$ 55             PUSH EBP
DWORD LoadMap1	= 0x00861110;//  /$ 55             PUSH EBP
DWORD LoadMap2	= 0x00861740;  //$ 55             PUSH EBP
DWORD LoadMap3	= 0x00886D70;  //$ 55             PUSH EBP;
DWORD LoadMap4	= 0x004E65C0;




MiniMap		gMiniMap; //Small MiniMap Class Initialization (Only for: Hook Main Function)




bool IsValidMap(int MapId)
{
	char FullMapName[200];
	sprintf_s(FullMapName, "World%d\\Map1.jpg", MapId + 1);




	struct stat buffer;




	if (stat(FullMapName, &buffer)) // -> On this way Minimap not have crashs on Event Maps... xD
	{
		switch (MapId)
		{
		case 0: return true;//Lorencia
		case 1: return true;//Dungeon
		case 2: return true;//Devias
		case 3: return true;//Noria
		case 4: return true;//LostTower
		case 6: return true;//Stadium
		case 7: return true;//Atlans
		case 8: return true;//Tarkan
		case 10: return true;//Icarus
		case 24: return true;//Kalima 1
		case 25: return true;//Kalima 2
		case 26: return true;//Kalima 3
		case 27: return true;//Kalima 4
		case 28: return true;//Kalima 5
		case 29: return true;//Kalima 6
		case 30: return true;//Valley of Loren
		case 31: return true;//Land of Trials
		case 33: return true;//Aida
		case 34: return true;//Crywolf
		case 36: return true;//Kanturu 1
		case 37: return true;//Kanturu 2
		case 38: return true;//Kanturu 3
		case 42: return true;//Barracks
		case 51: return true;//Elbeland
		case 56: return true;//Swamp of Calmness
		case 57: return true;//Raklion
		case 58: return true;//Raklion Boss
		case 63: return true;//Vulcanus
		case 80: return true;//Kalrutan 1
		case 81: return true;//Kalrutan 2




		// Invalid MiniMap
		default: return false;
		}
	}
	return false;
}




void LoadImageJpgForMap(char* ImagePatch, DWORD PrintCode)
{
	_asm
	{
		PUSH 0
		PUSH 1
		PUSH 0x2900
		PUSH 0x2601
		PUSH 0x7B7A
		PUSH ImagePatch
		CALL LoadImg1 // -> Here is not used: mov edi and anothers bad instructions to memory is only direct CALL to Main Offset :D:
		ADD ESP,0x18
	}
}




int LoadMap(int Map)
{
	char FullMapName[200];
	sprintf(FullMapName, "World%d\\Map1.jpg", Map + 1);
	ChangePath(FullMapName);
	LoadImageJpgForMap(FullMapName, 0x7B7A);
	return Map;
}




void ChangePath(const char* Map)
{
	memset((DWORD*)0x00D4A68C, 0, 19);//00D4A68C  57                       W
	memcpy((DWORD*)0x00D4A68C, Map, 17);
}




bool MapCheckerCore1(int Map)
{
	if (IsValidMap(Map))
	{
		return 1;
	}
	return 0;
}




void MapCheckerCore2(int Map)
{
	if (IsValidMap(Map))
	{
		LoadMap(Map);




		_asm
		{
			CALL LoadMap1
			MOV ECX, EAX
			CALL LoadMap2
			MOV ECX, EAX
			CALL LoadMap3
		}
	}




	_asm
	{
		PUSH Map
		CALL LoadMap4 // -> Here on: 1.04d main.exe is not necesary POP EBP instruction.. I don't know why ^^ I like think that is by call convention type (__cdecl or __stdcall on original main function).
		//POP EBP
	}
}




#define oMapCheckerHook1	0x007D3CBD //   . E8 1E74D0FF    CALL main.004DB0E0                       ; \main.004DB0E0
#define oMapCheckerHook2	0x00886CD7  //|. E8 0444C5FF    CALL main.004DB0E0                       ; \main.004DB0E0
#define oMapCheckerHook3	0x0062EB3D




//--------------------------------------------------------------------------------------------
// Cool Info ^^
//--------------------------------------------------------------------------------------------
#define oMiniMapKeyPushOffset	0x007D3CA5   //> 6A 09          PUSH 9                                   ; /Arg1 = 00000009	//0x09 = TAB - 0x10 = SHIFT
#define oMiniMapKeyCallOffset	0x007D3CBD   //. E8 1E74D0FF    CALL main.004DB0E0                       ; \main.004DB0E0
	//This call must be hook to MapCheckerCore1 proc
// -------------------------------------------------------------------------------------------
#define oScreenMapKeyOffset		0x007D3CF5//   > 6A 09          PUSH 9                                   ; /Arg1 = 00000009	//0x09 = TAB - 0x10 = SHIFT




void MiniMap::Load()
{
	SetOp((LPVOID)oMapCheckerHook1, (LPVOID)MapCheckerCore1, ASM::CALL);
	SetOp((LPVOID)oMapCheckerHook2, (LPVOID)MapCheckerCore1, ASM::CALL);
	SetOp((LPVOID)oMapCheckerHook3, (LPVOID)MapCheckerCore2, ASM::CALL);
}
 
Junior Spellweaver
Joined
Feb 10, 2014
Messages
179
Reaction score
9
Hi guys ! Set MiniMap is fine ! But now I have this problem ! When I close the game window then it comes out completely it hangs at "task Manager => Processes" But if I remove the MiniMap then everything is fine! Please tell me how I can fix it? Thanks in advance for the help!
 
Skilled Illusionist
Joined
Mar 27, 2013
Messages
305
Reaction score
9
so im trying to add this o muemu s6 1.04E main but it crashes after selecting a character, can anyone tell me if i got the right offsets?

Code:
#include "stdafx.h"
#include "MiniMap.h"
#include "Util.h"
#include <sys\stat.h>


DWORD LoadImg1    = 0x00772330;  ///$ 55             PUSH EBP
DWORD LoadMap1    = 0x00861110;//  /$ 55             PUSH EBP
DWORD LoadMap2    = 0x00861740;  //$ 55             PUSH EBP
DWORD LoadMap3    = 0x00886D70;  //$ 55             PUSH EBP;
DWORD LoadMap4    = 0x004E65C0;




MiniMap        gMiniMap; //Small MiniMap Class Initialization (Only for: Hook Main Function)




bool IsValidMap(int MapId)
{
    char FullMapName[200];
    sprintf_s(FullMapName, "World%d\\Map1.jpg", MapId + 1);




    struct stat buffer;




    if (stat(FullMapName, &buffer)) // -> On this way Minimap not have crashs on Event Maps... xD
    {
        switch (MapId)
        {
        case 0: return true;//Lorencia
        case 1: return true;//Dungeon
        case 2: return true;//Devias
        case 3: return true;//Noria
        case 4: return true;//LostTower
        case 6: return true;//Stadium
        case 7: return true;//Atlans
        case 8: return true;//Tarkan
        case 10: return true;//Icarus
        case 24: return true;//Kalima 1
        case 25: return true;//Kalima 2
        case 26: return true;//Kalima 3
        case 27: return true;//Kalima 4
        case 28: return true;//Kalima 5
        case 29: return true;//Kalima 6
        case 30: return true;//Valley of Loren
        case 31: return true;//Land of Trials
        case 33: return true;//Aida
        case 34: return true;//Crywolf
        case 36: return true;//Kanturu 1
        case 37: return true;//Kanturu 2
        case 38: return true;//Kanturu 3
        case 42: return true;//Barracks
        case 51: return true;//Elbeland
        case 56: return true;//Swamp of Calmness
        case 57: return true;//Raklion
        case 58: return true;//Raklion Boss
        case 63: return true;//Vulcanus
        case 80: return true;//Kalrutan 1
        case 81: return true;//Kalrutan 2




        // Invalid MiniMap
        default: return false;
        }
    }
    return false;
}




void LoadImageJpgForMap(char* ImagePatch, DWORD PrintCode)
{
    _asm
    {
        PUSH 0
        PUSH 1
        PUSH 0x2900
        PUSH 0x2601
        PUSH 0x7B7A
        PUSH ImagePatch
        CALL LoadImg1 // -> Here is not used: mov edi and anothers bad instructions to memory is only direct CALL to Main Offset :D:
        ADD ESP,0x18
    }
}




int LoadMap(int Map)
{
    char FullMapName[200];
    sprintf(FullMapName, "World%d\\Map1.jpg", Map + 1);
    ChangePath(FullMapName);
    LoadImageJpgForMap(FullMapName, 0x7B7A);
    return Map;
}




void ChangePath(const char* Map)
{
    memset((DWORD*)0x00D4A68C, 0, 19);//00D4A68C  57                       W
    memcpy((DWORD*)0x00D4A68C, Map, 17);
}




bool MapCheckerCore1(int Map)
{
    if (IsValidMap(Map))
    {
        return 1;
    }
    return 0;
}




void MapCheckerCore2(int Map)
{
    if (IsValidMap(Map))
    {
        LoadMap(Map);




        _asm
        {
            CALL LoadMap1
            MOV ECX, EAX
            CALL LoadMap2
            MOV ECX, EAX
            CALL LoadMap3
        }
    }




    _asm
    {
        PUSH Map
        CALL LoadMap4 // -> Here on: 1.04d main.exe is not necesary POP EBP instruction.. I don't know why ^^ I like think that is by call convention type (__cdecl or __stdcall on original main function).
        //POP EBP
    }
}




#define oMapCheckerHook1    0x007D3CBD //   . E8 1E74D0FF    CALL main.004DB0E0                       ; \main.004DB0E0
#define oMapCheckerHook2    0x00886CD7  //|. E8 0444C5FF    CALL main.004DB0E0                       ; \main.004DB0E0
#define oMapCheckerHook3    0x0062EB3D




//--------------------------------------------------------------------------------------------
// Cool Info ^^
//--------------------------------------------------------------------------------------------
#define oMiniMapKeyPushOffset    0x007D3CA5   //> 6A 09          PUSH 9                                   ; /Arg1 = 00000009    //0x09 = TAB - 0x10 = SHIFT
#define oMiniMapKeyCallOffset    0x007D3CBD   //. E8 1E74D0FF    CALL main.004DB0E0                       ; \main.004DB0E0
    //This call must be hook to MapCheckerCore1 proc
// -------------------------------------------------------------------------------------------
#define oScreenMapKeyOffset        0x007D3CF5//   > 6A 09          PUSH 9                                   ; /Arg1 = 00000009    //0x09 = TAB - 0x10 = SHIFT




void MiniMap::Load()
{
    SetOp((LPVOID)oMapCheckerHook1, (LPVOID)MapCheckerCore1, ASM::CALL);
    SetOp((LPVOID)oMapCheckerHook2, (LPVOID)MapCheckerCore1, ASM::CALL);
    SetOp((LPVOID)oMapCheckerHook3, (LPVOID)MapCheckerCore2, ASM::CALL);
}
please share source in main 1.05D EMU SS4 :)
 
Back
Top