/**
 * Copyright (C) 2022  Mikusch
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

"Games"
{
	"tf"
	{
		"Keys"
		{
			"CTFPlayer_BaseOffset"
			{
				"linux"		"m_bIsMiniBoss"
				"windows"	"m_bIsMiniBoss"
			}
			"CCurrencyPack_BaseOffset"
			{
				"linux"		"m_bDistributed"
				"windows"	"m_bDistributed"
			}
			"CPopulationManager_BaseOffset"
			{
				"linux"		"m_vecOrigin"
				"windows"	"m_vecOrigin"
			}
		}
		"Signatures"
		{
			"CPopulationManager::Update"
			{
				"linux"		"@_ZN18CPopulationManager6UpdateEv"
				"windows"	"\x55\x8B\xEC\x83\xEC\x18\x53\x56\x57\x8B\xF9\x33\xF6"
			}
			"CPopulationManager::ResetMap"
			{
				"linux"		"@_ZN18CPopulationManager8ResetMapEv"
				"windows"	"\x55\x8B\xEC\x51\xA1\x2A\x2A\x2A\x2A\x53\x56\x57\xBF\x01\x00\x00\x00"
			}
			"CPopulationManager::GetPlayerCurrencySpent"
			{
				"linux"		"@_ZN18CPopulationManager22GetPlayerCurrencySpentEP9CTFPlayer"
				"windows"	"\x55\x8B\xEC\x83\xEC\x08\x81\x65\xFC\xFF\xFF\x0F\xFF\x8D\x45\xF8\x56\x8B\x75\x08\x57\x8B\xF9\xC6\x45\xFF\x00\x81\x65\xFC\x00\x00\xF0\xFF\x8B\xCE\x50\xC7\x45\xF8\x00\x00\x00\x00\xE8\x2A\x2A\x2A\x2A\x84\xC0\x75\x2A\x8D\x86\xB4\x0F\x00\x00\x50\x68\x2A\x2A\x2A\x2A\xFF\x15\x2A\x2A\x2A\x2A\x83\xC4\x08\x33\xC0\x5F\x5E\x8B\xE5\x5D\xC2\x04\x00\xFF\x75\xFC\x8B\xCF\xFF\x75\xF8\xE8\x2A\x2A\x2A\x2A\x85\xC0\x75\x2A\x5F\x5E\x8B\xE5\x5D\xC2\x04\x00\x8B\x40\x1C"
			}
			"CPopulationManager::AddPlayerCurrencySpent"
			{
				"linux"		"@_ZN18CPopulationManager22AddPlayerCurrencySpentEP9CTFPlayeri"
				"windows"	"\x55\x8B\xEC\x83\xEC\x08\x81\x65\xFC\xFF\xFF\x0F\xFF\x8D\x45\xF8\x56\x8B\x75\x08\x57\x8B\xF9\xC6\x45\xFF\x00\x81\x65\xFC\x00\x00\xF0\xFF\x8B\xCE\x50\xC7\x45\xF8\x00\x00\x00\x00\xE8\x2A\x2A\x2A\x2A\x84\xC0\x75\x2A\x8D\x86\xB4\x0F\x00\x00\x50\x68\x2A\x2A\x2A\x2A\xFF\x15\x2A\x2A\x2A\x2A\x83\xC4\x08\x5F"
			}
			"CCaptureFlag::Capture"
			{
				"linux"		"@_ZN12CCaptureFlag7CaptureEP9CTFPlayeri"
				"windows"	"\x55\x8B\xEC\x81\xEC\x80\x00\x00\x00\x57\x8B\xF9"
			}
			"CTFGameRules::IsQuickBuildTime"
			{
				"linux"		"@_ZN12CTFGameRules16IsQuickBuildTimeEv"
				"windows"	"\x80\xB9\x7A\x09\x00\x00\x00\x74\x2A\x80\xB9\x8D\x03\x00\x00\x00"
			}
			"CTFGameRules::DistributeCurrencyAmount"
			{
				"linux"		"@_ZN12CTFGameRules24DistributeCurrencyAmountEiP9CTFPlayerbbb"
				"windows"	"\x55\x8B\xEC\x83\xEC\x18\x80\x7D\x10\x00"
			}
			"CTFPlayerShared::ConditionGameRulesThink"
			{
				"linux"		"@_ZN15CTFPlayerShared23ConditionGameRulesThinkEv"
				"windows"	"\x53\x8B\xDC\x83\xEC\x08\x83\xE4\xF0\x83\xC4\x04\x55\x8B\x6B\x04\x89\x6C\x24\x04\x8B\xEC\x81\xEC\xC8\x00\x00\x00\x56\x57\x8B\xF9\x89\x7D\xE4"
			}
			"CTFPlayerShared::CanRecieveMedigunChargeEffect"
			{
				"linux"		"@_ZNK15CTFPlayerShared29CanRecieveMedigunChargeEffectE20medigun_charge_types"
				"windows"	"\x55\x8B\xEC\x53\x56\x57\x8B\xF9\xB3\x01"
			}
			"CTFPlayerShared::RadiusCurrencyCollectionCheck"
			{
				"linux"		"@_ZN15CTFPlayerShared29RadiusCurrencyCollectionCheckEv"
				"windows"	"\x55\x8B\xEC\x83\xEC\x38\x57\x8B\xF9\x89\x7D\xF0"
			}
			"CTFPlayerShared::RadiusSpyScan"
			{
				"linux"		"@_ZN15CTFPlayerShared13RadiusSpyScanEv"
				"windows"	"\x55\x8B\xEC\x83\xEC\x18\x56\x8B\xF1\x89\x75\xFC"
			}
			"CTFPlayerShared::ApplyRocketPackStun"
			{
				"linux"		"@_ZN15CTFPlayerShared19ApplyRocketPackStunEf"
				"windows"	"\x55\x8B\xEC\xF3\x0F\x10\x05\x2A\x2A\x2A\x2A\x83\xEC\x7C"
			}
			"CTFPlayer::CanBuild"
			{
				"linux"		"@_ZN9CTFPlayer8CanBuildEii"
				"windows"	"\x55\x8B\xEC\x83\xEC\x0C\x53\x8B\x5D\x08\x57\x8B\xF9\x83\xFB\x03"
			}
			"CTFPlayer::DropCurrencyPack"
			{
				"linux"		"@_ZN9CTFPlayer16DropCurrencyPackE17CurrencyRewards_tibP11CBasePlayer"
				"windows"	"\x55\x8B\xEC\x83\xEC\x18\x57\x8B\xF9\x8B\x07"
			}
			"CTFPlayer::RegenThink"
			{
				"linux"		"@_ZN9CTFPlayer10RegenThinkEv"
				"windows"	"\x55\x8B\xEC\x83\xEC\x74\x57\x8B\xF9\x8B\x07"
			}
			"CTFReviveMarker::Create"
			{
				"linux"		"@_ZN15CTFReviveMarker6CreateEP9CTFPlayer"
				"windows"	"\x55\x8B\xEC\x83\xEC\x0C\x53\x57\x8B\x7D\x08\x85\xFF"
			}
			"CBaseObject::FindSnapToBuildPos"
			{
				"linux"		"@_ZN11CBaseObject18FindSnapToBuildPosEPS_"
				"windows"	"\x55\x8B\xEC\x83\xEC\x38\x57\x8B\xF9\xE8\x2A\x2A\x2A\x2A\x84\xC0"
			}
			"CBaseObject::ShouldQuickBuild"
			{
				"linux"		"@_ZN11CBaseObject16ShouldQuickBuildEv"
				"windows"	"\x83\x3D\x2A\x2A\x2A\x2A\x00\x56\x8B\xF1\x74\x2A\x8B\x06"
			}
			"CObjectSapper::ApplyRoboSapperEffects"
			{
				"linux"		"@_ZN13CObjectSapper22ApplyRoboSapperEffectsEP9CTFPlayerf"
				"windows"	"\x55\x8B\xEC\x53\x57\x8B\x7D\x08\x8B\xD9\x85\xFF\x75\x2A\x5F\x32\xC0\x5B\x5D\xC2\x08\x00"
			}
			"CRegenerateZone::Regenerate"
			{
				"linux"		"@_ZN15CRegenerateZone10RegenerateEP9CTFPlayer"
				"windows"	"\x55\x8B\xEC\x83\xEC\x34\x53\x56\x8B\x75\x08\x8B\xD9\x57"
			}
			"CTFPowerupBottle::AllowedToUse"
			{
				"linux"		"@_ZN16CTFPowerupBottle12AllowedToUseEv"
				"windows"	"\xA1\x2A\x2A\x2A\x2A\x57\x8B\xF9\x85\xC0\x74\x2A\x8B\x80\x88\x03\x00\x00"
			}
			"CTFKnife::CanPerformBackstabAgainstTarget"
			{
				"linux"		"@_ZN8CTFKnife31CanPerformBackstabAgainstTargetEP9CTFPlayer"
				"windows"	"\x55\x8B\xEC\x51\x56\x8B\x75\x08\x57\x8B\xF9\x85\xF6\x75\x2A\x5F"
			}
			"CTFBaseRocket::CheckForStunOnImpact"
			{
				"linux"		"@_ZN13CTFBaseRocket20CheckForStunOnImpactEP9CTFPlayer"
				"windows"	"\x55\x8B\xEC\x83\xEC\x30\x53\x56\x8B\xF1\x57\x80\xBE\x01\x05\x00\x00\x00"
			}
			"CTFSniperRifle::ExplosiveHeadShot"
			{
				"linux"		"@_ZN14CTFSniperRifle17ExplosiveHeadShotEP9CTFPlayerS1_"
				"windows"	"\x55\x8B\xEC\x81\xEC\xEC\x00\x00\x00\x53\x8B\x5D\x08"
			}
			"UTIL_RemoveImmediate"
			{
				"linux"		"@_Z20UTIL_RemoveImmediateP11CBaseEntity"
				"windows"	"\x55\x8B\xEC\x56\x8B\x75\x08\x85\xF6\x74\x2A\xF6\x86\x3C\x01\x00\x00\x01"
			}
		}
		"Offsets"
		{
			"CCurrencyPack::MyTouch"
			{
				"linux"		"229"
				"windows"	"228"
			}
			"CCurrencyPack::ComeToRest"
			{
				"linux"		"233"
				"windows"	"230"
			}
			"CTFPowerup::ValidTouch"
			{
				"linux"		"234"
				"windows"	"231"
			}
			"CTFWeaponBaseMelee::GetMeleeDamage"
			{
				"linux"		"481"
				"windows"	"474"
			}
			"CTFStunBall::ApplyBallImpactEffectOnVictim"
			{
				"linux"		"267"
				"windows"	"266"
			}
			"CTFGameRules::SetWinningTeam"
			{
				"linux"		"165"
				"windows"	"164"
			}
			"CTFGameRules::ShouldSwitchTeams"
			{
				"linux"		"168"
				"windows"	"167"
			}
			"CTFGameRules::ShouldScrambleTeams"
			{
				"linux"		"171"
				"windows"	"170"
			}
			"CTFGameRules::GetNextRespawnWave"
			{
				"linux"		"174"
				"windows"	"173"
			}
			"CTFGameRules::GetRespawnWaveMaxLength"
			{
				"linux"		"177"
				"windows"	"176"
			}
			"CTFGameRules::ShouldRespawnQuickly"
			{
				"linux"		"178"
				"windows"	"177"
			}
			"CTFGameRules::RoundRespawn"
			{
				"linux"		"231"
				"windows"	"229"
			}
			"CTFGameRules::CheckRespawnWaves"
			{
				"linux"		"233"
				"windows"	"231"
			}
			"CTFPlayer::m_hReviveMarker"
			{
				"linux"		"336"
				"windows"	"336"
			}
			"CCurrencyPack::m_nAmount"
			{
				"linux"		"-26"
				"windows"	"-26"
			}
			"CPopulationManager::m_isRestoringCheckpoint"
			{
				"linux"		"704"
				"windows"	"704"
			}
		}
		"Functions"
		{
			"CPopulationManager::Update"
			{
				"signature"	"CPopulationManager::Update"
				"callconv"	"thiscall"
				"return"	"void"
				"this"		"entity"
			}
			"CPopulationManager::ResetMap"
			{
				"signature"	"CPopulationManager::ResetMap"
				"callconv"	"thiscall"
				"return"	"void"
				"this"		"entity"
			}
			"CCaptureFlag::Capture"
			{
				"signature"	"CCaptureFlag::Capture"
				"callconv"	"thiscall"
				"return"	"void"
				"this"		"entity"
				"arguments"
				{
					"pPlayer"
					{
						"type"	"cbaseentity"
					}
					"nCapturePoint"
					{
						"type"	"int"
					}
				}
			}
			"CTFGameRules::IsQuickBuildTime"
			{
				"signature"	"CTFGameRules::IsQuickBuildTime"
				"callconv"	"thiscall"
				"return"	"bool"
				"this"		"ignore"
			}
			"CTFGameRules::DistributeCurrencyAmount"
			{
				"signature"	"CTFGameRules::DistributeCurrencyAmount"
				"callconv"	"thiscall"
				"return"	"int"
				"this"		"ignore"
				"arguments"
				{
					"nAmount"
					{
						"type"	"int"
					}
					"pTFPlayer"
					{
						"type"	"cbaseentity"
					}
					"bShared"
					{
						"type"	"bool"
					}
					"bCountAsDropped"
					{
						"type"	"bool"
					}
					"bIsBonus"
					{
						"type"	"bool"
					}
				}
			}
			"CTFPlayerShared::ConditionGameRulesThink"
			{
				"signature"	"CTFPlayerShared::ConditionGameRulesThink"
				"callconv"	"thiscall"
				"return"	"void"
				"this"		"address"
			}
			"CTFPlayerShared::CanRecieveMedigunChargeEffect"
			{
				"signature"	"CTFPlayerShared::CanRecieveMedigunChargeEffect"
				"callconv"	"thiscall"
				"return"	"bool"
				"this"		"address"
				"arguments"
				{
					"eType"
					{
						"type"	"int"
					}
				}
			}
			"CTFPlayerShared::RadiusSpyScan"
			{
				"signature"	"CTFPlayerShared::RadiusSpyScan"
				"callconv"	"thiscall"
				"return"	"void"
				"this"		"address"
			}
			"CTFPlayerShared::ApplyRocketPackStun"
			{
				"signature"	"CTFPlayerShared::ApplyRocketPackStun"
				"callconv"	"thiscall"
				"return"	"void"
				"this"		"address"
				"arguments"
				{
					"flAmount"
					{
						"type"	"float"
					}
				}
			}
			"CTFPlayer::CanBuild"
			{
				"signature"	"CTFPlayer::CanBuild"
				"callconv"	"thiscall"
				"return"	"int"
				"this"		"entity"
				"arguments"
				{
					"iObjectType"
					{
						"type"	"int"
					}
					"iObjectMode"
					{
						"type"	"int"
					}
				}
			}
			"CTFPlayer::RegenThink"
			{
				"signature"	"CTFPlayer::RegenThink"
				"callconv"	"thiscall"
				"return"	"void"
				"this"		"entity"
			}
			"CBaseObject::FindSnapToBuildPos"
			{
				"signature"	"CBaseObject::FindSnapToBuildPos"
				"callconv"	"thiscall"
				"return"	"bool"
				"this"		"entity"
				"arguments"
				{
					"pObjectOverride"
					{
						"type"	"cbaseentity"
					}
				}
			}
			"CBaseObject::ShouldQuickBuild"
			{
				"signature"	"CBaseObject::ShouldQuickBuild"
				"callconv"	"thiscall"
				"return"	"bool"
				"this"		"entity"
			}
			"CObjectSapper::ApplyRoboSapperEffects"
			{
				"signature"	"CObjectSapper::ApplyRoboSapperEffects"
				"callconv"	"thiscall"
				"return"	"bool"
				"this"		"entity"
				"arguments"
				{
					"pTarget"
					{
						"type"	"cbaseentity"
					}
					"flDuration"
					{
						"type"	"float"
					}
				}
			}
			"CRegenerateZone::Regenerate"
			{
				"signature"	"CRegenerateZone::Regenerate"
				"callconv"	"thiscall"
				"return"	"void"
				"this"		"entity"
				"arguments"
				{
					"pPlayer"
					{
						"type"	"cbaseentity"
					}
				}
			}
			"CTFPowerupBottle::AllowedToUse"
			{
				"signature"	"CTFPowerupBottle::AllowedToUse"
				"callconv"	"thiscall"
				"return"	"bool"
				"this"		"entity"
			}
			"CTFKnife::CanPerformBackstabAgainstTarget"
			{
				"signature"	"CTFKnife::CanPerformBackstabAgainstTarget"
				"callconv"	"thiscall"
				"return"	"bool"
				"this"		"entity"
				"arguments"
				{
					"pTarget"
					{
						"type"	"cbaseentity"
					}
				}
			}
			"CTFBaseRocket::CheckForStunOnImpact"
			{
				"signature"	"CTFBaseRocket::CheckForStunOnImpact"
				"callconv"	"thiscall"
				"return"	"void"
				"this"		"entity"
				"arguments"
				{
					"pTarget"
					{
						"type"	"cbaseentity"
					}
				}
			}
			"CTFSniperRifle::ExplosiveHeadShot"
			{
				"signature"	"CTFSniperRifle::ExplosiveHeadShot"
				"callconv"	"thiscall"
				"return"	"void"
				"this"		"entity"
				"arguments"
				{
					"pAttacker"
					{
						"type"	"cbaseentity"
					}
					"pVictim"
					{
						"type"	"cbaseentity"
					}
				}
			}
			"CCurrencyPack::MyTouch"
			{
				"offset"	"CCurrencyPack::MyTouch"
				"hooktype"	"entity"
				"return"	"bool"
				"this"		"entity"
				"arguments"
				{
					"pPlayer"
					{
						"type"	"cbaseentity"
					}
				}
			}
			"CCurrencyPack::ComeToRest"
			{
				"offset"	"CCurrencyPack::ComeToRest"
				"hooktype"	"entity"
				"return"	"void"
				"this"		"entity"
			}
			"CTFPowerup::ValidTouch"
			{
				"offset"	"CTFPowerup::ValidTouch"
				"hooktype"	"entity"
				"return"	"bool"
				"this"		"entity"
				"arguments"
				{
					"pPlayer"
					{
						"type"	"cbaseentity"
					}
				}
			}
			"CTFWeaponBaseMelee::GetMeleeDamage"
			{
				"offset"	"CTFWeaponBaseMelee::GetMeleeDamage"
				"hooktype"	"entity"
				"return"	"float"
				"this"		"entity"
				"arguments"
				{
					"pTarget"
					{
						"type"	"cbaseentity"
					}
					"piDamageType"
					{
						"type"	"int"
					}
					"piCustomDamage"
					{
						"type"	"int"
					}
				}
			}
			"CTFStunBall::ApplyBallImpactEffectOnVictim"
			{
				"offset"	"CTFStunBall::ApplyBallImpactEffectOnVictim"
				"hooktype"	"entity"
				"return"	"void"
				"this"		"entity"
				"arguments"
				{
					"pOther"
					{
						"type"	"cbaseentity"
					}
				}
			}
			"CTFGameRules::SetWinningTeam"
			{
				"offset"	"CTFGameRules::SetWinningTeam"
				"hooktype"	"gamerules"
				"return"	"void"
				"this"		"ignore"
				"arguments"
				{
					"team"
					{
						"type"	"int"
					}
					"iWinReason"
					{
						"type"	"int"
					}
					"bForceMapReset"
					{
						"type"	"bool"
					}
					"bSwitchTeams"
					{
						"type"	"bool"
					}
					"bDontAddScore"
					{
						"type"	"bool"
					}
					"bFinal"
					{
						"type"	"bool"
					}
				}
			}
			"CTFGameRules::GetRespawnWaveMaxLength"
			{
				"offset"	"CTFGameRules::GetRespawnWaveMaxLength"
				"hooktype"	"gamerules"
				"return"	"float"
				"this"		"ignore"
				"arguments"
				{
					"iTeam"
					{
						"type"	"int"
					}
					"bScaleWithNumPlayers"
					{
						"type"	"bool"
					}
				}
			}
			"CTFGameRules::ShouldRespawnQuickly"
			{
				"offset"	"CTFGameRules::ShouldRespawnQuickly"
				"hooktype"	"gamerules"
				"return"	"bool"
				"this"		"ignore"
				"arguments"
				{
					"pPlayer"
					{
						"type"	"cbaseentity"
					}
				}
			}
			"CTFGameRules::RoundRespawn"
			{
				"offset"	"CTFGameRules::RoundRespawn"
				"hooktype"	"gamerules"
				"return"	"void"
				"this"		"ignore"
			}
			"CTFGameRules::CheckRespawnWaves"
			{
				"offset"	"CTFGameRules::CheckRespawnWaves"
				"hooktype"	"gamerules"
				"return"	"void"
				"this"		"ignore"
			}
		}
		"MemPatches"
		{
			"CTFPlayerShared::RadiusCurrencyCollectionCheck::AllowAllTeams"
			{
				"signature"		"CTFPlayerShared::RadiusCurrencyCollectionCheck"
				"linux"
				{
					"offset"	"1Dh"
					"verify"	"\x74"
					"patch"		"\xEB"
				}
				"windows"
				{
					"offset"	"1Ah"
					"verify"	"\x74"
					"patch"		"\xEB"
				}
			}
		}
	}
}
