Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 01-21-2011, 05:38 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,450
Default Adding Highpass back to the client (SoD source)

**UPDATE Jan 21, 2011 @ 5:09AM **
- Added support for automatically adding the zone on disconnect.

**Original Post***

See my previous development post on how to make the DLL: http://www.eqemulator.org/forums/showthread.php?t=32909

This adds highpass back to the EQ SoD client. If your server has #zone available, this will work with it, most PEQ Databases already force you to the older one though. If you are smart enough, you can update this to work on P1999. Note that P1999 does NOT support the SoF client, and things are very buggy. SoD does not work period on P1999, this restores missing functionality removed by SOE. This can also be used to add new zones to the client, if you were to tweak it.

Source:

Code:
#include <windows.h>
#include <stdio.h>
#include <string>
#include <CDetour.h>
#pragma comment( lib, "detours.lib" )
class EQWorldData {
public:
};

DWORD LogAddr = 0x006B0BB0;
DWORD WDataAddr = 0x00693E10;
DWORD WDataAddZoneAddr = 0x006939D0;
EQWorldData** pinstWorldData = (EQWorldData**)0x00A425C4;
DWORD DeconstructorAddr = 0x004DAED0;
//CDetour LogDet;
CDetour WDataDet;
bool isWorldDataLoaded = false;
bool AddedZone = false;

void WDataHook() {
	AddedZone = false;
	isWorldDataLoaded = false;
	WDataDet.Org();

}

void WDataCheck()
{ 
	while (1==1)
	{
	while (isWorldDataLoaded==false)
	{

		while (*pinstWorldData == NULL)
		{
			Sleep(1000);
		}
		isWorldDataLoaded = true;
	}
	if(isWorldDataLoaded==true && AddedZone == false)
	{
	((int (__thiscall*) (LPVOID, int, int, const char*, const char*, int, unsigned long, int, int, int)) WDataAddZoneAddr) ((LPVOID)*pinstWorldData, 0 , 5, "highpass", "Highhold Pass", 2247, 7, 0, 0, 0);
	((int (__cdecl*) (const char*, ...)) LogAddr) ("Added Highkeep!");
	AddedZone=true;
	}
	Sleep(1000);
	}
}

/*

void LogHook(const char* two, ...)
{ 

char val[256] = "{0}"; 
HANDLE stdoutthing = GetStdHandle(STD_OUTPUT_HANDLE);
const char* sep = "\n";
unsigned long stufftowrite = 0;
va_list va;
va_start(va, two);
_vsnprintf_s(val, 255, two, va); 
WriteConsoleA(stdoutthing,val, strlen(val), &stufftowrite, 0);
va_end(va);
stufftowrite = 0;
WriteConsoleA(stdoutthing,sep, strlen(sep), &stufftowrite, 0);
LogDet.Ret(false);
}
*/

int WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID)
{
	if(dwReason == DLL_PROCESS_ATTACH)
	{
		CreateThread(NULL, 0, (unsigned long (__stdcall *)(void *))WDataCheck, NULL, 0, NULL);
		//LogDet.Detour((PBYTE)LogAddr, ( PBYTE )LogHook);
		WDataDet.Detour((PBYTE)DeconstructorAddr, (PBYTE)WDataHook);
		/*if(!AllocConsole())
		{
			return 0;
		}*/
		//SetConsoleTitle(TEXT("Console of the Gods"));
		//LogDet.Apply();
		WDataDet.Apply();
	}
	else if(dwReason == DLL_PROCESS_DETACH)
	{
	//	LogDet.Remove();
	}
	return 1;
}
If you are unable to use the source, I have it here packaged with the injector I use. If it appears as a virus, it's packed, thus resulting in a false positive. The DLL however is not packed. If you feel uncomfortable with DLL injection using this program, I will write my own injector for you all later w/ source included.

Link to download:

http://ilikekitti.es/TestDLL.rar **UPDATED Jan 21 2011 to remove console and add auto-adding the zone**

Link to library needed to compile the DLL (CDetour)

http://ilikekitti.es/CDetour.rar

Screenshot of it working:


Last edited by Secrets; 01-21-2011 at 06:11 AM..
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 08:15 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3