PDA

View Full Version : Adding Highpass back to the client (SoD source)


Secrets
01-21-2011, 05:38 AM
**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:

#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:

http://ilikekitti.es/highpass.png