Esempio n. 1
0
VOID BlinkGodMode(__in BOOL bEnable) // This first line is exact line as in cheats.h.
{
    static BYTE normalbytes[] = {0x0f, 0x86}; //DISABLED bytes of the hack
    static BYTE hackonbytes[] = {0x0f, 0x83}; //ENABLED bytes of the hack
    static DWORD HackAddr = 0x00A00A00; //Addresse of the hack

    if(bEnable)
        WriteAddress((LPVOID)HackAddr, hackonbytes, 2); //Number of ENABLED bytes...
    else
        WriteAddress((LPVOID)HackAddr, normalbytes, 2); //Number of DISABLED bytes...
}
void cTrackManiaHack::TeleportToPos(int iIndex)
{
	if (m_SavedPos[iIndex].fPosX == 0 && m_SavedPos[iIndex].fPosZ == 0 && m_SavedPos[iIndex].fPosY == 0)
		return;

	DWORD dwPos = GetPositionAddress();

	WriteAddress(dwPos, &m_SavedDirections[iIndex], sizeof(DIRECTION));

	dwPos += 0x34;

	WriteAddress(dwPos, &m_SavedPos[iIndex], sizeof(m_SavedPos[iIndex]));
}
Esempio n. 3
0
void EvalAssign( std::stack<TokenEval> &varStack, std::vector<TokenEval> &callStack )
{
    Variable src;
    TokenEval dst;
    src = varStack.top().v;
    varStack.pop();
    dst  = varStack.top();
    varStack.pop();

    if( dst.vPtr != NULL )
    {
        if( dst.type == TokenEval::VARIABLE )
        {
            *(dst.vPtr) = src;
            varStack.push(TokenEval(*(dst.vPtr), dst.vPtr));
        }
        else if( dst.type == TokenEval::UCHAR )
        {
            unsigned char *dstChar;
            dstChar = (unsigned char *)dst.vPtr;
            *dstChar = src.AsValue();
            varStack.push(TokenEval(*dstChar, dstChar, TokenEval::UCHAR));
        }
    }
    else
    {
        WriteAddress( (LPVOID)dst.v.AsValue(), &src, 4 );
    }
}
void cTrackManiaHack::Boost(bool bKeyDown)
{
	if (!m_bBoostEnabled)
		return;

	if (bKeyDown)
	{
		if (m_bUseBoostMultiHack)
		{
			SetBoostMulti(m_fBoostMultiHack);
		}

		DWORD dwOffsets[] = {0x35C, 0x0, 0x0, 0x2EC, 0x128};
		DWORD dwAddressGroundNum = ReadPointer(GetAddress("BaseP1"), dwOffsets, sizeof(dwOffsets));
		BYTE BoostValue = 0x7;
		WriteAddress(dwAddressGroundNum, &BoostValue, sizeof(BoostValue));
	}
	else
	{
		if (m_bUseBoostMultiHack)
		{
			SetBoostMulti(m_fBoostMulti);
		}
	}
}
void cTrackManiaHack::MeterHack(void)
{
	static CNop MeterChangeFix;
	static CNop MeterChangeFix2;
	MeterChangeFix.Initialize(this, GetAddress("MeterHack1"), 6);
	MeterChangeFix2.Initialize(this, GetAddress("MeterHack2"), 6);
	if (!MeterChangeFix.IsEnabled())
	{
		/*
		Anschalten
		*/
		MeterChangeFix.Enable(); MeterChangeFix2.Enable();
		int iMeter = 99999999;
		DWORD dwOffsets[] = {0x454, 0x268};
		DWORD dwAddress = ReadPointer(GetAddress("BaseP1"), dwOffsets, sizeof(dwOffsets));
		WriteAddress(dwAddress, &iMeter, sizeof(iMeter));
		SoundUpdate(SOUND_ON);
	}
	else
	{
		/*
		Ausschalten - Daten wiederherstellen
		*/
		MeterChangeFix.Disable(); MeterChangeFix2.Disable();
		SoundUpdate(SOUND_OFF);
	}
}
Esempio n. 6
0
static
inline
VOID
WriteByte(USHORT Address, USHORT Value)
{
  WriteAddress(Address);
  WriteData(Value);
}
Esempio n. 7
0
static
inline
UCHAR
ReadByte(PUCHAR ReadDataPort, USHORT Address)
{
  WriteAddress(Address);
  return ReadData(ReadDataPort);
}
Esempio n. 8
0
void CTM2Hack::TeleportToPos(int iIndex)
{
	if (m_SavedPos[iIndex].fPosX == 0 && m_SavedPos[iIndex].fPosZ == 0 && m_SavedPos[iIndex].fPosY == 0)
		return;

	DWORD dwPos = GetPositionAddress();

	WriteAddress(dwPos, &m_SavedPos[iIndex], sizeof(m_SavedPos[iIndex]));
}
Esempio n. 9
0
void CTM2Hack::DoCarJump(int iHeight)
{
	DWORD dwZPos = GetPositionAddress() + 0x4;

	float fPos = 0;
	ReadAddress(dwZPos, &fPos, sizeof(fPos));
	fPos += iHeight;
	WriteAddress(dwZPos, &fPos, sizeof(fPos));
}
Esempio n. 10
0
void CTM2Hack::LoadTeleportArray(void)
{
	DWORD dwPos = GetPositionAddress();

	for (unsigned int i = 0; i < m_vecAutoPositions.size(); i++)
	{
		WriteAddress(dwPos, &m_vecAutoPositions[i], sizeof(m_vecAutoPositions[i]));
		Sleep(100);
	}
}
void cTrackManiaHack::LoadTeleportArray()
{
	DWORD dwPos = GetPositionAddress();
	dwPos += 0x34;

	for (unsigned int i = 0; i < m_vecAutoPositions.size(); i++)
	{
		WriteAddress(dwPos, &m_vecAutoPositions[i], sizeof(m_vecAutoPositions[i]));
		Sleep(100);
	}
}
Esempio n. 12
0
void CTM2Hack::SpeedHandlingHack(float newValue)
{
	unsigned __int32 standartValue = 0x40666666; // 3.599999905;
	DWORD dwOld;
	DWORD shhack_address = GetAddress("SHHack");
	VirtualProtectEx(this->m_hGameHandle, (LPVOID)shhack_address, 4, PAGE_EXECUTE_READWRITE, &dwOld);
	static bool bEnabled = false;
	if (!bEnabled)
	{
		WriteAddress(shhack_address, &newValue, sizeof(newValue));
		SoundUpdate(SOUND_ON);
	}
	else
	{
		WriteAddress(shhack_address, &standartValue, sizeof(standartValue));
		SoundUpdate(SOUND_OFF);
	}
	bEnabled = !bEnabled;
	DWORD temp;
	VirtualProtectEx(this->m_hGameHandle, (LPVOID)shhack_address, 4, dwOld, &temp);
}
void cTrackManiaHack::TimeFreeze(int iTimeSec, int iTimeCentiSec)
{
	BYTE bInjectCode[33] =	{	0x52,									// push edx
								0x8B, 0x96, 0xAC, 0x02, 0x00, 0x00,		// mov edx, [esi+2AC]
								0x81, 0xC2, 0x0A, 0x00, 0x00, 0x00,		// add edx, A
								0x39, 0x95, 0x74, 0x02, 0x00, 0x00,		// cmp [ebp+274], edx
								0x5A,									// pop edx
								0x73, 0x06,								// jae #nächste Zeile überspringen#
								0x89, 0x8D, 0x74, 0x02, 0x00, 0x00,		// mov [ebp+274], ecx #ORIGINAL#
								0xE9, 0xFF, 0xFF, 0xFF, 0xFF			// jmp #back#
							};
	static CCodeInjection TFreezeInject;
	TFreezeInject.Initialize(this, GetAddress("TimeNormalChange"), bInjectCode, sizeof(bInjectCode), 6);
	static CNop TFCPFix;
	TFCPFix.Initialize(this, GetAddress("TimeCheckpointChange"), 6);

	if (!TFreezeInject.IsEnabled())
	{
		TFCPFix.Enable();
		TFreezeInject.Enable();

		int iTimeStop = iTimeSec * 1000 + iTimeCentiSec * 10;
		if (iTimeStop <= 0)
		{
			iTimeStop = 10;
		}
		WriteAddress(TFreezeInject.GetBaseAddress() + 9, &iTimeStop, sizeof(iTimeStop)); // Stopzeit einschreiben

		SoundUpdate(SOUND_ON);
	}
	else
	{
		TFCPFix.Disable();
		TFreezeInject.Disable();
		SoundUpdate(SOUND_OFF);
	}
}
Esempio n. 14
0
void CTM2Hack::TimeFreeze(int iTimeSec, int iTimeCentiSec)
{
	static CCodeInjection TimeChangeFix;
	BYTE bInjectCode[] = {
		0x81, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF,			// cmp edx, FFFFFFFF
		0x73, 0x02,									// jae #overjump next line#
		0x89, 0x10,									// mov [eax], edx (original code)
		0x8B, 0x86, 0x20, 0x02, 0x00, 0x00,			// mov eax, [esi+220] (original code)
		0xE9, 0xC9, 0x65, 0x8D, 0xFD				// jmp #back#
	};
	TimeChangeFix.Initialize(this, GetAddress("TimeFreezeChange"), bInjectCode, sizeof(bInjectCode), 8);

	static CCodeChange FinishFix;
	BYTE JMPSHORT[] = {0xEB};
	FinishFix.Initialize(this, GetAddress("TimeFreezeFinishFix"), JMPSHORT, sizeof(JMPSHORT));

	if (!TimeChangeFix.IsEnabled())
	{
		TimeChangeFix.Enable();
		FinishFix.Enable();

		int iTimeStop = iTimeSec * 1000 + iTimeCentiSec * 10 + 10;
		if (iTimeStop <= 10)
		{
			iTimeStop = 20;
		}
		WriteAddress(TimeChangeFix.GetBaseAddress() + 2, &iTimeStop, sizeof(iTimeStop)); // Stopzeit einschreiben

		SoundUpdate(SOUND_ON);
	}
	else
	{
		TimeChangeFix.Disable();
		FinishFix.Disable();
		SoundUpdate(SOUND_OFF);
	}
}
void cTrackManiaHack::SetStuntPoints(int iPoints)
{
	DWORD dwOffsets[] = {0x454, 0x28, 0x0, 0x1C, 0x2D4};
	WriteAddress(ReadPointer(GetAddress("BaseP1"), dwOffsets, sizeof(dwOffsets)), &iPoints, sizeof(iPoints));
}
void cTrackManiaHack::SetBoostMulti(float fNewMulti)
{
	DWORD dwOffsetsSpeed[] = {0x4, 0x64, 0x18, m_dwModeOffset, 0xF0};
	DWORD dwBoostOptionAddress = ReadPointer(GetAddress("GroundNumBase"), dwOffsetsSpeed, sizeof(dwOffsetsSpeed));
	if (dwBoostOptionAddress) WriteAddress(dwBoostOptionAddress, &fNewMulti, sizeof(fNewMulti));
}
void cTrackManiaHack::SetBoostDuration(int iNewDuration)
{
	DWORD dwOffsetsSpeed[] = {0x4, 0x64, 0x18, m_dwModeOffset, 0xF8};
	DWORD dwBoostOptionAddress = ReadPointer(GetAddress("GroundNumBase"), dwOffsetsSpeed, sizeof(dwOffsetsSpeed));
	if (dwBoostOptionAddress) WriteAddress(dwBoostOptionAddress, &iNewDuration, sizeof(iNewDuration));
}