FindPatterScanner

Posts 1–6 of 6 · Page 1 of 1
FindPatternScanner
What FindPattern do you use the logger?
Code:
DWORD dwSize;
DWORD dwStartAddress;

BOOL bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
{
	for (; *szMask; ++szMask, ++pData, ++bMask)
	{
		if (*szMask == 'x' && *pData != *bMask)
			return 0;
	}
	return (*szMask) == NULL;
}
DWORD FindPattern(BYTE *bMask, char * szMask, int codeOffset, BOOL extract)
{
	for (DWORD i = 0; i < dwSize; i++)
	{
		if (bCompare((BYTE*) (dwStartAddress + i), bMask, szMask))
		{
			if (extract)
			{
				return *(DWORD*) (dwStartAddress + i + codeOffset);
			}
			else
			{
				return (DWORD) (dwStartAddress + i + codeOffset);
			}
		}
	}
	return NULL;
}
How to use :

[HTML]DWORD ServerPTR = FindPattern((PBYTE)"\x83\x3D\x00\x00\xAE\x00\x00\x 74\x07\xE8\x2E\x03\x00\x00\xEB\x02", "xx??xxxxxxxxxxxx", 2, true);

Writelog("#define ADR_SERVERPTR 0x%X", ServerPTR);[/HTML]
Quote Originally Posted by n4n033 View Post
Code:
DWORD dwSize;
DWORD dwStartAddress;

BOOL bCompare(const BYTE* pData, const BYTE* bMask, const char* szMask)
{
	for (; *szMask; ++szMask, ++pData, ++bMask)
	{
		if (*szMask == 'x' && *pData != *bMask)
			return 0;
	}
	return (*szMask) == NULL;
}
DWORD FindPattern(BYTE *bMask, char * szMask, int codeOffset, BOOL extract)
{
	for (DWORD i = 0; i < dwSize; i++)
	{
		if (bCompare((BYTE*) (dwStartAddress + i), bMask, szMask))
		{
			if (extract)
			{
				return *(DWORD*) (dwStartAddress + i + codeOffset);
			}
			else
			{
				return (DWORD) (dwStartAddress + i + codeOffset);
			}
		}
	}
	return NULL;
}
How to use :

[HTML]DWORD ServerPTR = FindPattern((PBYTE)"\x83\x3D\x00\x00\xAE\x00\x00\x 74\x07\xE8\x2E\x03\x00\x00\xEB\x02", "xx??xxxxxxxxxxxx", 2, true);

Writelog("#define ADR_SERVERPTR 0x%X", ServerPTR);[/HTML]
Thank You U_u ;D
Dont' work for me, what is the function of Writelog?
I try this:
Code:
 DWORD ADR_SERVERPOINTER=FindPattern((PBYTE)"\x83\x3D\x00\x00\xAE\x00\x00\x74\x07\xE8\x2E\x03\x00\x00\xEB\x02","xx??xxxxxxxxxxxx",2,true);

   ofstream file;
   file.open("C:\\Users\\....\\Desktop\\Alliance_Addys.txt");
   file<<"#define ADR_SERVERPOINTER "<<ADR_SERVERPOINTER;
   file.close();
   Sleep(100);
   ExitProcess(0);
But the output is:
Code:
#define ADR_SERVERPOINTER 0
Quote Originally Posted by AllianceCoder View Post
Dont' work for me, what is the function of Writelog?
I try this:
Code:
 DWORD ADR_SERVERPOINTER=FindPattern((PBYTE)"\x83\x3D\x00\x00\xAE\x00\x00\x74\x07\xE8\x2E\x03\x00\x00\xEB\x02","xx??xxxxxxxxxxxx",2,true);

   ofstream file;
   file.open("C:\\Users\\....\\Desktop\\Alliance_Addys.txt");
   file<<"#define ADR_SERVERPOINTER "<<ADR_SERVERPOINTER;
   file.close();
   Sleep(100);
   ExitProcess(0);
But the output is:
Code:
#define ADR_SERVERPOINTER 0
http://www.mpgh.net/forum/242-crossf...dy-logger.html

just modif it a bit
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us