All pastes #911140 Raw Edit

Miscellany

public cpp v1 · immutable
·published 2008-02-20 15:02 UTC
rendered paste body
void L2Ex::HookEnterWorld(){	WriteServerHook(CALL,(BYTE *)0x84D222, (DWORD *)EWHandler, 0);}void EWHandler(CCreature *pUser){	pUser->UValidateHenna();	pUser->ShowHTML(L"", L"<html><head><body>hello:<br></body></html>", 0);}void L2Ex::WriteServerHook(BYTE bType, BYTE *pAddress, DWORD *pFunction, BYTE bNops){	int iSizeBuffer = 5 + bNops;	BYTE *bBuffer = new BYTE(iSizeBuffer);	bBuffer[0] = bType;	*(DWORD *)(bBuffer + 1) = (DWORD)pFunction - (DWORD)(pAddress+5);	int i = 5;	while (bNops > 0)	{		bBuffer[i] = NOP;		++i;		--bNops;	}	WriteServerMemory((BYTE *)pAddress, (LPCVOID)&bBuffer, iSizeBuffer);	delete[] bBuffer;}CCreature.h#ifndef _CCREATURE_	#define _CCREATURE_#ifndef _USER_#include "User.h"#endifclass CCreature{public:	CCreature();	void ShowHTML(wchar_t *filename, wchar_t *buffer, int classID)	{		typedef void (__thiscall *_SHOW_HTML)(CCreature *, wchar_t *, wchar_t *, int);		_SHOW_HTML _ShowHTML = (_SHOW_HTML)0x80A060;		_ShowHTML(this, filename, buffer, classID);	}	void UValidateHenna()	{		typedef void (__thiscall *_SHOW_HTML)(CCreature *);		_SHOW_HTML _ShowHTML = (_SHOW_HTML)0x809550;		_ShowHTML(this);	}	~CCreature();};#endif