[Source Code]

Posts 1–4 of 4 · Page 1 of 1
[Source Code]
[EmzWall] try this code... gdlck!!!! Assault Fire
Code:
DWORD ProcurarDevice(DWORD Len)
{
DWORD dwObjBase = 0;

dwObjBase = (DWORD)LoadLibrary("d3d9.dll");
while (dwObjBase++ < dwObjBase + Len)
{
if ( (*(WORD*)(dwObjBase + 0x00)) == 0x06C7
&& (*(WORD*)(dwObjBase + 0x06)) == 0x8689
&& (*(WORD*)(dwObjBase + 0x0C)) == 0x8689
) { dwObjBase += 2; break; }
}
return( dwObjBase );
}
DWORD PegarEndrDevice(int VTableIndex)
{
PDWORD VTable;
*(DWORD*)&VTable = *(DWORD*)ProcurarDevice(0x128000);
return VTable[VTableIndex];
}

// pReset = (Reset_t)DetourFunction((PBYTE)PegarEndrDevice(16),(PBYTE)nReset);
------------------------------------------------------------------------------------------------------------------
Code:
DWORD ProcurarDevice(DWORD Len)
{
DWORD dwObjBase = 0;

dwObjBase = (DWORD)LoadLibrary("d3d9.dll");
while (dwObjBase++ < dwObjBase + Len)
{
if ( (*(WORD*)(dwObjBase + 0x00)) == 0x06C7
&& (*(WORD*)(dwObjBase + 0x06)) == 0x8689
&& (*(WORD*)(dwObjBase + 0x0C)) == 0x8689
) { dwObjBase += 2; break; }
}
return( dwObjBase );
}

void Hook()
{
PDWORD VTable;
*(DWORD*)&VTable = *(DWORD*)ProcurarDevice(0x128000);
pEndScene = (tEndScene) DetourFunction((PBYTE)VTable[ENDSCENE], (PBYTE)EndScene);
Sleep( 100 );
}

Tenprotect sucks hard.
Thats how i logged them, just add something to write it down at the end of logging:

	}
                found=false;
		iNum = lNum.begin();
		iPrim = lPrim.begin();
		for(int i=0;i < LoggedN;i++)
		{
			if(*iNum==NumVertices)
			{
				found=true;
				break;
			}
			LoggedN++;
			iNum++;
		}
		if(found==false)
		{
			lNum.push_back(NumVertices);
		}
		found=false;
		for(int i=0;i < LoggedN;i++)
		{
			if(*iPrim==PrimitiveCount)
			{
				found=true;
				break;
			}
			LoggedP++;
			iPrim++;
		}
		if(found==true)
		{
			lPrim.push_back(PrimitiveCount);
			found=false;
		}

	}
-----------------------------------------------------------------------------------------------------------
maybe someone else is interested, in a different method of logging:
The save function:
Code:
if(Cheats.Coding.WriteThemDown)
	{
		Cheats.Coding.GetThem=0;
		Menu.WriteLog("Sizeof lPrim: %i",sizeof(lPrim));
		Menu.WriteLog("Sizeof lNum: %i",sizeof(lNum));
		char Temp[2048];;
		DbWrite("Logged %i Prims & %i Nums",LoggedP,LoggedN);
		std::list<UINT>::iterator iiPrim = lPrim.begin();
		std::list<UINT>::iterator iiNum = lNum.begin();
		sprintf_s(Temp,sizeof(Temp),"#define Prims (");
		for(int i=0;i < LoggedP;i++)
		{

			sprintf_s(Temp,sizeof(Temp),"%s(PrimitiveCount==%i)||",Temp,*iiPrim);
			iiPrim++;
		}
		sprintf_s(Temp,sizeof(Temp),"%s)",Temp);
		Menu.WriteLog(Temp);
		sprintf_s(Temp,sizeof(Temp),"#define Nums (");
		for(int i=0;i < LoggedN;i++)
		{

			sprintf_s(Temp,sizeof(Temp),"%s(NumVertices==%i)||",Temp,*iiNum);
			iiNum++;
		}
		sprintf_s(Temp,sizeof(Temp),"%s)",Temp);
		Menu.WriteLog(Temp);
		Cheats.Coding.WriteThemDown = 0;
		MessageBoxA(0,"Logging success!","Yai",MB_OK);
	}
Not Working to me .. ive got some errors..
Quote Originally Posted by DjLvke View Post
Not Working to me .. ive got some errors..
Post the errors and someone of us will probably help you..
Thank for give some tips to me sr [MPGH]Lovroman but this not important to me .. infact i have more source codees .. thank you..
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?