Skip to content

Reactivate Blaze Logs

zeroKilo edited this page May 2, 2018 · 2 revisions

Reactivate Blaze Logs

As in other blaze using games, an internal log of the blaze packets is generated, but the resulting logging function where cut away by the compiler and now only reside as single ret-opcode stubs. In order to reactivate them, you need to detour them, but microsoft's detour library has a problem with such short functions, so here a manual way to detour them:

`

void DetourBlazeLogger(DWORD org, DWORD target)
{
	DWORD old;
	VirtualProtect((LPVOID)org, 6, PAGE_EXECUTE_READWRITE, &old);
	*((BYTE*)org) = 0x68;
	*((DWORD*)(org + 1)) = target;
	*((BYTE*)(org + 5)) = 0xC3;
}`

and an example function to save the log:

`

void BlazeLogger(char* str)
{
	FILE* fp;
	if(isServer)
		fp = fopen ("BlazeLogServer.txt", "a+");
	else
		fp = fopen ("BlazeLog.txt", "a+");
	fprintf(fp, str);
	fclose(fp);
}`

example usage:

DetourBlazeLogger(0xAFFB30, (DWORD)BlazeLogger);

Clone this wiki locally