From 0c95be18723b02fb2fdbdefa0906920f8a4be473 Mon Sep 17 00:00:00 2001 From: Ryan Cloherty Date: Tue, 7 Sep 2021 00:54:27 -0400 Subject: [PATCH 1/8] Add IsPlayerInTitan() --- titanfall2-rp/Titanfall2API.cs | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/titanfall2-rp/Titanfall2API.cs b/titanfall2-rp/Titanfall2API.cs index 5c8c639..c63012b 100644 --- a/titanfall2-rp/Titanfall2API.cs +++ b/titanfall2-rp/Titanfall2API.cs @@ -32,6 +32,51 @@ public int GetPlayerHealth() return _sharp!.Memory.Read(EngineDllBaseAddress + 0x1122A8DC); } + /// + /// Here's the list of addresses that all reflected the pilot being inside a titan: + /// engine.dll+111E18DC + /// engine.dll+111E18E0 + /// engine.dll+111E1CB8 + /// engine.dll+111E1D10 + /// engine.dll+111E1D34 + /// engine.dll+111E1DAC + /// engine.dll+111E1DB8 + /// engine.dll+111E1DC4 + /// engine.dll+1128D850 + /// engine.dll+112910F4 + /// client.dll+21720D7 + /// client.dll+22BFEC9 + /// client.dll+22BFED5 + /// client.dll+22BFEE5 + /// client.dll+22BFF01 + /// client.dll+22BFF0D + /// client.dll+22BFF1D + /// client.dll+22BFF39 + /// client.dll+22BFF45 + /// client.dll+22BFF55 + /// client.dll+22C75E5 + /// client.dll+22C7605 + /// client.dll+22C7780 + /// client.dll+22C78A0 + /// client.dll+23F5B48 + /// client.dll+23F5B68 + /// client.dll+23F5B88 + /// client.dll+23F5BA8 + /// client.dll+23F5BC8 + /// client.dll+23F5BE8 + /// client.dll+23F5C08 + /// client.dll+23F5C28 + /// client.dll+23F5C48 + /// materialsystem_dx11.dll+1A98090 + /// + /// true if the pilot is in a titan; else false + /// This shit ain't stable, chief + public bool IsPlayerInTitan() + { + _ensureInit(); + return _sharp!.Memory.Read(_engineDllBaseAddress + 0x111E18DC) != 0; + } + public int GetPlayerVelocity() { _ensureInit(); From 6d9cbbd71f9efd5fbed7a093b6bf4d93db12fdca Mon Sep 17 00:00:00 2001 From: Ryan Cloherty Date: Tue, 7 Sep 2021 02:16:37 -0400 Subject: [PATCH 2/8] Add cheat entry --- TF2.CT | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/TF2.CT b/TF2.CT index 49bf7a7..a0582c7 100644 --- a/TF2.CT +++ b/TF2.CT @@ -208,7 +208,6 @@ 47 "UPDATE: Neither of these were the current tick number" - 1 @@ -228,7 +227,6 @@ 77 "Potential current tick values. Look for increments of 20 or 60 per second" - 1 @@ -302,7 +300,6 @@ 78 "These ones set themselves to 1 when the match gets out" - 1 @@ -352,7 +349,6 @@ 79 "These ones set themselves to 0 when the match gets out" - 1 @@ -384,7 +380,6 @@ 80 "These ones seem to be incrementing by 20" - 1 @@ -438,7 +433,7 @@ 84 - "Currently equpped titan (engine.dll+7A7429)" + "Currently equipped titan (engine.dll+7A7429)" Byte
engine.dll+7A7429
From b1fa9b7beb93cccc6d79d7f1ae79b47978b8cb13 Mon Sep 17 00:00:00 2001 From: Ryan Cloherty Date: Tue, 7 Sep 2021 02:17:28 -0400 Subject: [PATCH 3/8] Added Titan enum --- titanfall2-rp/enums/Titan.cs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 titanfall2-rp/enums/Titan.cs diff --git a/titanfall2-rp/enums/Titan.cs b/titanfall2-rp/enums/Titan.cs new file mode 100644 index 0000000..22fa627 --- /dev/null +++ b/titanfall2-rp/enums/Titan.cs @@ -0,0 +1,32 @@ +namespace titanfall2_rp.enums +{ + public enum Titan + { + Ion, + Scorch, + Northstar, + // ReSharper disable once IdentifierTypo + Ronin, + Tone, + Legion, + Monarch, + } + + internal static class TitanMethods + { + public static Titan GetTitan(int titanValue) + { + return (Titan)titanValue; + } + + public static string ToFriendlyString(this Titan titan) + { + return titan.ToString(); + } + + public static string GetAssetName(this Titan titan) + { + return titan.ToString(); + } + } +} \ No newline at end of file From f9991826808868c3e0311ddabe52d944ce42e0ad Mon Sep 17 00:00:00 2001 From: Ryan Cloherty Date: Tue, 7 Sep 2021 02:17:49 -0400 Subject: [PATCH 4/8] Add method to find currently equipped titan --- titanfall2-rp/Titanfall2API.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/titanfall2-rp/Titanfall2API.cs b/titanfall2-rp/Titanfall2API.cs index c63012b..4c0afb5 100644 --- a/titanfall2-rp/Titanfall2API.cs +++ b/titanfall2-rp/Titanfall2API.cs @@ -77,6 +77,12 @@ public bool IsPlayerInTitan() return _sharp!.Memory.Read(_engineDllBaseAddress + 0x111E18DC) != 0; } + public Titan GetTitan() + { + _ensureInit(); + return TitanMethods.GetTitan(_sharp!.Memory.Read(_engineDllBaseAddress + 0x7A7429,1)[0]); + } + public int GetPlayerVelocity() { _ensureInit(); From 8d3beb692444ddf2fdcab4fedab9b4bdda02b4a9 Mon Sep 17 00:00:00 2001 From: Ryan Cloherty Date: Tue, 7 Sep 2021 02:18:21 -0400 Subject: [PATCH 5/8] Conditionally show the titan icon --- titanfall2-rp/GameDetailsProvider.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/titanfall2-rp/GameDetailsProvider.cs b/titanfall2-rp/GameDetailsProvider.cs index e0e6eac..5bafb66 100644 --- a/titanfall2-rp/GameDetailsProvider.cs +++ b/titanfall2-rp/GameDetailsProvider.cs @@ -24,12 +24,13 @@ public static (string, string, Timestamps?, Assets? assets) GetMultiplayerDetail string gameDetails = tf2Api.GetGameMode().ToFriendlyString(); string gameState = $"{mpStats.GetTeam1Score()}:{mpStats.GetTeam2Score()}"; var timestamps = new Timestamps(gameOpenTimestamp); + var playerInTitan = tf2Api.IsPlayerInTitan(); var assets = new Assets { LargeImageKey = tf2Api.GetMultiplayerMapName(), LargeImageText = tf2Api.GetFriendlyMapName(), - SmallImageKey = tf2Api.GetMultiPlayerGameStats().GetCurrentFaction().GetAssetName(), - SmallImageText = tf2Api.GetMultiPlayerGameStats().GetCurrentFaction().ToFriendlyString(), + SmallImageKey = playerInTitan ? tf2Api.GetTitan().GetAssetName() : tf2Api.GetMultiPlayerGameStats().GetCurrentFaction().GetAssetName(), + SmallImageText = playerInTitan ? tf2Api.GetTitan().ToFriendlyString():tf2Api.GetMultiPlayerGameStats().GetCurrentFaction().ToFriendlyString(), }; return (gameDetails, gameState, timestamps, assets); } From 60e05f12705dbe6593a7c988956f64e20023b657 Mon Sep 17 00:00:00 2001 From: Ryan Cloherty Date: Tue, 7 Sep 2021 02:28:21 -0400 Subject: [PATCH 6/8] dotnet format --- titanfall2-rp/GameDetailsProvider.cs | 2 +- titanfall2-rp/Titanfall2API.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/titanfall2-rp/GameDetailsProvider.cs b/titanfall2-rp/GameDetailsProvider.cs index 5bafb66..46a5b79 100644 --- a/titanfall2-rp/GameDetailsProvider.cs +++ b/titanfall2-rp/GameDetailsProvider.cs @@ -30,7 +30,7 @@ public static (string, string, Timestamps?, Assets? assets) GetMultiplayerDetail LargeImageKey = tf2Api.GetMultiplayerMapName(), LargeImageText = tf2Api.GetFriendlyMapName(), SmallImageKey = playerInTitan ? tf2Api.GetTitan().GetAssetName() : tf2Api.GetMultiPlayerGameStats().GetCurrentFaction().GetAssetName(), - SmallImageText = playerInTitan ? tf2Api.GetTitan().ToFriendlyString():tf2Api.GetMultiPlayerGameStats().GetCurrentFaction().ToFriendlyString(), + SmallImageText = playerInTitan ? tf2Api.GetTitan().ToFriendlyString() : tf2Api.GetMultiPlayerGameStats().GetCurrentFaction().ToFriendlyString(), }; return (gameDetails, gameState, timestamps, assets); } diff --git a/titanfall2-rp/Titanfall2API.cs b/titanfall2-rp/Titanfall2API.cs index 4c0afb5..446c024 100644 --- a/titanfall2-rp/Titanfall2API.cs +++ b/titanfall2-rp/Titanfall2API.cs @@ -80,7 +80,7 @@ public bool IsPlayerInTitan() public Titan GetTitan() { _ensureInit(); - return TitanMethods.GetTitan(_sharp!.Memory.Read(_engineDllBaseAddress + 0x7A7429,1)[0]); + return TitanMethods.GetTitan(_sharp!.Memory.Read(_engineDllBaseAddress + 0x7A7429, 1)[0]); } public int GetPlayerVelocity() From 851259e124c9934f72d957843e0994e3cd8c00e3 Mon Sep 17 00:00:00 2001 From: Ryan Cloherty Date: Wed, 29 Sep 2021 00:52:10 -0400 Subject: [PATCH 7/8] Ensure asset name is lowercase --- titanfall2-rp/enums/Titan.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/titanfall2-rp/enums/Titan.cs b/titanfall2-rp/enums/Titan.cs index 22fa627..f2e9780 100644 --- a/titanfall2-rp/enums/Titan.cs +++ b/titanfall2-rp/enums/Titan.cs @@ -26,7 +26,7 @@ public static string ToFriendlyString(this Titan titan) public static string GetAssetName(this Titan titan) { - return titan.ToString(); + return titan.ToString().ToLower(); } } } \ No newline at end of file From 87e6f33951486e17acf14f1f10137f0257771315 Mon Sep 17 00:00:00 2001 From: Ryan Cloherty Date: Fri, 1 Oct 2021 17:27:19 -0400 Subject: [PATCH 8/8] Rename changed variable after rebase --- titanfall2-rp/Titanfall2API.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/titanfall2-rp/Titanfall2API.cs b/titanfall2-rp/Titanfall2API.cs index 446c024..96aaf13 100644 --- a/titanfall2-rp/Titanfall2API.cs +++ b/titanfall2-rp/Titanfall2API.cs @@ -74,13 +74,13 @@ public int GetPlayerHealth() public bool IsPlayerInTitan() { _ensureInit(); - return _sharp!.Memory.Read(_engineDllBaseAddress + 0x111E18DC) != 0; + return _sharp!.Memory.Read(EngineDllBaseAddress + 0x111E18DC) != 0; } public Titan GetTitan() { _ensureInit(); - return TitanMethods.GetTitan(_sharp!.Memory.Read(_engineDllBaseAddress + 0x7A7429, 1)[0]); + return TitanMethods.GetTitan(_sharp!.Memory.Read(EngineDllBaseAddress + 0x7A7429, 1)[0]); } public int GetPlayerVelocity()