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!

Gunz MRS Unpacker Source

Joined
Sep 10, 2007
Messages
970
Reaction score
815
Wizkid is an idiot. This does not include my signature scanner library. This unpacks every file, not just XMLs like Peter's shenanigans.

Code:
#include <windows.h>
#include <stdio.h>

#include "Detour/CDetour.h"

void create_subdirs (const char *path) {

  char *work = strdup(path), *ptr;

  for (ptr = work; *ptr; ++ ptr)
    if (*ptr == '\\') {
      *ptr = 0;
      printf("subdir: [%s]\n", work);
	  CreateDirectory (work,NULL);
      *ptr = '\\';
    }

  free(work);

}

CDetour MZFile__ReadDet;
void __stdcall MZFile__ReadHook (int i, void *lpBuffer, int nSize)
{
	printf ("Hook?\n");
	char *lpFile;
	_asm mov lpFile, esi
	printf ("[I=%i] MZFile::Read [%s][\n", i, lpFile);
	char szPath[256];
	sprintf(szPath,"MRS\\%s", lpFile);
	for(int i =0; i <strlen(szPath); i++)
		if(szPath[i] == '/')
			szPath[i] = '\\';
	
	create_subdirs (szPath);
	MZFile__ReadDet.Org (i, lpBuffer, nSize);
	DWORD dwWrote;
	HANDLE hFile = CreateFile (szPath, GENERIC_WRITE,NULL,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
	WriteFile (hFile, lpBuffer, nSize, &dwWrote, NULL);
	printf("%u]\n", dwWrote);

}

CDetour MZip__ReadFileDet;
void __stdcall MZip__ReadFileHook (const char *szFile, void *lpBuffer, int nSize)
{	
	char szPath[256];
	sprintf(szPath,"MRS\\%s",szFile);
	
	for(int i =0; i <strlen(szPath); i++)
		if(szPath[i] == '/')
			szPath[i] = '\\';

	
	create_subdirs (szPath);
	MZip__ReadFileDet.Org (szFile, lpBuffer, nSize);

	printf ("%s (",szFile);
	DWORD dwWrote;
	HANDLE hFile = CreateFile (szPath, GENERIC_WRITE,NULL,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
	WriteFile (hFile, lpBuffer, nSize, &dwWrote, NULL);
	printf("%u)\n", dwWrote);
	CloseHandle (hFile);
}

void Initialize ()
{
	AllocConsole ( );
	freopen ( "CONOUT$", "wb", stdout );
	printf ("Testing..\n");
	MZip__ReadFileDet.Detour ((PBYTE)0x00538B40, (PBYTE)MZip__ReadFileHook, true);
	MZip__ReadFileDet.Apply ();

	MZFile__ReadDet2.Detour ((PBYTE)0x00538960, (PBYTE)MZFile__ReadHook2, true);
	MZFile__ReadDet2.Apply ();
	AllocConsole ( );
	freopen ( "CONOUT$", "wb", stdout );
	printf ("Detours applied.\n");
}


BOOL APIENTRY DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved )
{
	DisableThreadLibraryCalls ( hModule );
	switch (ul_reason_for_call)
	{
		case DLL_PROCESS_ATTACH:
		{
			Initialize( );
			break;
		}
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
		case DLL_PROCESS_DETACH:
			break;
	}
	return TRUE;
}
 
2D > 3D
Loyal Member
Joined
Dec 19, 2008
Messages
2,413
Reaction score
1,193
omg coolio thanks.

Btw jacob, dont allow idiots to make you release your hard work. If you know you made it, then thats all that matters
 
2D > 3D
Loyal Member
Joined
Dec 19, 2008
Messages
2,413
Reaction score
1,193
It isn't about that. What your saying has nothing to do with what I said. I just where claiming that Wizkid has owned him in the First post of Phail that he where saying 'Wizkid is an idiot. This does not include my signature scanner library. This unpacks every file, not just XMLs like Peter's shenanigans.'

But Wizkid said that he only looked to the XML files. Lol so I don't see a thing why flaming me=( If phails more knows than wizkid about Gunz, idc. Wizkid did much for the Community so please gtfo(A):D

i wasnt flaiming you at all, i was just messing with you and pointing out the fact that he has done hardly anything for gunz in the past. People claim jacob here has stolen work from others and poop, when its been proven that this so called "Dutch Hero" is a leecher himself. Just because phail hacks and develops people decide hes a "bad man", but honestly, developing is hacking itself. Tbh jizzy is probably not a bad guy in real life, and i know jacob isnt, as are we all, but to others (Cough Maiet) we are all viewed as thieves. Its all about point of view. I dont like wizzy jizzy and i dont want people placing jacob on a throne then throwing stones at him, so i say my opinion. Egotistical behavior is in our genetics, but here it seems it takes the best of us all

/Lucas
 
Last edited:
Reverse Engineer
Joined
Mar 19, 2007
Messages
879
Reaction score
37
It's because he now has connections. Anyway it was about time someone got mod anyhow.
 
Skilled Illusionist
Joined
Jan 7, 2009
Messages
339
Reaction score
3
OMg give tutorial how to make it plz >.>'
 
Back
Top