├── .gitignore
├── app.config
├── .travis.yml
├── Entities
├── Ingame
│ ├── Interfaces
│ │ ├── IContinent.cs
│ │ ├── IPlayerStaff.cs
│ │ ├── INationTaxRule.cs
│ │ ├── IStaff.cs
│ │ ├── IRivalNation.cs
│ │ ├── IContractBonus.cs
│ │ ├── IInjury.cs
│ │ ├── ITeam.cs
│ │ ├── IContractClause.cs
│ │ ├── ICity.cs
│ │ ├── INation.cs
│ │ ├── IClub.cs
│ │ ├── IPersonAttributes.cs
│ │ ├── IPerson.cs
│ │ ├── IClubFinances.cs
│ │ ├── IContract.cs
│ │ ├── IPlayer.cs
│ │ └── IPlayerStats.cs
│ ├── Continent.cs
│ ├── Persons
│ │ ├── PlayerStaff.cs
│ │ └── Staff.cs
│ ├── Sub-Entities
│ │ ├── NationTaxRule.cs
│ │ └── RivalNation.cs
│ ├── Injury.cs
│ ├── ContractBonus.cs
│ ├── BaseObject.cs
│ ├── PersonAttributes.cs
│ ├── City.cs
│ ├── Person.cs
│ ├── ContractClauses.cs
│ ├── Nation.cs
│ ├── Club.cs
│ ├── Contract.cs
│ ├── Team.cs
│ └── ClubFinances.cs
└── Global.cs
├── VirtualMemory
├── ExternalSharedLibraries
│ └── libprocessmemoryapi.dylib
├── ProcessMemoryAPI.cs
└── Managers
│ └── PropertyInvoker.cs
├── FMScoutFrameworkTest
├── App.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ └── Resources.resx
├── Program.cs
├── Form1.cs
├── Form1.Designer.cs
├── FMScoutFrameworkTest.csproj
└── Form1.resx
├── Defines
├── Offsets
│ ├── InjuryOffsets.cs
│ ├── PersonTypes
│ │ ├── Sub-Entities
│ │ │ ├── ContractBonusOffsets.cs
│ │ │ ├── ContractClausesOffsets.cs
│ │ │ ├── PersonAttributesOffsets.cs
│ │ │ ├── ContractOffsets.cs
│ │ │ └── PlayerStatsOffsets.cs
│ │ └── StaffOffsets.cs
│ ├── Sub-Entities
│ │ ├── RivalNationOffsets.cs
│ │ ├── NationTaxRulesOffsets.cs
│ │ └── ClubFinancesOffsets.cs
│ ├── CityOffsets.cs
│ ├── TeamOffsets.cs
│ └── NationOffsets.cs
├── Versions
│ ├── IVersionPersonEnumPointers.cs
│ ├── IPersonVersionOffsets.cs
│ ├── IVersion.cs
│ ├── IVersionMemoryAddresses.cs
│ ├── Steam_14_3_0_Windows.cs
│ ├── Steam_14_3_1_Windows.cs
│ ├── Steam_14_3_1_Mac.cs
│ ├── Steam_15_2_1_Windows.cs
│ ├── Steam_14_3_0_Mac.cs
│ ├── Steam_14_3_1_Linux.cs
│ ├── Steam_14_3_0_Linux.cs
│ ├── Steam_15_3_2_Mac.cs
│ ├── Steam_16_2_0_Linux.cs
│ ├── Steam_15_3_2_Windows.cs
│ ├── Steam_16_2_0_Windows.cs
│ └── Steam_16_3_0_Windows.cs
└── FMProcess.cs
├── .gitmodules
├── Converters
└── DateConverter.cs
├── Attributes
└── MemoryAddressAttribute.cs
├── Utilities
└── BitwiseOperations.cs
├── Properties
└── AssemblyInfo.cs
├── FMScoutFramework.sln
├── FMCore.cs
├── README.md
└── FMScoutFramework.csproj
/.gitignore:
--------------------------------------------------------------------------------
1 | bin/
2 | obj/
3 | FMScoutFramework.userprefs
4 | *.suo
5 |
--------------------------------------------------------------------------------
/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: csharp
2 | sudo: false
3 |
4 | script:
5 | - xbuild FMScoutFramework.sln /property:"Configuration=Windows-Release"
6 |
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/IContinent.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface IContinent
4 | {
5 |
6 | }
7 | }
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/IPlayerStaff.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface IPlayerStaff
4 | {
5 |
6 | }
7 | }
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/INationTaxRule.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface INationTaxRule
4 | {
5 |
6 | }
7 | }
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/IStaff.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface IStaff
4 | {
5 | int ID { get; }
6 | }
7 | }
--------------------------------------------------------------------------------
/VirtualMemory/ExternalSharedLibraries/libprocessmemoryapi.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ThanosSiopoudis/FMScoutFramework/HEAD/VirtualMemory/ExternalSharedLibraries/libprocessmemoryapi.dylib
--------------------------------------------------------------------------------
/FMScoutFrameworkTest/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/IRivalNation.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface IRivalNation
4 | {
5 | byte Level { get; }
6 | Nation Nation { get; }
7 | }
8 | }
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/IContractBonus.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface IContractBonus
4 | {
5 | BonusType Type { get; }
6 | int Value { get; }
7 | }
8 | }
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/IInjury.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface IInjury
4 | {
5 | int ID { get; }
6 | string Name { get; }
7 | string SentenceName { get; }
8 | }
9 | }
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/ITeam.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface ITeam
4 | {
5 | int ID { get; }
6 | ushort Reputation { get; }
7 | TeamType TeamType { get; }
8 | }
9 | }
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/IContractClause.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface IContractClause
4 | {
5 | byte Info { get; }
6 | ClauseType Type { get; }
7 | int Value { get; }
8 | }
9 | }
--------------------------------------------------------------------------------
/FMScoutFrameworkTest/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Defines/Offsets/InjuryOffsets.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FMScoutFramework.Core.Offsets
4 | {
5 | public sealed class InjuryOffsets
6 | {
7 | public const short RowID = 0x4;
8 | public const short ID = 0x8;
9 | public const short Name = 0x10;
10 | public const short SentenceName = 0x18;
11 | }
12 | }
--------------------------------------------------------------------------------
/Defines/Versions/IVersionPersonEnumPointers.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.GameVersions
2 | {
3 | public interface IVersionPersonEnumPointers
4 | {
5 | int Player { get; }
6 | int Staff { get; }
7 | int PlayerStaff { get; }
8 | int HumanManager { get; }
9 | int Official { get; }
10 | }
11 | }
--------------------------------------------------------------------------------
/Defines/Offsets/PersonTypes/Sub-Entities/ContractBonusOffsets.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FMScoutFramework.Core.Offsets
4 | {
5 | public sealed class ContractBonusOffsets
6 | {
7 | public const short BonusLength = 0xC;
8 | public const short Value = 0x4;
9 | public const short Type = 0x8;
10 | }
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "ExternalLibraries/LinuxPMA"]
2 | path = ExternalLibraries/LinuxPMA
3 | url = https://ThanosSiopoudis@github.com/ThanosSiopoudis/LinuxProcessMemoryAPI.git
4 | [submodule "ExternalLibraries/MacPMA"]
5 | path = ExternalLibraries/MacPMA
6 | url = https://ThanosSiopoudis@github.com/ThanosSiopoudis/MacProcessMemoryAPI.git
7 |
--------------------------------------------------------------------------------
/Defines/Offsets/PersonTypes/Sub-Entities/ContractClausesOffsets.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FMScoutFramework.Core.Offsets
4 | {
5 | public sealed class ContractClausesOffsets
6 | {
7 | public const short ClauseLength = 0xC;
8 | public const short Value = 0x4;
9 | public const short Type = 0x8;
10 | public const short Info = 0x9;
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/ICity.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface ICity
4 | {
5 | short Altitude { get; }
6 | short Attraction { get; }
7 | int ID { get; }
8 | float Latitude { get; }
9 | float Longitude { get; }
10 | string Name { get; }
11 | Nation Nation { get; }
12 | }
13 | }
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/INation.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface INation
4 | {
5 | int ID { get; }
6 | string Name { get; }
7 | string NationalityName { get; }
8 | RivalNation[] RivalNations { get; }
9 | string ShortName { get; }
10 | Team[] Teams { get; }
11 | string ThreeLetterName { get; }
12 | }
13 | }
--------------------------------------------------------------------------------
/Defines/Versions/IPersonVersionOffsets.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 |
6 | namespace FMScoutFramework.Core.Entities.GameVersions
7 | {
8 | public interface IPersonVersionOffsets
9 | {
10 | int Person { get; }
11 | int Player { get; }
12 | int Staff { get; }
13 | int HumanManager { get; }
14 | int PlayerStaff { get; }
15 | int Official { get; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/IClub.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface IClub
4 | {
5 | Nation BasedNation { get; }
6 | ClubFinances ClubFinances { get; }
7 | int ClubFinancesAddress { get; }
8 | int ID { get; }
9 | string Name { get; }
10 | Nation Nation { get; }
11 | string ShortName { get; }
12 | Team[] Teams { get; }
13 | }
14 | }
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/IPersonAttributes.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface IPersonAttributes
4 | {
5 | byte Adaptability { get; }
6 | byte Ambition { get; }
7 | byte Controversy { get; }
8 | byte Loyalty { get; }
9 | byte Pressure { get; }
10 | byte Professionalism { get; }
11 | byte Sportsmanship { get; }
12 | byte Temperament { get; }
13 | }
14 | }
--------------------------------------------------------------------------------
/Defines/Offsets/Sub-Entities/RivalNationOffsets.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 |
4 | namespace FMScoutFramework.Core.Offsets
5 | {
6 | public sealed class RivalNationOffsets
7 | {
8 | public IVersion Version;
9 | public RivalNationOffsets(IVersion version)
10 | {
11 | this.Version = version;
12 | }
13 |
14 | public const short NationAddress = 0x0;
15 | public const short Level = 0x8;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Converters/DateConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FMScoutFramework.Core.Converters
4 | {
5 | public static class DateConverter
6 | {
7 | public static DateTime FromFmDateTime(int days, int year)
8 | {
9 | DateTime time = new DateTime (year, 1, 1);
10 | return time.AddDays ((double)days);
11 | }
12 |
13 | public static int ToFmDateTime(DateTime date)
14 | {
15 | int year = date.Year;
16 | int days = (date.DayOfYear - 1);
17 | return ((days << 0x10) + year);
18 | }
19 | }
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/Defines/Versions/IVersion.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.GameVersions
2 | {
3 | public interface IVersion
4 | {
5 | string Description { get; }
6 | string MainVersionNumber { get; }
7 | IVersionMemoryAddresses MemoryAddresses { get; }
8 | IVersionPersonEnumPointers PersonEnum { get; }
9 | IPersonVersionOffsets PersonOffsets { get; }
10 | }
11 |
12 | internal interface IIVersion : IVersion
13 | {
14 | bool SupportsProcess(FMProcess process, byte[] context);
15 | }
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/Defines/Offsets/PersonTypes/Sub-Entities/PersonAttributesOffsets.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FMScoutFramework.Core.Offsets
4 | {
5 | public sealed class PersonAttributeOffsets
6 | {
7 | public const short Adaptability = 0x0;
8 | public const short Ambition = 0x1;
9 | public const short Loyalty = 0x2;
10 | public const short Pressure = 0x3;
11 | public const short Professionalism = 0x4;
12 | public const short Sportsmanship = 0x5;
13 | public const short Temperament = 0x6;
14 | public const short Controversy = 0x7;
15 | }
16 | }
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/IPerson.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
4 | {
5 | public interface IPerson
6 | {
7 | int Age { get; }
8 | PersonAttributes Attributes { get; }
9 | Club Club { get; }
10 | Contract Contract { get; }
11 | DateTime DateOfBirth { get; }
12 | string Firstname { get; }
13 | string Fullname { get; }
14 | string Lastname { get; }
15 | Nation Nationality { get; }
16 | string Nickname { get; }
17 | }
18 | }
--------------------------------------------------------------------------------
/Entities/Ingame/Continent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
4 |
5 | namespace FMScoutFramework.Core.Entities.InGame
6 | {
7 | public class Continent : BaseObject, IContinent
8 | {
9 | public Continent (int memoryAddress, IVersion version)
10 | : base(memoryAddress, version)
11 | { }
12 | public Continent (int memoryAddress, ArraySegment originalBytes, IVersion version)
13 | : base(memoryAddress, originalBytes, version)
14 | { }
15 | }
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/Defines/FMProcess.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Diagnostics;
5 |
6 | namespace FMScoutFramework.Core
7 | {
8 | ///
9 | /// Holder for the Football Manager process
10 | ///
11 | public class FMProcess
12 | {
13 | public Process Process { get; set; }
14 | public IntPtr Pointer { get; set; }
15 | public int EndPoint { get; set; }
16 | public int BaseAddress { get; set; }
17 | public string VersionDescription { get; set; }
18 | public int HeapAddress { get; set; }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Entities/Ingame/Persons/PlayerStaff.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
4 |
5 | namespace FMScoutFramework.Core.Entities.InGame
6 | {
7 | public class PlayerStaff : BaseObject, IPlayerStaff
8 | {
9 | public PlayerStaff (int memoryAddress, IVersion version)
10 | : base(memoryAddress, version)
11 | { }
12 | public PlayerStaff (int memoryAddress, ArraySegment originalBytes, IVersion version)
13 | : base(memoryAddress, originalBytes, version)
14 | { }
15 | }
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/Attributes/MemoryAddressAttribute.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FMScoutFramework.Core.Attributes
4 | {
5 | internal class MemoryAddressAttribute : Attribute
6 | {
7 | public int CountLength { get; set; }
8 | public int BytesToSkip { get; set; }
9 | public int ObjectOffset { get; set; }
10 |
11 | public MemoryAddressAttribute(int countLength, int bytesToSkip, int objectOffset = 0x00)
12 | {
13 | this.CountLength = countLength;
14 | this.BytesToSkip = bytesToSkip;
15 | this.ObjectOffset = objectOffset;
16 | }
17 |
18 | public MemoryAddressAttribute() {}
19 | }
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/FMScoutFrameworkTest/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace FMScoutFrameworkTest
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | Application.EnableVisualStyles();
18 | Application.SetCompatibleTextRenderingDefault(false);
19 | Application.Run(new Form1());
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/IClubFinances.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface IClubFinances
4 | {
5 | int Balance { get; set; }
6 | int HighestWagePaid { get; set; }
7 | int LastestSeasonTickets { get; set; }
8 | int LatestSeasonTicketsAddress { get; set; }
9 | int RemainingBudget { get; set; }
10 | int SeasonTransferFunds { get; set; }
11 | int TransferIncomePercentage { get; set; }
12 | int WeeklyWageBudget { get; set; }
13 | int HighestWage { get; set; }
14 | int YouthGrantIncome { get; set; }
15 | }
16 | }
--------------------------------------------------------------------------------
/Entities/Ingame/Sub-Entities/NationTaxRule.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
4 |
5 | namespace FMScoutFramework.Core.Entities.InGame
6 | {
7 | public class NationTaxRule : BaseObject, INationTaxRule
8 | {
9 | public NationTaxRule (int memoryAddress, IVersion version)
10 | : base(memoryAddress, version)
11 | { }
12 | public NationTaxRule (int memoryAddress, ArraySegment originalBytes, IVersion version)
13 | : base(memoryAddress, originalBytes, version)
14 | { }
15 | }
16 | }
17 |
18 |
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/IContract.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
4 | {
5 | public interface IContract
6 | {
7 | ContractBonus[] ContractBonuses { get; }
8 | ContractClause[] ContractClauses { get; }
9 | ContractType ContractType { get; }
10 | DateTime DateExpires { get; }
11 | DateTime DateStarted { get; }
12 | bool isTransferListed { get; }
13 | JobType JobType { get; }
14 | sbyte SquadNumber { get; }
15 | SquadStatus SquadStatus { get; }
16 | Team Team { get; }
17 | TransferStatus TransferStatus { get; }
18 | int Wage { get; }
19 | }
20 | }
--------------------------------------------------------------------------------
/Utilities/BitwiseOperations.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FMScoutFramework.Core.Utilities
4 | {
5 | public class BitwiseOperations
6 | {
7 | public static uint ror(uint value, int bits)
8 | {
9 | return (value >> bits) | (value << (32 - bits));
10 | }
11 |
12 | public static uint ror_short(uint value, int bits)
13 | {
14 | return ((value >> bits) | (value << (16 - bits)) & 0xFFFF);
15 | }
16 |
17 | public static uint rol(uint value, int bits)
18 | {
19 | return (value << bits) | (value >> (32 - bits));
20 | }
21 |
22 | public static uint rol_short(uint value, int bits)
23 | {
24 | return ((value << bits) | (value >> (16 - bits)) & 0xFFFF) & 0xffff;
25 | }
26 | }
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/Entities/Global.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 | using FMScoutFramework.Core.Managers;
4 |
5 | namespace FMScoutFramework.Core.Entities
6 | {
7 | public class Global
8 | {
9 | private readonly IVersion _version;
10 | public Global (IVersion version)
11 | {
12 | _version = version;
13 | }
14 |
15 | public DateTime InGameDate {
16 | #if MAC
17 | get { return ProcessManager.ReadDateTime(_version.MemoryAddresses.CurrentDateTime); }
18 | #endif
19 | #if WINDOWS || LINUX
20 | get { return ProcessManager.ReadDateTime (ProcessManager.fmProcess.BaseAddress + _version.MemoryAddresses.CurrentDateTime); }
21 | #endif
22 | }
23 | }
24 |
25 | public enum DatabaseModeEnum { Realtime, Cached }
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/Defines/Offsets/CityOffsets.cs:
--------------------------------------------------------------------------------
1 | using FMScoutFramework.Core.Entities.GameVersions;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 |
7 | namespace FMScoutFramework.Defines.Offsets
8 | {
9 | public sealed class CityOffsets
10 | {
11 | public IVersion Version;
12 |
13 | public CityOffsets(IVersion version)
14 | {
15 | this.Version = version;
16 | }
17 |
18 | public const short RowID = 0x4;
19 | public const short ID = 0x8;
20 | public const int Nation = 0x18;
21 | public const short Name = 0x10;
22 | public const short Attraction = 0x38;
23 | public const short Latitude = 0x24;
24 | public const short Longitude = 0x28;
25 | public const short Altitude = 0x34;
26 | }
27 | }
--------------------------------------------------------------------------------
/Defines/Offsets/Sub-Entities/NationTaxRulesOffsets.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 |
4 | namespace FMScoutFramework.Core.Offsets
5 | {
6 | public sealed class NationTaxRulesOffsets
7 | {
8 | public IVersion Version;
9 |
10 | public NationTaxRulesOffsets (IVersion version)
11 | {
12 | this.Version = version;
13 | }
14 |
15 | public const short Percentage = 0x0;
16 | public const short LowerAmount = 0x4;
17 | public const short UpperAmount = 0x8;
18 | public const short CappedAmount = 0xC;
19 | public const short Year = 0x10;
20 | public const short PersonType = 0x12;
21 | public const short Type = 0x13;
22 | public const short TimeFrameYears = 0x14;
23 | public const short DivisionLevel = 0x15;
24 | }
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/FMScoutFrameworkTest/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | using System.Diagnostics;
12 | using FMScoutFramework.Core;
13 |
14 | namespace FMScoutFrameworkTest
15 | {
16 | public partial class Form1 : Form
17 | {
18 | public FMCore fmCore = new FMCore(FMScoutFramework.Core.Entities.DatabaseModeEnum.Realtime);
19 | public Form1()
20 | {
21 | InitializeComponent();
22 | }
23 |
24 | private void button1_Click(object sender, EventArgs e)
25 | {
26 | fmCore.GameLoaded += new Action(GameLoaded);
27 | new Action(() => fmCore.LoadData()).BeginInvoke((s) => { }, null);
28 | }
29 |
30 | public void GameLoaded()
31 | {
32 | Debug.WriteLine("Load Done");
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/IPlayer.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface IPlayer
4 | {
5 | int AskingPrice { get; }
6 | int BansAddress { get; }
7 | ushort CA { get; }
8 | short Condition { get; }
9 | short CurrentReputation { get; }
10 | short Fitness { get; }
11 | double GrowthPotential { get; }
12 | ushort Height { get; }
13 | short HomeReputation { get; }
14 | int ID { get; }
15 | Injury[] Injuries { get; }
16 | int InjuriesAddress { get; }
17 | byte InternationalApps { get; }
18 | byte InternationalGoals { get; }
19 | bool isBanned { get; }
20 | bool isInjured { get; }
21 | short Jadedness { get; }
22 | ushort PA { get; }
23 | PlayerStats PlayerStats { get; }
24 | int RowID { get; }
25 | Team Team { get; }
26 | byte U21InternationalApps { get; }
27 | byte U21InternationalGoals { get; }
28 | int Value { get; }
29 | ushort Weight { get; }
30 | short WorldReputation { get; }
31 | }
32 | }
--------------------------------------------------------------------------------
/FMScoutFrameworkTest/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FMScoutFrameworkTest.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Entities/Ingame/Injury.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
4 | using FMScoutFramework.Core.Managers;
5 | using FMScoutFramework.Core.Offsets;
6 |
7 | namespace FMScoutFramework.Core.Entities.InGame
8 | {
9 | public class Injury : BaseObject, IInjury
10 | {
11 | public Injury (int memoryAddress, IVersion version)
12 | : base(memoryAddress, version)
13 | { }
14 | public Injury (int memoryAddress, ArraySegment originalBytes, IVersion version)
15 | : base(memoryAddress, originalBytes, version)
16 | { }
17 |
18 | public Int32 RowID {
19 | get {
20 | return PropertyInvoker.Get(InjuryOffsets.RowID, OriginalBytes, MemoryAddress, DatabaseMode);
21 | }
22 | }
23 |
24 | public Int32 ID {
25 | get {
26 | return PropertyInvoker.Get(InjuryOffsets.ID, OriginalBytes, MemoryAddress, DatabaseMode);
27 | }
28 | }
29 |
30 | public string SentenceName {
31 | get {
32 | return PropertyInvoker.GetString (InjuryOffsets.SentenceName, -1, OriginalBytes, MemoryAddress, DatabaseMode);
33 | }
34 | }
35 |
36 | public string Name {
37 | get {
38 | return PropertyInvoker.GetString (InjuryOffsets.Name, -1, OriginalBytes, MemoryAddress, DatabaseMode);
39 | }
40 | }
41 | }
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/Defines/Offsets/PersonTypes/Sub-Entities/ContractOffsets.cs:
--------------------------------------------------------------------------------
1 | using FMScoutFramework.Core.Entities.GameVersions;
2 | using System;
3 |
4 | namespace FMScoutFramework.Core.Offsets
5 | {
6 | public sealed class ContractOffsets
7 | {
8 | public IVersion Version;
9 |
10 | public ContractOffsets(IVersion Version)
11 | {
12 | this.Version = Version;
13 | }
14 |
15 | public const short Person = 0x4;
16 | public const short Team = 0x8;
17 | public const short JobType = 0xC;
18 | public const short Wage = 0x14;
19 | public const short DateStarted = 0x20;
20 | public const short DateExpires = 0x24;
21 | public const short SquadStatus = 0x30;
22 | public const short TransferStatus = 0x32;
23 | public const short Clauses = 0x3C;
24 | public const short Bonuses = 0x48;
25 | public const short Type = 0x5D;
26 |
27 | public short SquadNumber
28 | {
29 | get
30 | {
31 | if (Version.GetType() == typeof(Steam_16_3_0_Windows) ||
32 | Version.GetType() == typeof(Steam_16_3_1_Windows) ||
33 | Version.GetType() == typeof(Steam_16_3_2_Windows))
34 | {
35 | return 0x39;
36 | }
37 |
38 | return 0x35;
39 | }
40 | }
41 | }
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/Entities/Ingame/Persons/Staff.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Managers;
3 | using FMScoutFramework.Core.Offsets;
4 | using FMScoutFramework.Core.Entities.GameVersions;
5 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
6 |
7 | namespace FMScoutFramework.Core.Entities.InGame
8 | {
9 | public class Staff : Person, IStaff
10 | {
11 | private StaffOffsets StaffOffsets;
12 | public Staff (int memoryAddress, IVersion version)
13 | : base(memoryAddress, version)
14 | {
15 | this.StaffOffsets = new StaffOffsets (version);
16 | }
17 | public Staff (int memoryAddress, ArraySegment originalBytes, IVersion version)
18 | : base(memoryAddress, originalBytes, version)
19 | {
20 | this.StaffOffsets = new StaffOffsets (version);
21 | }
22 |
23 | protected override int PersonAddress {
24 | get {
25 | return StaffAddress + StaffOffsets.PersonAddress;
26 | }
27 | }
28 |
29 | private int StaffAddress {
30 | get {
31 | return MemoryAddress + Version.PersonOffsets.Staff;
32 | }
33 | }
34 |
35 | public Int32 ID {
36 | get {
37 | return PropertyInvoker.Get(StaffOffsets.ID, OriginalBytes, StaffAddress, DatabaseMode);
38 | }
39 | }
40 |
41 | public Int32 RowID {
42 | get {
43 | return PropertyInvoker.Get(StaffOffsets.RowID, OriginalBytes, StaffAddress, DatabaseMode);
44 | }
45 | }
46 | }
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/Defines/Versions/IVersionMemoryAddresses.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Attributes;
3 |
4 | namespace FMScoutFramework.Core.Entities.GameVersions
5 | {
6 | public interface IVersionMemoryAddresses
7 | {
8 | int MainAddress { get; }
9 | int MainOffset { get; }
10 | int XorDistance { get; }
11 | int StringOffset { get; }
12 | byte[] versionSig { get; }
13 |
14 | [MemoryAddress(CountLength = 4, BytesToSkip = 0x28)]
15 | int City { get; }
16 |
17 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
18 | int Club { get; }
19 |
20 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
21 | int Continent { get; }
22 |
23 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
24 | int Nation { get; }
25 |
26 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
27 | int League { get; }
28 |
29 | /*
30 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
31 | int Language { get; } */
32 |
33 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
34 | int Stadium { get; }
35 |
36 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
37 | int Team { get; }
38 |
39 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
40 | int Person { get; }
41 |
42 | int CurrentDateTime { get; }
43 |
44 | /*
45 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
46 | int ActiveObject { get; } */
47 | }
48 | }
49 |
50 |
--------------------------------------------------------------------------------
/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FMScoutFramework")]
9 | [assembly: AssemblyDescription("A Football Manager cross platform Scout and Editor framework")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Thanos Siopoudis")]
12 | [assembly: AssemblyProduct("FMScoutFramework")]
13 | [assembly: AssemblyCopyright("Thanos Siopoudis 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("251e6e37-670e-4836-888f-deff3a1d1194")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | [assembly: AssemblyVersion("1.0.0.0")]
33 | [assembly: AssemblyFileVersion("1.0.0.0")]
34 |
--------------------------------------------------------------------------------
/Entities/Ingame/ContractBonus.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using FMScoutFramework.Core.Entities.GameVersions;
4 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
5 | using FMScoutFramework.Core.Managers;
6 | using FMScoutFramework.Core.Offsets;
7 |
8 | namespace FMScoutFramework.Core.Entities.InGame
9 | {
10 | public class ContractBonus : BaseObject, IContractBonus
11 | {
12 | public ContractBonus (int memoryAddress, IVersion version)
13 | : base(memoryAddress, version)
14 | { }
15 | public ContractBonus (int memoryAddress, ArraySegment originalBytes, IVersion version)
16 | : base(memoryAddress, originalBytes, version)
17 | { }
18 |
19 | public BonusType Type {
20 | get {
21 | return (BonusType)PropertyInvoker.Get (ContractBonusOffsets.Type, OriginalBytes, MemoryAddress, DatabaseMode);
22 | }
23 | }
24 |
25 | public Int32 Value {
26 | get {
27 | return PropertyInvoker.Get (ContractBonusOffsets.Value, OriginalBytes, MemoryAddress, DatabaseMode);
28 | }
29 | }
30 |
31 | public override string ToString ()
32 | {
33 | return this.Value.ToString("C0", CultureInfo.CreateSpecificCulture("en-GB"));
34 | }
35 | }
36 |
37 | public enum BonusType {
38 | AppearanceFee = 0,
39 | GoalFee = 1,
40 | CleanSheetFee = 2,
41 | TeamOfTheYear = 3,
42 | TopGoalscorer = 4,
43 | PromotionFee = 5,
44 | AvoidRelegationFee = 6,
45 | InternationalCapFee = 7,
46 | UnusedSubstitutionFee = 8
47 | }
48 | }
49 |
50 |
--------------------------------------------------------------------------------
/FMScoutFrameworkTest/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("FMScoutFrameworkTest")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("FMScoutFrameworkTest")]
13 | [assembly: AssemblyCopyright("Copyright © 2015")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("bcf660c1-6538-4c64-bd2e-30c91c851ab2")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/FMScoutFramework.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.24720.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FMScoutFramework", "FMScoutFramework.csproj", "{E74FE82A-2E12-4C51-AD24-7D2DDE5C36A6}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FMScoutFrameworkTest", "FMScoutFrameworkTest\FMScoutFrameworkTest.csproj", "{316F5660-51E2-4B99-ADCB-DA6F2DD23909}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Windows-Debug|Any CPU = Windows-Debug|Any CPU
13 | Windows-Release|Any CPU = Windows-Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {E74FE82A-2E12-4C51-AD24-7D2DDE5C36A6}.Windows-Debug|Any CPU.ActiveCfg = Windows-Debug|Any CPU
17 | {E74FE82A-2E12-4C51-AD24-7D2DDE5C36A6}.Windows-Debug|Any CPU.Build.0 = Windows-Debug|Any CPU
18 | {E74FE82A-2E12-4C51-AD24-7D2DDE5C36A6}.Windows-Release|Any CPU.ActiveCfg = Windows-Release|Any CPU
19 | {E74FE82A-2E12-4C51-AD24-7D2DDE5C36A6}.Windows-Release|Any CPU.Build.0 = Windows-Release|Any CPU
20 | {316F5660-51E2-4B99-ADCB-DA6F2DD23909}.Windows-Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {316F5660-51E2-4B99-ADCB-DA6F2DD23909}.Windows-Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {316F5660-51E2-4B99-ADCB-DA6F2DD23909}.Windows-Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {316F5660-51E2-4B99-ADCB-DA6F2DD23909}.Windows-Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/Entities/Ingame/Sub-Entities/RivalNation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 | using FMScoutFramework.Core.Managers;
4 | using FMScoutFramework.Core.Offsets;
5 | using FMScoutFramework.Core.Attributes;
6 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
7 |
8 | namespace FMScoutFramework.Core.Entities.InGame
9 | {
10 | public class RivalNation : BaseObject, IRivalNation
11 | {
12 | public RivalNationOffsets RivalNationOffsets;
13 | public RivalNation (int memoryAddress, IVersion version)
14 | : base(memoryAddress, version)
15 | {
16 | this.RivalNationOffsets = new RivalNationOffsets(version);
17 | }
18 | public RivalNation(int memoryAddress, ArraySegmentoriginalBytes, IVersion version)
19 | : base(memoryAddress, originalBytes, version)
20 | {
21 | this.RivalNationOffsets = new RivalNationOffsets(version);
22 | }
23 |
24 | private int RivalNationAddress
25 | {
26 | get
27 | {
28 | return PropertyInvoker.Get(RivalNationOffsets.NationAddress, OriginalBytes, MemoryAddress, DatabaseMode);
29 | }
30 | }
31 |
32 | public Nation Nation
33 | {
34 | get
35 | {
36 | return PropertyInvoker.GetPointer(RivalNationOffsets.NationAddress, OriginalBytes, MemoryAddress, DatabaseMode, Version);
37 | }
38 | }
39 |
40 | public Byte Level
41 | {
42 | get
43 | {
44 | return PropertyInvoker.Get(RivalNationOffsets.Level, OriginalBytes, MemoryAddress, DatabaseMode);
45 | }
46 | }
47 |
48 | public override string ToString()
49 | {
50 | return this.Nation.Name;
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Entities/Ingame/BaseObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using FMScoutFramework.Core.Entities.GameVersions;
5 |
6 | namespace FMScoutFramework.Core.Entities.InGame
7 | {
8 | public class BaseObject
9 | {
10 | public int MemoryAddress;
11 | public ArraySegment OriginalBytes;
12 | public IVersion Version;
13 | public DatabaseModeEnum DatabaseMode;
14 |
15 | public BaseObject (int memoryAddress, IVersion version)
16 | {
17 | MemoryAddress = memoryAddress;
18 | Version = version;
19 | DatabaseMode = DatabaseModeEnum.Realtime;
20 | }
21 |
22 | public BaseObject(int memoryAddress, ArraySegment originalBytes, IVersion version)
23 | {
24 | MemoryAddress = memoryAddress;
25 | OriginalBytes = originalBytes;
26 | DatabaseMode = DatabaseModeEnum.Cached;
27 | Version = version;
28 | }
29 |
30 | public static bool operator ==(BaseObject a, BaseObject b)
31 | {
32 | if (System.Object.ReferenceEquals (a, b))
33 | return true;
34 |
35 | if (((object)a == null) || ((object)b == null))
36 | if ((object)a == null && (object)b == null)
37 | return true;
38 | else
39 | return false;
40 |
41 | if (a.MemoryAddress == b.MemoryAddress)
42 | return true;
43 | else
44 | return false;
45 | }
46 |
47 | public static bool operator !=(BaseObject a, BaseObject b)
48 | {
49 | if (!System.Object.ReferenceEquals(a, b))
50 | return true;
51 |
52 | if (((object)a == null) || ((object)b == null))
53 | if ((object)a == null && (object)b == null)
54 | return false;
55 | else
56 | return true;
57 |
58 | if (a.MemoryAddress != b.MemoryAddress)
59 | return true;
60 | else
61 | return false;
62 | }
63 |
64 | public override int GetHashCode()
65 | {
66 | return this.MemoryAddress.GetHashCode ();
67 | }
68 |
69 | public override bool Equals(object obj)
70 | {
71 | return base.GetHashCode ().Equals (obj.GetHashCode ());
72 | }
73 | }
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/Entities/Ingame/PersonAttributes.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
4 | using FMScoutFramework.Core.Managers;
5 | using FMScoutFramework.Core.Offsets;
6 |
7 | namespace FMScoutFramework.Core.Entities.InGame
8 | {
9 | public class PersonAttributes : BaseObject, IPersonAttributes
10 | {
11 | public PersonAttributes (int memoryAddress, IVersion version)
12 | : base(memoryAddress, version)
13 | { }
14 | public PersonAttributes (int memoryAddress, ArraySegment originalBytes, IVersion version)
15 | : base(memoryAddress, originalBytes, version)
16 | { }
17 |
18 | public byte Adaptability {
19 | get {
20 | return PropertyInvoker.Get (PersonAttributeOffsets.Adaptability, OriginalBytes, MemoryAddress, DatabaseMode);
21 | }
22 | }
23 |
24 | public byte Ambition {
25 | get {
26 | return PropertyInvoker.Get (PersonAttributeOffsets.Ambition, OriginalBytes, MemoryAddress, DatabaseMode);
27 | }
28 | }
29 |
30 | public byte Loyalty {
31 | get {
32 | return PropertyInvoker.Get (PersonAttributeOffsets.Loyalty, OriginalBytes, MemoryAddress, DatabaseMode);
33 | }
34 | }
35 |
36 | public byte Pressure {
37 | get {
38 | return PropertyInvoker.Get(PersonAttributeOffsets.Pressure, OriginalBytes, MemoryAddress, DatabaseMode);
39 | }
40 | }
41 |
42 | public byte Professionalism {
43 | get {
44 | return PropertyInvoker.Get (PersonAttributeOffsets.Professionalism, OriginalBytes, MemoryAddress, DatabaseMode);
45 | }
46 | }
47 |
48 | public byte Sportsmanship {
49 | get {
50 | return PropertyInvoker.Get(PersonAttributeOffsets.Sportsmanship, OriginalBytes, MemoryAddress, DatabaseMode);
51 | }
52 | }
53 |
54 | public byte Temperament {
55 | get {
56 | return PropertyInvoker.Get (PersonAttributeOffsets.Temperament, OriginalBytes, MemoryAddress, DatabaseMode);
57 | }
58 | }
59 |
60 | public byte Controversy {
61 | get {
62 | return PropertyInvoker.Get (PersonAttributeOffsets.Controversy, OriginalBytes, MemoryAddress, DatabaseMode);
63 | }
64 | }
65 | }
66 | }
67 |
68 |
--------------------------------------------------------------------------------
/FMScoutFrameworkTest/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFrameworkTest
2 | {
3 | partial class Form1
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.button1 = new System.Windows.Forms.Button();
32 | this.SuspendLayout();
33 | //
34 | // button1
35 | //
36 | this.button1.Location = new System.Drawing.Point(613, 211);
37 | this.button1.Name = "button1";
38 | this.button1.Size = new System.Drawing.Size(253, 87);
39 | this.button1.TabIndex = 0;
40 | this.button1.Text = "button1";
41 | this.button1.UseVisualStyleBackColor = true;
42 | this.button1.Click += new System.EventHandler(this.button1_Click);
43 | //
44 | // Form1
45 | //
46 | this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F);
47 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
48 | this.ClientSize = new System.Drawing.Size(1356, 509);
49 | this.Controls.Add(this.button1);
50 | this.Name = "Form1";
51 | this.Text = "Form1";
52 | this.ResumeLayout(false);
53 |
54 | }
55 |
56 | #endregion
57 |
58 | private System.Windows.Forms.Button button1;
59 | }
60 | }
61 |
62 |
--------------------------------------------------------------------------------
/Defines/Offsets/TeamOffsets.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 |
4 | namespace FMScoutFramework.Core.Offsets
5 | {
6 | public sealed class TeamOffsets
7 | {
8 | public IVersion Version;
9 |
10 | public TeamOffsets(IVersion version)
11 | {
12 | this.Version = version;
13 | }
14 |
15 | public const short RowID = 0x4;
16 | public const short ID = 0x8;
17 | public const short Club = 0x10;
18 | public const short PreviousReputation = 0x1A;
19 | public const short TeamType = 0x1C;
20 | public const short Manager = 0x4C;
21 |
22 | public short Players
23 | {
24 | get
25 | {
26 | if (Version.GetType() == typeof(Steam_16_3_0_Windows) ||
27 | Version.GetType() == typeof(Steam_16_3_1_Windows) ||
28 | Version.GetType() == typeof(Steam_16_3_2_Windows))
29 | {
30 | return 0x24;
31 | }
32 | else
33 | {
34 | return 0x28;
35 | }
36 | }
37 | }
38 |
39 | public short Stadium
40 | {
41 | get
42 | {
43 | if (Version.GetType() == typeof(Steam_16_3_0_Windows) ||
44 | Version.GetType() == typeof(Steam_16_3_1_Windows) ||
45 | Version.GetType() == typeof(Steam_16_3_2_Windows))
46 | {
47 | return 0x40;
48 | }
49 | else
50 | {
51 | return 0x48;
52 | }
53 | }
54 | }
55 |
56 | public short Reputation
57 | {
58 | get
59 | {
60 | if (Version.GetType() == typeof(Steam_16_3_0_Windows) ||
61 | Version.GetType() == typeof(Steam_16_3_1_Windows) ||
62 | Version.GetType() == typeof(Steam_16_3_2_Windows))
63 | {
64 | return 0x64;
65 | }
66 | else
67 | {
68 | return 0x68;
69 | }
70 | }
71 | }
72 | }
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/Entities/Ingame/City.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
4 | using FMScoutFramework.Core.Managers;
5 | using FMScoutFramework.Defines.Offsets;
6 |
7 | namespace FMScoutFramework.Core.Entities.InGame
8 | {
9 | public class City : BaseObject, ICity
10 | {
11 | public City (int memoryAddress, IVersion version)
12 | : base(memoryAddress, version)
13 | { }
14 | public City (int memoryAddress, ArraySegment originalBytes, IVersion version)
15 | : base(memoryAddress, originalBytes, version)
16 | { }
17 |
18 | public int ID
19 | {
20 | get
21 | {
22 | return PropertyInvoker.Get(CityOffsets.ID, OriginalBytes, MemoryAddress, DatabaseMode);
23 | }
24 | }
25 |
26 | public int RowID
27 | {
28 | get
29 | {
30 | return PropertyInvoker.Get(CityOffsets.RowID, OriginalBytes, MemoryAddress, DatabaseMode);
31 | }
32 | }
33 |
34 | public string Name
35 | {
36 | get
37 | {
38 | return PropertyInvoker.GetString(CityOffsets.Name, -1, OriginalBytes, MemoryAddress, DatabaseMode);
39 | }
40 | }
41 |
42 | public Nation Nation
43 | {
44 | get
45 | {
46 | return PropertyInvoker.GetPointer(CityOffsets.Nation, OriginalBytes, MemoryAddress, DatabaseMode, Version);
47 | }
48 | }
49 |
50 | public short Attraction
51 | {
52 | get
53 | {
54 | return PropertyInvoker.Get(CityOffsets.Attraction, OriginalBytes, MemoryAddress, DatabaseMode);
55 | }
56 | }
57 |
58 | public float Latitude
59 | {
60 | get
61 | {
62 | return PropertyInvoker.Get(CityOffsets.Latitude, OriginalBytes, MemoryAddress, DatabaseMode);
63 | }
64 | }
65 |
66 | public float Longitude
67 | {
68 | get
69 | {
70 | return PropertyInvoker.Get(CityOffsets.Longitude, OriginalBytes, MemoryAddress, DatabaseMode);
71 | }
72 | }
73 |
74 | public short Altitude
75 | {
76 | get
77 | {
78 | return PropertyInvoker.Get(CityOffsets.Altitude, OriginalBytes, MemoryAddress, DatabaseMode);
79 | }
80 | }
81 | }
82 | }
83 |
84 |
--------------------------------------------------------------------------------
/Entities/Ingame/Interfaces/IPlayerStats.cs:
--------------------------------------------------------------------------------
1 | namespace FMScoutFramework.Core.Entities.InGame.Interfaces
2 | {
3 | public interface IPlayerStats
4 | {
5 | byte Acceleration { get; }
6 | byte AerialAbility { get; }
7 | byte Aggression { get; }
8 | byte Agility { get; }
9 | byte Anticipation { get; }
10 | byte AttackingMidfielderCenter { get; }
11 | byte AttackingMidfielderLeft { get; }
12 | byte AttackingMidfielderRight { get; }
13 | byte Balance { get; }
14 | byte Bravery { get; }
15 | byte CommandOfArea { get; }
16 | byte Communication { get; }
17 | byte Composure { get; }
18 | byte Concentration { get; }
19 | byte Consistency { get; }
20 | byte Corners { get; }
21 | byte Creativity { get; }
22 | byte Crossing { get; }
23 | byte Decisions { get; }
24 | byte DefenderCenter { get; }
25 | byte DefenderLeft { get; }
26 | byte DefenderRight { get; }
27 | byte DefensiveMidfielder { get; }
28 | byte Determination { get; }
29 | byte Dirtiness { get; }
30 | byte Dribbling { get; }
31 | byte Eccentricity { get; }
32 | byte Finishing { get; }
33 | byte FirstTouch { get; }
34 | byte Flair { get; }
35 | byte FreekickTaking { get; }
36 | byte Goalkeeper { get; }
37 | byte Handling { get; }
38 | byte Heading { get; }
39 | byte ImportantMatches { get; }
40 | byte Influence { get; }
41 | byte InjuryProneness { get; }
42 | byte Jumping { get; }
43 | byte Kicking { get; }
44 | byte LeftFoot { get; }
45 | byte LongShots { get; }
46 | byte LongThrows { get; }
47 | byte Marking { get; }
48 | byte MidfielderCenter { get; }
49 | byte MidfielderLeft { get; }
50 | byte MidfielderRight { get; }
51 | byte NaturalFitness { get; }
52 | byte OffTheBall { get; }
53 | byte OneOnOnes { get; }
54 | byte Pace { get; }
55 | byte Passing { get; }
56 | byte Penalties { get; }
57 | string Position { get; }
58 | byte Positioning { get; }
59 | byte Reflexes { get; }
60 | byte RightFoot { get; }
61 | byte RushingOut { get; }
62 | byte Stamina { get; }
63 | byte Strength { get; }
64 | byte Striker { get; }
65 | byte Sweeper { get; }
66 | byte Tackling { get; }
67 | byte Teamwork { get; }
68 | byte Technique { get; }
69 | byte TendencyToPunch { get; }
70 | byte Throwing { get; }
71 | byte Versatility { get; }
72 | byte WingbackLeft { get; }
73 | byte WingbackRight { get; }
74 | byte Workrate { get; }
75 | }
76 | }
--------------------------------------------------------------------------------
/FMScoutFrameworkTest/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.34014
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace FMScoutFrameworkTest.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FMScoutFrameworkTest.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/Defines/Offsets/PersonTypes/Sub-Entities/PlayerStatsOffsets.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace FMScoutFramework.Core.Offsets
4 | {
5 | public sealed class PlayerStatsOffsets
6 | {
7 | public const short GoalKeeper = 0x0;
8 | public const short Sweeper = 0x1;
9 | public const short DefenderLeft = 0x2;
10 | public const short DefenderCenter = 0x3;
11 | public const short DefenderRight = 0x4;
12 | public const short DefensiveMidfielder = 0x5;
13 | public const short MidfielderLeft = 0x6;
14 | public const short MidfielderCenter = 0x7;
15 | public const short MidfielderRight = 0x8;
16 | public const short AttackingMidfielderLeft = 0x9;
17 | public const short AttackingMidfielderCenter = 0xA;
18 | public const short AttackingMidfielderRight = 0xB;
19 | public const short Striker = 0xC;
20 | public const short WingbackLeft = 0xD;
21 | public const short WingbackRight = 0xE;
22 |
23 | public const short Crossing = 0xF;
24 | public const short Dribbling = 0x10;
25 | public const short Finishing = 0x11;
26 | public const short Heading = 0x12;
27 | public const short LongShots = 0x13;
28 | public const short Marking = 0x14;
29 | public const short OffTheBall = 0x15;
30 | public const short Passing = 0x16;
31 | public const short Penalties = 0x17;
32 | public const short Tackling = 0x18;
33 | public const short Creativity = 0x19;
34 | public const short Handling = 0x1A;
35 | public const short AerialAbility = 0x1B;
36 | public const short CommandOfArea = 0x1C;
37 | public const short Communication = 0x1D;
38 | public const short Kicking = 0x1E;
39 | public const short Throwing = 0x1F;
40 | public const short Anticipation = 0x20;
41 | public const short Decisions = 0x21;
42 | public const short OneOnOnes = 0x22;
43 | public const short Positioning = 0x23;
44 | public const short Reflexes = 0x24;
45 | public const short FirstTouch = 0x25;
46 | public const short Technique = 0x26;
47 | public const short LeftFoot = 0x27;
48 | public const short RightFoot = 0x28;
49 | public const short Flair = 0x29;
50 | public const short Corners = 0x2A;
51 | public const short Teamwork = 0x2B;
52 | public const short WorkRate = 0x2C;
53 | public const short LongThrows = 0x2D;
54 | public const short Eccentricity = 0x2E;
55 | public const short RushingOut = 0x2F;
56 | public const short TendencyToPunch = 0x30;
57 | public const short Acceleration = 0x31;
58 | public const short FreekickTaking = 0x32;
59 | public const short Strength = 0x33;
60 | public const short Stamina = 0x34;
61 | public const short Pace = 0x35;
62 | public const short Jumping = 0x36;
63 | public const short Influence = 0x37;
64 | public const short Dirtiness = 0x38;
65 | public const short Balance = 0x39;
66 | public const short Bravery = 0x3A;
67 | public const short Consistency = 0x3B;
68 | public const short Aggression = 0x3C;
69 | public const short Agility = 0x3D;
70 | public const short ImportantMatches = 0x3E;
71 | public const short InjuryProneness = 0x3F;
72 | public const short Versatility = 0x40;
73 | public const short NaturalFitness = 0x41;
74 | public const short Determination = 0x42;
75 | public const short Composure = 0x43;
76 | public const short Concentration = 0x44;
77 | }
78 | }
79 |
80 |
--------------------------------------------------------------------------------
/FMCore.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using FMScoutFramework.Core.Managers;
6 | using FMScoutFramework.Core.Entities;
7 | using FMScoutFramework.Core.Entities.InGame;
8 |
9 | namespace FMScoutFramework.Core
10 | {
11 | public class FMCore : IDisposable
12 | {
13 | public GameManager gameManager = null;
14 | public ObjectManager objectManager = null;
15 |
16 | public DatabaseModeEnum DatabaseMode { get; private set; }
17 |
18 | public event Action GameLoaded = () => {};
19 |
20 | public FMCore(DatabaseModeEnum databaseMode)
21 | {
22 | DatabaseMode = databaseMode;
23 | }
24 |
25 | public FMCore ()
26 | {
27 | DatabaseMode = DatabaseModeEnum.Realtime;
28 | }
29 |
30 | #region Objects
31 | public IEnumerable Continents { get { return GetListFromStore (); } }
32 | public IEnumerable Cities { get { return GetListFromStore (); } }
33 | public IEnumerable Clubs { get { return GetListFromStore (); } }
34 | public IEnumerable Nations { get { return GetListFromStore (); } }
35 | public IEnumerable Players { get { return GetListFromStore (); } }
36 | public IEnumerable Staff { get { return GetListFromStore (); } }
37 | public IEnumerable PlayerStaff { get { return GetListFromStore (); } }
38 |
39 | private IQueryable GetListFromStore()
40 | {
41 | return ((Dictionary)objectManager.ObjectStore [typeof(T)]).Values.AsQueryable ();
42 | }
43 | #endregion
44 |
45 | public void LoadData()
46 | {
47 | LoadData (false);
48 | }
49 |
50 | public void LoadData(bool refreshPersonCache)
51 | {
52 | CheckProcessAndGame ();
53 | LoadDataForCheckedGame (refreshPersonCache);
54 | }
55 |
56 | public bool CheckProcessAndGame()
57 | {
58 | if (gameManager == null) {
59 | gameManager = new GameManager ();
60 | gameManager.FMLoading = true;
61 | gameManager.findFMProcess ();
62 | gameManager.FMLoading = false;
63 | }
64 |
65 | return gameManager.FMLoaded;
66 | }
67 |
68 | public void LoadDataForCheckedGame(bool refreshPersonCache)
69 | {
70 | if (objectManager == null)
71 | objectManager = new ObjectManager (gameManager, DatabaseMode);
72 |
73 | objectManager.Load (refreshPersonCache);
74 | GameLoaded ();
75 | }
76 |
77 | public MetaDataCls MetaData { get { return new MetaDataCls (this, this.objectManager, gameManager); } }
78 |
79 | #region IDisposable Members
80 | public void Dispose()
81 | {
82 | }
83 | #endregion
84 | }
85 |
86 | public class MetaDataCls
87 | {
88 | private readonly Global glob;
89 | private readonly GameManager gameManager;
90 |
91 | internal MetaDataCls(FMCore fmCore, ObjectManager objectManager, GameManager gameManager)
92 | {
93 | this.gameManager = gameManager;
94 | glob = new Global (gameManager.Version);
95 | }
96 |
97 | public string CurrentVersion {
98 | get { return gameManager.Version.Description; }
99 | }
100 |
101 | public DateTime InGameDate {
102 | get { return glob.InGameDate; }
103 | }
104 | }
105 | }
106 |
107 |
--------------------------------------------------------------------------------
/Entities/Ingame/Person.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Managers;
3 | using FMScoutFramework.Core.Attributes;
4 | using FMScoutFramework.Core.Offsets;
5 | using FMScoutFramework.Core.Entities.GameVersions;
6 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
7 | using FMScoutFramework.Core.Utilities;
8 |
9 | namespace FMScoutFramework.Core.Entities.InGame
10 | {
11 | public class Person : BaseObject, IPerson
12 | {
13 | public PersonOffsets PersonOffsets;
14 | public Person (int memoryAddress, IVersion version)
15 | : base(memoryAddress, version)
16 | {
17 | this.PersonOffsets = new PersonOffsets(version);
18 | }
19 | public Person (int memoryAddress, ArraySegment originalBytes, IVersion version)
20 | : base(memoryAddress, originalBytes, version)
21 | {
22 | this.PersonOffsets = new PersonOffsets(version);
23 | }
24 |
25 | protected virtual int PersonAddress {
26 | get {
27 | return (MemoryAddress + Version.PersonOffsets.Person);
28 | }
29 | }
30 |
31 | public DateTime DateOfBirth {
32 | get {
33 | return PropertyInvoker.Get (PersonOffsets.DateOfBirth, OriginalBytes, PersonAddress, DatabaseMode);
34 | }
35 | set
36 | {
37 | PropertyInvoker.Set(PersonOffsets.DateOfBirth, OriginalBytes, PersonAddress, DatabaseMode, value);
38 | }
39 | }
40 |
41 | public int Age {
42 | get {
43 | DateTime now = DateTime.Today;
44 | int age = now.Year - DateOfBirth.Year;
45 | if (DateOfBirth > now.AddYears (-age))
46 | age--;
47 | return age;
48 | }
49 | }
50 |
51 | public string Fullname {
52 | get {
53 | return PropertyInvoker.GetString (PersonOffsets.Fullname, -1, OriginalBytes, PersonAddress, DatabaseMode);
54 | }
55 | }
56 |
57 | public string Nickname {
58 | get {
59 | return PropertyInvoker.GetString(PersonOffsets.Nickname, Version.MemoryAddresses.StringOffset, OriginalBytes, PersonAddress, DatabaseMode);
60 | }
61 | }
62 |
63 | public string Firstname {
64 | get {
65 | return PropertyInvoker.GetString(PersonOffsets.Firstname, Version.MemoryAddresses.StringOffset, OriginalBytes, PersonAddress, DatabaseMode);
66 | }
67 | }
68 |
69 | public string Lastname {
70 | get {
71 | return PropertyInvoker.GetString(PersonOffsets.Lastname, Version.MemoryAddresses.StringOffset, OriginalBytes, PersonAddress, DatabaseMode);
72 | }
73 | }
74 |
75 | public Nation Nationality {
76 | get {
77 | return PropertyInvoker.GetPointer (PersonOffsets.Nationality, OriginalBytes, PersonAddress, DatabaseMode, Version);
78 | }
79 | }
80 |
81 | public PersonAttributes Attributes {
82 | get {
83 | int AttributesAddress = PersonAddress + PersonOffsets.Attributes;
84 | return new PersonAttributes (AttributesAddress, Version);
85 | }
86 | }
87 |
88 | public Contract Contract {
89 | get {
90 | return PropertyInvoker.GetPointer (PersonOffsets.Contract, OriginalBytes, PersonAddress, DatabaseMode, Version);
91 | }
92 | }
93 |
94 | public Club Club {
95 | get {
96 | return PropertyInvoker.GetPointer (PersonOffsets.Club, OriginalBytes, PersonAddress, DatabaseMode, Version);
97 | }
98 | }
99 | }
100 | }
--------------------------------------------------------------------------------
/Defines/Offsets/Sub-Entities/ClubFinancesOffsets.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 |
4 | namespace FMScoutFramework.Core.Offsets
5 | {
6 | public sealed class ClubFinancesOffsets
7 | {
8 | public IVersion Version;
9 |
10 | public ClubFinancesOffsets(IVersion version)
11 | {
12 | this.Version = version;
13 | }
14 |
15 | public const short Balance = 0xC;
16 | public const short AverageTicketPrice = 0x10;
17 | public const short AverageSeasonTicketPrice = 0x14;
18 | public const short EmbargoStartDate = 0x24;
19 | public const short EmbargoEndDate = 0x28;
20 | public const short EmbargoAppealDate = 0x2C;
21 | public const short SugarDaddy = 0x31;
22 | public const short RemainingBudget = 0x3C;
23 | public const short SeasonTransferFunds = 0x40;
24 | public const short TransferIncomePercentage = 0x44;
25 | public const short YouthGrantIncome = 0x4C;
26 | public const short HighestWagePaid = 0x84;
27 |
28 | public short LatestSeasonTicketSales
29 | {
30 | get
31 | {
32 | if (Version.GetType() == typeof(Steam_14_3_0_Linux) ||
33 | Version.GetType() == typeof(Steam_14_3_0_Windows) ||
34 | Version.GetType() == typeof(Steam_14_3_0_Mac) ||
35 | Version.GetType() == typeof(Steam_14_3_1_Linux) ||
36 | Version.GetType() == typeof(Steam_14_3_1_Windows) ||
37 | Version.GetType() == typeof(Steam_14_3_1_Mac))
38 | {
39 | return 0xAC;
40 | }
41 | else if (Version.GetType() == typeof(Steam_15_2_1_Windows))
42 | {
43 | return 0xB0;
44 | }
45 |
46 | return 0x0;
47 | }
48 | }
49 |
50 | public short WeeklyWageBudget
51 | {
52 | get
53 | {
54 | if (Version.GetType() == typeof(Steam_16_3_0_Windows) ||
55 | Version.GetType() == typeof(Steam_16_3_1_Windows) ||
56 | Version.GetType() == typeof(Steam_16_3_2_Windows))
57 | {
58 | return 0x74;
59 | }
60 |
61 | return 0x70;
62 | }
63 | }
64 |
65 | public short HighestWage
66 | {
67 | get
68 | {
69 | if (Version.GetType() == typeof(Steam_16_3_0_Windows) ||
70 | Version.GetType() == typeof(Steam_16_3_1_Windows) ||
71 | Version.GetType() == typeof(Steam_16_3_2_Windows))
72 | {
73 | return 0x78;
74 | }
75 |
76 | return 0x74;
77 | }
78 | }
79 |
80 | public short WeeklyWageBudgetUsed
81 | {
82 | get
83 | {
84 | if (Version.GetType() == typeof(Steam_16_3_0_Windows) ||
85 | Version.GetType() == typeof(Steam_16_3_1_Windows) ||
86 | Version.GetType() == typeof(Steam_16_3_2_Windows))
87 | {
88 | return 0x7c;
89 | }
90 |
91 | return 0x78;
92 | }
93 | }
94 |
95 | }
96 | }
97 |
98 |
--------------------------------------------------------------------------------
/Defines/Offsets/NationOffsets.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 |
4 | namespace FMScoutFramework.Core.Offsets
5 | {
6 | public sealed class NationOffsets
7 | {
8 | public IVersion Version;
9 |
10 | public NationOffsets(IVersion version)
11 | {
12 | this.Version = version;
13 | }
14 |
15 | public const short RowID = 0x4;
16 | public const short ID = 0x8;
17 | public const short Teams = 0x10;
18 | public const short RivalNations = 0x28;
19 |
20 | public short Name
21 | {
22 | get
23 | {
24 | if (Version.GetType() == typeof(Steam_14_3_0_Linux) ||
25 | Version.GetType() == typeof(Steam_14_3_0_Mac) ||
26 | Version.GetType() == typeof(Steam_14_3_1_Linux) ||
27 | Version.GetType() == typeof(Steam_15_3_2_Windows) ||
28 | Version.GetType() == typeof(Steam_15_3_2_Mac) ||
29 | Version.GetType() == typeof(Steam_16_2_0_Windows) ||
30 | Version.GetType() == typeof(Steam_16_3_0_Windows) ||
31 | Version.GetType() == typeof(Steam_16_3_1_Windows) ||
32 | Version.GetType() == typeof(Steam_16_3_2_Windows))
33 | {
34 | return 0x54;
35 | }
36 | else
37 | {
38 | return 0x68;
39 | }
40 | }
41 | }
42 |
43 | public const short ShortName = 0x58;
44 | public const short ThreeLetterName = 0x60;
45 | public const short Nationality = 0x64;
46 | public const short SpokenLanguages = 0x6C;
47 | public const short UnknownList1 = 0x74; // Points to list of UIDs
48 | public const short TaxRules = 0x78;
49 | public const short UnknownArray1 = 0x84; // Array of Nations
50 | public const short NationTransferPreferences = 0x90;
51 | public const short ContinentTransferPreferences = 0x9C;
52 | public const short RegionTransferPreferences = 0xA8;
53 | public const short Capital = 0xD8;
54 | public const short Continent = 0xDC;
55 | public const short Region = 0xE0;
56 | public const short Currency = 0xE4;
57 | public const short FIFAPosition = 0x15C;
58 | public const short FIFARankingPoints = 0x15E;
59 | public const short UnknownArray2 = 0x198; // Array of pointers to Int16 + Date (with time)
60 | public const short EUROCoefficients = 0x1BC;
61 | public const short UnknownFloat1 = 0x208;
62 | public const short UnknownFloat2 = 0x20C;
63 | public const short UnknownArray3 = 0x234; // Unknown Shortlist
64 | public const short MainSquadGKShortlist = 0x278;
65 | public const short MainSquadDefShortlist = 0x284;
66 | public const short MainSquadMidShortlist = 0x290;
67 | public const short MainSquadFWShortlist = 0x29C;
68 | public const short U21GKShortlist = 0x2A8;
69 | public const short U21DefShortlist = 0x2B4;
70 | public const short U21MidShortlist = 0x2C0;
71 | public const short U21FWShortlist = 0x2CC;
72 | public const short U19GKShortlist = 0x2D8;
73 | public const short U19DefShortlist = 0x2E4;
74 | public const short U19MidShortlist = 0x2F0;
75 | public const short U19FWShortlist = 0x2FC;
76 | // A lot of unknown shortlist from here on. Can someone help?
77 | }
78 | }
79 |
80 |
--------------------------------------------------------------------------------
/VirtualMemory/ProcessMemoryAPI.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Runtime.InteropServices;
4 | using System.Text.RegularExpressions;
5 |
6 | namespace FMScoutFramework
7 | {
8 | internal sealed class ProcessMemoryAPI
9 | {
10 | #if MAC
11 | [DllImport("libprocessmemoryapi.dylib")]
12 | public static extern IntPtr ReadProcessBytes (int pid, UInt64 address, int size);
13 |
14 | [DllImport("libprocessmemoryapi.dylib")]
15 | public static extern bool CanReadAtAddress(int pid, UInt64 address, int size);
16 | #endif
17 | #if LINUX
18 | [DllImport("libprocessmemoryinterface.1.0.so")]
19 | public static extern int ReadProcessMemory(int pid, ulong address, ulong length, [In, Out]byte[] buffer);
20 |
21 | public static bool GetBaseAddress (uint ProcessID, out uint buffer, out uint bufferend, out uint heap, out uint endaddress)
22 | {
23 | // Get access to the mem map file
24 | string[] memoryMap = null;
25 | try
26 | {
27 | memoryMap = File.ReadAllLines ("/proc/" + ProcessID.ToString () + "/maps");
28 | }
29 | catch {
30 | buffer = 0;
31 | bufferend = 0;
32 | heap = 0;
33 | endaddress = 0;
34 | return false;
35 | }
36 |
37 | // Find the heap and get the starting offset of the block before it
38 | string staticBlockAddressLine = "";
39 | string heapAddressLine = "";
40 | int i = 0;
41 | foreach (string line in memoryMap) {
42 | if (line.Contains ("[heap]")) {
43 | heapAddressLine = memoryMap [i];
44 | staticBlockAddressLine = memoryMap [i - 3];
45 | break;
46 | }
47 | i++;
48 | }
49 |
50 | if (staticBlockAddressLine.Length <= 0) {
51 | buffer = 0;
52 | bufferend = 0;
53 | heap = 0;
54 | endaddress = 0;
55 | return false;
56 | }
57 |
58 | // Now extract the starting address from the memory map
59 | try {
60 | MatchCollection matches = Regex.Matches(staticBlockAddressLine, "([0-9a-f]+)");
61 | String baseAddress = matches[0].ToString();
62 | buffer = UInt32.Parse (baseAddress, System.Globalization.NumberStyles.HexNumber);
63 | String baseEndAddress = matches[1].ToString();
64 | bufferend = UInt32.Parse (baseEndAddress, System.Globalization.NumberStyles.HexNumber);
65 |
66 | matches = Regex.Matches(heapAddressLine, "([0-9a-f]+)");
67 | String heapAddress = matches[0].ToString();
68 | heap = UInt32.Parse(heapAddress, System.Globalization.NumberStyles.HexNumber);
69 | String end = matches[1].ToString();
70 | endaddress = UInt32.Parse(end, System.Globalization.NumberStyles.HexNumber);
71 | }
72 | catch {
73 | buffer = 0;
74 | bufferend = 0;
75 | heap = 0;
76 | endaddress = 0;
77 | return false;
78 | }
79 |
80 | return true;
81 | }
82 | #endif
83 | #if WINDOWS
84 |
85 | [DllImport("kernel32.dll")]
86 | public static extern IntPtr OpenProcess(uint dwDesiredAccess, int bInheritHandle, uint dwProcessId);
87 |
88 | [DllImport("kernel32.dll")]
89 | public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [Out] byte[] lpBuffer, int dwSize, out int lpNumberOfBytesRead);
90 |
91 | [DllImport("kernel32.dll")]
92 | public static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] buffer, uint size, out IntPtr lpNumberOfBytesRead);
93 |
94 | [DllImport("kernel32.dll")]
95 | public static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [In, Out] byte[] buffer, uint size, out IntPtr lpNumberOfBytesWritten);
96 | #endif
97 | }
98 | }
99 |
100 |
--------------------------------------------------------------------------------
/Entities/Ingame/ContractClauses.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Globalization;
3 | using FMScoutFramework.Core.Entities.GameVersions;
4 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
5 | using FMScoutFramework.Core.Managers;
6 | using FMScoutFramework.Core.Offsets;
7 |
8 | namespace FMScoutFramework.Core.Entities.InGame
9 | {
10 | public class ContractClause : BaseObject, IContractClause
11 | {
12 | public ContractClause (int memoryAddress, IVersion version)
13 | : base(memoryAddress, version)
14 | { }
15 | public ContractClause (int memoryAddress, ArraySegment originalBytes, IVersion version)
16 | : base(memoryAddress, originalBytes, version)
17 | { }
18 |
19 | public Int32 Value {
20 | get {
21 | return PropertyInvoker.Get (ContractClausesOffsets.Value, OriginalBytes, MemoryAddress, DatabaseMode);
22 | }
23 | }
24 |
25 | public ClauseType Type {
26 | get {
27 | return (ClauseType)PropertyInvoker.Get (ContractClausesOffsets.Type, OriginalBytes, MemoryAddress, DatabaseMode);
28 | }
29 | }
30 |
31 | public byte Info {
32 | get {
33 | return PropertyInvoker.Get (ContractClausesOffsets.Info, OriginalBytes, MemoryAddress, DatabaseMode);
34 | }
35 | }
36 |
37 | public override string ToString ()
38 | {
39 | string result = "";
40 | switch (this.Type) {
41 | case ClauseType.YearlyWageRise:
42 | case ClauseType.PromotionWageIncrease:
43 | case ClauseType.RelegationWageDecrease:
44 | case ClauseType.SellOnFeeProfit:
45 | case ClauseType.TopDivisionPromotionWageRise:
46 | case ClauseType.TopDivisionRelegationWageDrop:
47 | result = string.Format ("{0}%", this.Value);
48 | break;
49 | case ClauseType.SellOnFee:
50 | result = string.Format ("{0}%", this.Info);
51 | break;
52 | case ClauseType.OneYearExtensionAfterLeagueGamesFinalSeason:
53 | result = string.Format ("{0} Games", this.Info);
54 | break;
55 | case ClauseType.SeasonalLandmarkGoalBonus:
56 | result = string.Format("{0} ({1})", this.Info, this.Value.ToString("C0", CultureInfo.CreateSpecificCulture("en-GB")));
57 | break;
58 | case ClauseType.WageAfterReachingInternationalCaps:
59 | case ClauseType.WageAfterReachingClubCareerLeagueGames:
60 | result = string.Format ("{0}/pw {1}", this.Value.ToString ("C0", CultureInfo.CreateSpecificCulture ("en-GB")), this.Info);
61 | break;
62 | case ClauseType.OptionalContractExtensionByClub:
63 | result = string.Format ("{0} Year(s)", this.Info);
64 | break;
65 | default:
66 | result = this.Value.ToString ("C0", CultureInfo.CreateSpecificCulture ("en-GB"));
67 | break;
68 | }
69 |
70 | return result;
71 | }
72 | }
73 |
74 | public enum ClauseType {
75 | MinimumFeeRelease = 0,
76 | RelegationFeeRelease = 1,
77 | NonPromotionRelease = 2,
78 | YearlyWageRise = 3,
79 | PromotionWageIncrease = 4,
80 | RelegationWageDecrease = 5,
81 | StaffJobRelease = 6,
82 | UnknownType7 = 7,
83 | SellOnFee = 8,
84 | SellOnFeeProfit = 9,
85 | SeasonalLandmarkGoalBonus = 10,
86 | OneYearExtensionAfterLeagueGamesFinalSeason = 11,
87 | MatchHighestEarner = 12,
88 | WageAfterReachingClubCareerLeagueGames = 13,
89 | TopDivisionPromotionWageRise = 14,
90 | TopDivisionRelegationWageDrop = 15,
91 | MinimumFeeReleaseToForeignClubs = 16,
92 | MinimumFeeReleaseToHigherDivisionClubs = 17,
93 | MinimumFeeReleaseToDomesticClubs = 18,
94 | WageAfterReachingInternationalCaps = 19,
95 | UnknownType20 = 20,
96 | UnknownType21 = 21,
97 | OptionalContractExtensionByClub = 22
98 | }
99 | }
100 |
101 |
--------------------------------------------------------------------------------
/Entities/Ingame/Nation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 | using FMScoutFramework.Core.Managers;
4 | using FMScoutFramework.Core.Offsets;
5 | using FMScoutFramework.Core.Attributes;
6 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
7 |
8 | namespace FMScoutFramework.Core.Entities.InGame
9 | {
10 | public class Nation : BaseObject, INation
11 | {
12 | public NationOffsets NationOffsets;
13 | public Nation (int memoryAddress, IVersion version)
14 | : base(memoryAddress, version)
15 | {
16 | this.NationOffsets = new NationOffsets(Version);
17 | }
18 | public Nation (int memoryAddress, ArraySegment originalBytes, IVersion version)
19 | : base(memoryAddress, originalBytes, version)
20 | {
21 | this.NationOffsets = new NationOffsets(Version);
22 | }
23 |
24 | public Int32 RowID {
25 | get {
26 | return ProcessManager.ReadInt32 (MemoryAddress + NationOffsets.RowID);
27 | }
28 | }
29 |
30 | public Int32 ID {
31 | get {
32 | return ProcessManager.ReadInt32 (MemoryAddress + NationOffsets.ID);
33 | }
34 | }
35 |
36 | public Team[] Teams
37 | {
38 | get
39 | {
40 | int teamCount = ProcessManager.ReadArrayLength(MemoryAddress + NationOffsets.Teams);
41 | Team[] result = new Team[teamCount];
42 |
43 | for (int i = 0; i < teamCount; i++)
44 | {
45 | int teamAddress = PropertyInvoker.Get(NationOffsets.Teams, OriginalBytes, MemoryAddress, DatabaseMode);
46 | result[i] = PropertyInvoker.GetPointer(0x0, OriginalBytes, (teamAddress + (i * 4)), DatabaseMode, Version);
47 | }
48 |
49 | return result;
50 | }
51 | }
52 |
53 | public RivalNation[] RivalNations
54 | {
55 | get
56 | {
57 | int nationCount = ProcessManager.ReadArrayLength(MemoryAddress + NationOffsets.RivalNations, 0xC);
58 | RivalNation[] result = new RivalNation[nationCount];
59 |
60 | for (int i = 0; i < nationCount; i++)
61 | {
62 | int nationAddress = PropertyInvoker.Get(NationOffsets.RivalNations, OriginalBytes, MemoryAddress, DatabaseMode);
63 | result[i] = new RivalNation((nationAddress + (i * 0xC)), Version);
64 | }
65 |
66 | return result;
67 | }
68 | }
69 |
70 | public string Name {
71 | get {
72 | return PropertyInvoker.GetString(NationOffsets.Name, -1, OriginalBytes, MemoryAddress, DatabaseMode);
73 | }
74 | }
75 |
76 | public string ShortName {
77 | get {
78 | return PropertyInvoker.GetString (NationOffsets.ShortName, -1, OriginalBytes, MemoryAddress, DatabaseMode);
79 | }
80 | }
81 |
82 | public string ThreeLetterName {
83 | get {
84 | return PropertyInvoker.GetString (NationOffsets.ThreeLetterName, -1, OriginalBytes, MemoryAddress, DatabaseMode);
85 | }
86 | }
87 |
88 | public string NationalityName {
89 | get {
90 | return PropertyInvoker.GetString (NationOffsets.Nationality, -1, OriginalBytes, MemoryAddress, DatabaseMode);
91 | }
92 | }
93 |
94 | // TODO: SpokenLanguages
95 |
96 |
97 |
98 | public override string ToString ()
99 | {
100 | return Name;
101 | }
102 | }
103 | }
104 |
105 |
--------------------------------------------------------------------------------
/Entities/Ingame/Club.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 | using FMScoutFramework.Core.Managers;
4 | using FMScoutFramework.Core.Offsets;
5 | using FMScoutFramework.Core.Attributes;
6 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
7 |
8 | namespace FMScoutFramework.Core.Entities.InGame
9 | {
10 | public class Club : BaseObject, IClub
11 | {
12 | public ClubOffsets ClubOffsets;
13 | public Club (int memoryAddress, IVersion version)
14 | : base(memoryAddress, version)
15 | {
16 | this.ClubOffsets = new ClubOffsets(Version);
17 | }
18 | public Club (int memoryAddress, ArraySegment originalBytes, IVersion version)
19 | : base(memoryAddress, originalBytes, version)
20 | {
21 | this.ClubOffsets = new ClubOffsets(Version);
22 | }
23 |
24 | public Int32 RowID {
25 | get {
26 | return PropertyInvoker.Get (ClubOffsets.RowID, OriginalBytes, MemoryAddress, DatabaseMode);
27 | }
28 | }
29 |
30 | public Int32 ID {
31 | get {
32 | return PropertyInvoker.Get (ClubOffsets.ID, OriginalBytes, MemoryAddress, DatabaseMode);
33 | }
34 | }
35 |
36 | public Team[] Teams {
37 | get {
38 | int teamCount = ProcessManager.ReadArrayLength (MemoryAddress + ClubOffsets.Teams);
39 | Team[] result = new Team[teamCount];
40 |
41 | for(int i = 0; i < teamCount; i++) {
42 | int teamAddress = PropertyInvoker.Get (ClubOffsets.Teams, OriginalBytes, MemoryAddress, DatabaseMode);
43 | result [i] = PropertyInvoker.GetPointer (0x0, OriginalBytes, (teamAddress + (i * 4)), DatabaseMode, Version);
44 | }
45 |
46 | return result;
47 | }
48 | }
49 |
50 | public string Name {
51 | get {
52 | return PropertyInvoker.GetString (ClubOffsets.Name, -1, OriginalBytes, MemoryAddress, DatabaseMode);
53 | }
54 | }
55 |
56 | public string ShortName {
57 | get {
58 | return PropertyInvoker.GetString (ClubOffsets.ShortName, -1, OriginalBytes, MemoryAddress, DatabaseMode);
59 | }
60 | }
61 |
62 | /*
63 | private int SixLetterNameAddress {
64 | get {
65 | return PropertyInvoker.Get (ClubOffsets.SixLetterName, OriginalBytes, MemoryAddress, DatabaseMode);
66 | }
67 | }
68 |
69 | public string SixLetterName {
70 | get {
71 | return PropertyInvoker.GetString (0x0, 0, OriginalBytes, this.SixLetterNameAddress, DatabaseMode);
72 | }
73 | } */
74 |
75 | private int NationAddress {
76 | get {
77 | return PropertyInvoker.Get (ClubOffsets.Nation, OriginalBytes, MemoryAddress, DatabaseMode);
78 | }
79 | }
80 |
81 | public Nation Nation {
82 | get {
83 | return PropertyInvoker.GetPointer (ClubOffsets.Nation, OriginalBytes, MemoryAddress, DatabaseMode, Version);
84 | }
85 | }
86 |
87 | private int BasedNationAddress {
88 | get {
89 | return PropertyInvoker.Get (ClubOffsets.BasedNation, OriginalBytes, MemoryAddress, DatabaseMode);
90 | }
91 | }
92 |
93 | public Nation BasedNation {
94 | get {
95 | return PropertyInvoker.GetPointer (ClubOffsets.BasedNation, OriginalBytes, MemoryAddress, DatabaseMode, Version);
96 | }
97 | }
98 |
99 | public int ClubFinancesAddress {
100 | get {
101 | return PropertyInvoker.Get (ClubOffsets.ClubFinances, OriginalBytes, MemoryAddress, DatabaseMode);
102 | }
103 | }
104 |
105 | public ClubFinances ClubFinances {
106 | get {
107 | return PropertyInvoker.GetPointer (ClubOffsets.ClubFinances, OriginalBytes, MemoryAddress, DatabaseMode, Version);
108 | }
109 | }
110 |
111 | public override string ToString ()
112 | {
113 | return Name;
114 | }
115 | }
116 | }
117 |
118 |
--------------------------------------------------------------------------------
/FMScoutFrameworkTest/FMScoutFrameworkTest.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {316F5660-51E2-4B99-ADCB-DA6F2DD23909}
8 | WinExe
9 | Properties
10 | FMScoutFrameworkTest
11 | FMScoutFrameworkTest
12 | v4.5
13 | 512
14 |
15 |
16 | AnyCPU
17 | true
18 | full
19 | false
20 | bin\Debug\
21 | DEBUG;TRACE
22 | prompt
23 | 4
24 |
25 |
26 | AnyCPU
27 | pdbonly
28 | true
29 | bin\Release\
30 | TRACE
31 | prompt
32 | 4
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 | Form
49 |
50 |
51 | Form1.cs
52 |
53 |
54 |
55 |
56 | Form1.cs
57 |
58 |
59 | ResXFileCodeGenerator
60 | Resources.Designer.cs
61 | Designer
62 |
63 |
64 | True
65 | Resources.resx
66 |
67 |
68 | SettingsSingleFileGenerator
69 | Settings.Designer.cs
70 |
71 |
72 | True
73 | Settings.settings
74 | True
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | {E74FE82A-2E12-4C51-AD24-7D2DDE5C36A6}
83 | FMScoutFramework
84 |
85 |
86 |
87 |
94 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # FMScoutFramework
2 | [](https://travis-ci.org/ThanosSiopoudis/FMScoutFramework)
3 |
4 | FMScoutFramework is a C#.NET/Mono Framework that enables you to create your own assistant tools / editors for Football Manager. It supports FM2014, FM2015 and FM2016
5 |
6 | ## Project Setup
7 |
8 | Clone the project in your favourite github client
9 | You will need [MonoDevelop](http://monodevelop.com) or [Xamarin](https://www.xamarin.com/download-it) if you develop your application for all platforms (Windows, OS X, Linux) or Microsoft Visual Studio if you develop just for windows. The client requirements will be the Mono framework for apps developed in Xamarin / MonoDevelop, or the .NET Framework for Visual Studio apps.
10 |
11 | ### Xamarin / Monodevelop Settings
12 | 1. Create your new Xamarin / MonoDevelop Solution
13 | 2. You can clone this repository and add it as a submodule in your own git tree, or just checkout the latest.
14 | 3. Add the FMScoutFramework project to your solution.
15 | 4. Expand your own project, and right click on `References`
16 | 5. Select `Edit References`
17 | 6. Click the `Projects` tab and tick the checkbox next to `FMScoutFramework`
18 | 7. Click `OK`
19 | 8. Right click on the `FMScoutFramework` Project
20 | 9. Click on `Options`
21 | 10. Select `Compiler` from the Menu
22 | 11. In the `Define Symbols` entry, enter `MAC` for OS X, `LINUX` for Linux or `WINDOWS` for windows.
23 | 12. You are now ready to start developing your app. Look further down for code
24 |
25 | ### Microsoft Visual Studio Settings
26 | 1. Create your new Visual Studio Solution
27 | 2. You can clone this repository and add it as a submodule in your own git tree, or just checkout the latest.
28 | 3. Add the FMScoutFramework project to your solution.
29 | 4. Expand your own project and right click on `References`
30 | 5. Click `Add Reference`
31 | 6. Click the `Projects` tab, under `Solution` and tick the checkbox next to `FMScoutFramework`
32 | 7. Click `OK`
33 | 8. Right click on the `FMScoutFramework` Project
34 | 9. Click on `Properties`
35 | 10. Select `Build` from the menu on the left
36 | 11. In the `Conditional Compilation Symbols` textbox, enter `WINDOWS;`
37 | 12. You are now ready to start developing your app. Look further down for code
38 |
39 | ##### Example Code
40 |
41 | The following code is an example for a simple Windows Forms application and another for Mono
42 | First, include the necessary framework headers:
43 | ```csharp
44 | using System.Collections.Generic;
45 | using System.Linq;
46 | using System.Threading;
47 | using FMScoutFramework.Core;
48 | using FMScoutFramework.Core.Entities.InGame;
49 | ```
50 |
51 | In your class, create a new public variable:
52 | ```csharp
53 | public FMCore fmCore = new FMCore (FMScoutFramework.Core.Entities.DatabaseModeEnum.Realtime);
54 | ```
55 |
56 | First, create a new method that will be asynchronously called by the framework when loading is finished:
57 | ```csharp
58 | public void GameLoaded() {
59 | Debug.WriteLine("Loading Finished");
60 | }
61 | ```
62 |
63 | Then, in your action callback method (from a button, or a menu for example) use the following code:
64 | ```csharp
65 | fmcore.GameLoaded += new Action(GameLoaded);
66 | new Action(() => fmCore.LoadData()).BeginInvoke((s) => { }, null);
67 | ```
68 |
69 | That's it! You can now query the data, with simple Linq queries! Amazing, eh? Here's an example, to look for "Bar":
70 | ```csharp
71 | var clubs = (from c in fmCore.Clubs
72 | where c.Name.Contains ("Bar")
73 | select c).Take (100).ToList ();
74 | ```
75 |
76 | ## Currently pending
77 | * Add Offsets for FM2016 OS X
78 | * Add a bunch of properties for the entities already implemented
79 | * Add a LOT of entities and properties for objects we have their main addresses for (look in 15.3.2 Windows version file)
80 |
81 | ## Contributing changes
82 | We need more devs and support! Imagine all the tools you could create for FM2014/FM2015/FM2016 if everything was already implemented!
83 | * Fork the project, make/test your changes and send a Pull Request!
84 | * Alternatively, bug reporting is vital! Use the Github's Issues page to do that!
85 |
86 | ## License
87 |
88 | FMScoutFramework is released under the GNU General Public License v2.0
89 | Please read the LICENSE file for a full version of the License
90 |
--------------------------------------------------------------------------------
/Defines/Versions/Steam_14_3_0_Windows.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Diagnostics;
4 | using FMScoutFramework.Core.Attributes;
5 | using FMScoutFramework.Core.Managers;
6 |
7 | namespace FMScoutFramework.Core.Entities.GameVersions
8 | {
9 |
10 | internal class Steam_14_3_0_Windows : IIVersion
11 | {
12 | public IVersionMemoryAddresses MemoryAddresses { get; private set; }
13 | public IVersionPersonEnumPointers PersonEnum { get; private set; }
14 | public IPersonVersionOffsets PersonOffsets { get; private set; }
15 |
16 | public Steam_14_3_0_Windows ()
17 | {
18 | MemoryAddresses = new VersionMemoryAddresses ();
19 | PersonEnum = new VersionPersonEnumPointers();
20 | PersonOffsets = new PersonVersionOffsets();
21 | }
22 |
23 | public string Description {
24 | get { return "14.3.0 Steam"; }
25 | }
26 |
27 | public string MainVersionNumber
28 | {
29 | get { return "14"; }
30 | }
31 |
32 | public bool SupportsProcess(FMProcess process, byte[] context)
33 | {
34 | #if LINUX || MAC
35 | return false;
36 | #endif
37 |
38 | #if WINDOWS
39 | if (process.VersionDescription != "14.3.0f474125") return false;
40 |
41 | var dt = ProcessManager.ReadDateTime(process.BaseAddress + MemoryAddresses.CurrentDateTime);
42 | if (dt.Year < 2012 || dt.Year > 2150)
43 | return false;
44 |
45 | return true;
46 | #endif
47 | }
48 |
49 | public class VersionMemoryAddresses : IVersionMemoryAddresses
50 | {
51 | public int MainAddress { get { return 0x1988D94; } }
52 | public int MainOffset { get { return 0x1C; } }
53 | public int XorDistance { get { return 0x54; } }
54 | public int StringOffset { get { return 0xC; } }
55 |
56 | public byte[] versionSig {
57 | get {
58 | return new byte[] {
59 | 0x31, 0x00, 0x34, 0x00,
60 | 0x2E, 0x00, 0x33, 0x00,
61 | 0x2E, 0x00, 0x30, 0x00,
62 | 0x20, 0x00, 0x34, 0x00,
63 | 0x37, 0x00, 0x34, 0x00,
64 | 0x31, 0x00, 0x32, 0x00,
65 | 0x37, 0x00, 0x20, 0x00,
66 | 0x28, 0x00, 0x6D, 0x00,
67 | 0x2E, 0x00, 0x65, 0x00,
68 | 0x20, 0x00, 0x76, 0x00,
69 | 0x31, 0x00, 0x34, 0x00,
70 | 0x35, 0x00, 0x34, 0x00,
71 | 0x29, 0x00
72 | };
73 | }
74 | }
75 |
76 | [MemoryAddress(CountLength = 4, BytesToSkip = 0x14)]
77 | public int City { get { return 0x1988D94; } }
78 |
79 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x1C)]
80 | public int Club { get { return 0x1988D94; } }
81 |
82 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x2C)]
83 | public int Continent { get { return 0x1988D94; } }
84 |
85 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x64)]
86 | public int Nation { get { return 0x1988D94; } }
87 |
88 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x24)]
89 | public int League { get { return 0x1988D94; } }
90 |
91 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x8C)]
92 | public int Stadium { get { return 0x1988D94; } }
93 |
94 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0xA4)]
95 | public int Team { get { return 0x1988D94; } }
96 |
97 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x6C)]
98 | public int Person { get { return 0x1988D94; } }
99 |
100 | public int CurrentDateTime { get { return 0x24C8E6C; } }
101 | }
102 |
103 | public class VersionPersonEnumPointers : IVersionPersonEnumPointers
104 | {
105 | public int Player { get { return 0x347D104; } }
106 | public int Staff { get { return 0x347EB6C; } }
107 | public int PlayerStaff { get { return 0x3473ED4; } }
108 | public int HumanManager { get { return 0x347608C; } }
109 | public int Official { get { return 0x9EA1658; } } // Not Fixed
110 | // RETIRED PERSON: 0x9EA61E8
111 | }
112 |
113 | ///
114 | /// How many bytes the pointer should be corrected for persons.
115 | /// Complies with 'AddressUsedInGame' in FMRTE
116 | ///
117 | public class PersonVersionOffsets : IPersonVersionOffsets
118 | {
119 | public int Person { get { return -0xC4; } }
120 | public int Player { get { return -0x150; } } // OK
121 | public int Staff { get { return -0x44; } }
122 | public int HumanManager { get { return -0x44; } }
123 | public int PlayerStaff { get { return -0x15c; } }
124 | public int Official { get { return 0x0; } }
125 | }
126 | }
127 | }
128 |
129 |
--------------------------------------------------------------------------------
/Defines/Versions/Steam_14_3_1_Windows.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Diagnostics;
4 | using FMScoutFramework.Core.Attributes;
5 | using FMScoutFramework.Core.Managers;
6 |
7 | namespace FMScoutFramework.Core.Entities.GameVersions
8 | {
9 |
10 | internal class Steam_14_3_1_Windows : IIVersion
11 | {
12 | public IVersionMemoryAddresses MemoryAddresses { get; private set; }
13 | public IVersionPersonEnumPointers PersonEnum { get; private set; }
14 | public IPersonVersionOffsets PersonOffsets { get; private set; }
15 |
16 | public Steam_14_3_1_Windows ()
17 | {
18 | MemoryAddresses = new VersionMemoryAddresses ();
19 | PersonEnum = new VersionPersonEnumPointers();
20 | PersonOffsets = new PersonVersionOffsets();
21 | }
22 |
23 | public string Description {
24 | get { return "14.3.1 Steam"; }
25 | }
26 |
27 | public string MainVersionNumber
28 | {
29 | get { return "14"; }
30 | }
31 |
32 | public bool SupportsProcess(FMProcess process, byte[] context)
33 | {
34 | #if LINUX || MAC
35 | return false;
36 | #endif
37 |
38 | #if WINDOWS
39 | if (process.VersionDescription != "14.3.1f487696") return false;
40 |
41 | var dt = ProcessManager.ReadDateTime(process.BaseAddress + MemoryAddresses.CurrentDateTime);
42 | if (dt.Year < 2012 || dt.Year > 2150)
43 | return false;
44 |
45 | return true;
46 | #endif
47 | }
48 |
49 | public class VersionMemoryAddresses : IVersionMemoryAddresses
50 | {
51 | public int MainAddress { get { return 0x1A470C4; } }
52 | public int MainOffset { get { return 0x1C; } }
53 | public int XorDistance { get { return 0x54; } }
54 | public int StringOffset { get { return 0xC; } }
55 |
56 | public byte[] versionSig {
57 | get {
58 | return new byte[] {
59 | 0x31, 0x00, 0x34, 0x00,
60 | 0x2E, 0x00, 0x33, 0x00,
61 | 0x2E, 0x00, 0x30, 0x00,
62 | 0x20, 0x00, 0x34, 0x00,
63 | 0x37, 0x00, 0x34, 0x00,
64 | 0x31, 0x00, 0x32, 0x00,
65 | 0x37, 0x00, 0x20, 0x00,
66 | 0x28, 0x00, 0x6D, 0x00,
67 | 0x2E, 0x00, 0x65, 0x00,
68 | 0x20, 0x00, 0x76, 0x00,
69 | 0x31, 0x00, 0x34, 0x00,
70 | 0x35, 0x00, 0x34, 0x00,
71 | 0x29, 0x00
72 | };
73 | }
74 | }
75 |
76 | [MemoryAddress(CountLength = 4, BytesToSkip = 0x14)]
77 | public int City { get { return 0x1A470C4; } }
78 |
79 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x1C)]
80 | public int Club { get { return 0x1A470C4; } }
81 |
82 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x2C)]
83 | public int Continent { get { return 0x1A470C4; } }
84 |
85 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x64)]
86 | public int Nation { get { return 0x1A470C4; } }
87 |
88 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x24)]
89 | public int League { get { return 0x1A470C4; } }
90 |
91 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x8C)]
92 | public int Stadium { get { return 0x1A470C4; } }
93 |
94 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0xA4)]
95 | public int Team { get { return 0x1A470C4; } }
96 |
97 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x6C)]
98 | public int Person { get { return 0x1A470C4; } }
99 |
100 | public int CurrentDateTime { get { return 0x24CAE74; } }
101 | }
102 |
103 | public class VersionPersonEnumPointers : IVersionPersonEnumPointers
104 | {
105 | public int Player { get { return 0x305F46C; } }
106 | public int Staff { get { return 0x3060E8C; } }
107 | public int PlayerStaff { get { return 0x30660EC; } }
108 | public int HumanManager { get { return 0x3058454; } }
109 | public int Official { get { return 0x3061C94; } }
110 | // RETIRED PERSON: 0x30592AC
111 | }
112 |
113 | ///
114 | /// How many bytes the pointer should be corrected for persons.
115 | /// Complies with 'AddressUsedInGame' in FMRTE
116 | ///
117 | public class PersonVersionOffsets : IPersonVersionOffsets
118 | {
119 | public int Person { get { return -0xC4; } }
120 | public int Player { get { return -0x150; } } // OK
121 | public int Staff { get { return -0x44; } }
122 | public int HumanManager { get { return -0x44; } }
123 | public int PlayerStaff { get { return -0x15c; } }
124 | public int Official { get { return 0x0; } }
125 | }
126 | }
127 | }
128 |
129 |
--------------------------------------------------------------------------------
/Defines/Versions/Steam_14_3_1_Mac.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Diagnostics;
4 | using FMScoutFramework.Core.Attributes;
5 | using FMScoutFramework.Core.Managers;
6 |
7 | namespace FMScoutFramework.Core.Entities.GameVersions
8 | {
9 |
10 | internal class Steam_14_3_1_Mac : IIVersion
11 | {
12 | public IVersionMemoryAddresses MemoryAddresses { get; private set; }
13 | public IVersionPersonEnumPointers PersonEnum { get; private set; }
14 | public IPersonVersionOffsets PersonOffsets { get; private set; }
15 |
16 | public Steam_14_3_1_Mac ()
17 | {
18 | MemoryAddresses = new VersionMemoryAddresses ();
19 | PersonEnum = new VersionPersonEnumPointers();
20 | PersonOffsets = new PersonVersionOffsets();
21 | }
22 |
23 | public string Description {
24 | get { return "14.3.0 Steam"; }
25 | }
26 |
27 | public string MainVersionNumber
28 | {
29 | get { return "14"; }
30 | }
31 |
32 | public bool SupportsProcess(FMProcess process, byte[] context)
33 | {
34 | #if LINUX || WINDOWS
35 | return false;
36 | #endif
37 | #if MAC
38 | // Attempt to read the number of continents.
39 | // They MUST be 7
40 | // Then double check the date!
41 | int numberOfObjects = GameManager.TryGetPointerObjects(MemoryAddresses.MainAddress, 0x2C, ProcessManager.fmProcess);
42 | if (numberOfObjects != 7)
43 | return false;
44 |
45 | DateTime dt = ProcessManager.ReadDateTime (MemoryAddresses.CurrentDateTime);
46 | if (dt.Year < 2012 || dt.Year > 2150)
47 | return false;
48 |
49 | process.VersionDescription = "14.3.1 487631 (m.e v1454)";
50 | return true;
51 | #endif
52 | }
53 |
54 | public class VersionMemoryAddresses : IVersionMemoryAddresses
55 | {
56 | public int MainAddress { get { return 0x32A8000; } }
57 | public int MainOffset { get { return 0x1C; } }
58 | public int XorDistance { get { return 0x54; } }
59 | public int StringOffset { get { return 0xC; } }
60 |
61 | public byte[] versionSig {
62 | get {
63 | return new byte[] {
64 | 0x31, 0x00, 0x34, 0x00,
65 | 0x2E, 0x00, 0x33, 0x00,
66 | 0x2E, 0x00, 0x30, 0x00,
67 | 0x20, 0x00, 0x34, 0x00,
68 | 0x37, 0x00, 0x34, 0x00,
69 | 0x31, 0x00, 0x32, 0x00,
70 | 0x39, 0x00, 0x20, 0x00,
71 | 0x28, 0x00, 0x6D, 0x00,
72 | 0x2E, 0x00, 0x65, 0x00,
73 | 0x20, 0x00, 0x76, 0x00,
74 | 0x31, 0x00, 0x34, 0x00,
75 | 0x35, 0x00, 0x34, 0x00,
76 | 0x29, 0x00
77 | };
78 | }
79 | }
80 |
81 | [MemoryAddress(CountLength = 4, BytesToSkip = 0x14)]
82 | public int City { get { return 0x32A8000; } }
83 |
84 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x1C)]
85 | public int Club { get { return 0x32A8000; } }
86 |
87 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x2C)]
88 | public int Continent { get { return 0x32A8000; } }
89 |
90 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x64)]
91 | public int Nation { get { return 0x32A8000; } }
92 |
93 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x24)]
94 | public int League { get { return 0x32A8000; } }
95 |
96 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x8C)]
97 | public int Stadium { get { return 0x32A8000; } }
98 |
99 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0xA4)]
100 | public int Team { get { return 0x32A8000; } }
101 |
102 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x6C)]
103 | public int Person { get { return 0x32A8000; } }
104 |
105 | public int CurrentDateTime { get { return 0x342F85E; } }
106 | }
107 |
108 | public class VersionPersonEnumPointers : IVersionPersonEnumPointers
109 | {
110 | public int Player { get { return 0x33A1D24; } }
111 | public int Staff { get { return 0x339ACB4; } }
112 | public int PlayerStaff { get { return 0x33A0D14; } }
113 | public int HumanManager { get { return 0x33A7C6C; } }
114 | public int Official { get { return 0x33ABB08; } }
115 | }
116 |
117 | ///
118 | /// How many bytes the pointer should be corrected for persons.
119 | /// Complies with 'AddressUsedInGame' in FMRTE
120 | ///
121 | public class PersonVersionOffsets : IPersonVersionOffsets
122 | {
123 | public int Person { get { return -0xC4; } }
124 | public int Player { get { return -0x20C; } } // OK
125 | public int Staff { get { return -0x44; } }
126 | public int HumanManager { get { return -0x44; } }
127 | public int PlayerStaff { get { return -0x15c; } }
128 | public int Official { get { return 0x0; } }
129 | }
130 | }
131 | }
132 |
133 |
--------------------------------------------------------------------------------
/Defines/Versions/Steam_15_2_1_Windows.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Diagnostics;
4 | using FMScoutFramework.Core.Attributes;
5 | using FMScoutFramework.Core.Managers;
6 |
7 | namespace FMScoutFramework.Core.Entities.GameVersions
8 | {
9 |
10 | internal class Steam_15_2_1_Windows : IIVersion
11 | {
12 | public IVersionMemoryAddresses MemoryAddresses { get; private set; }
13 | public IVersionPersonEnumPointers PersonEnum { get; private set; }
14 | public IPersonVersionOffsets PersonOffsets { get; private set; }
15 |
16 | public Steam_15_2_1_Windows()
17 | {
18 | MemoryAddresses = new VersionMemoryAddresses();
19 | PersonEnum = new VersionPersonEnumPointers();
20 | PersonOffsets = new PersonVersionOffsets();
21 | }
22 |
23 | public string Description
24 | {
25 | get { return "15.2.1 Steam"; }
26 | }
27 |
28 | public string MainVersionNumber
29 | {
30 | get { return "15"; }
31 | }
32 |
33 | public bool SupportsProcess(FMProcess process, byte[] context)
34 | {
35 | #if LINUX || MAC
36 | return false;
37 | #endif
38 |
39 | #if WINDOWS
40 | if (process.VersionDescription != "15.2.1f585343") return false;
41 |
42 | var dt = ProcessManager.ReadDateTime(process.BaseAddress + MemoryAddresses.CurrentDateTime);
43 | if (dt.Year < 2012 || dt.Year > 2150)
44 | return false;
45 |
46 | return true;
47 | #endif
48 | }
49 |
50 | public class VersionMemoryAddresses : IVersionMemoryAddresses
51 | {
52 | public int MainAddress { get { return 0x1543094; } }
53 | public int MainOffset { get { return 0x0; } }
54 | public int XorDistance { get { return 0x40; } } // Not XOR but useful
55 | public int StringOffset { get { return 0x4; } }
56 |
57 | public byte[] versionSig
58 | {
59 | get
60 | {
61 | return new byte[] {
62 | 0x31, 0x00, 0x34, 0x00,
63 | 0x2E, 0x00, 0x33, 0x00,
64 | 0x2E, 0x00, 0x30, 0x00,
65 | 0x20, 0x00, 0x34, 0x00,
66 | 0x37, 0x00, 0x34, 0x00,
67 | 0x31, 0x00, 0x32, 0x00,
68 | 0x37, 0x00, 0x20, 0x00,
69 | 0x28, 0x00, 0x6D, 0x00,
70 | 0x2E, 0x00, 0x65, 0x00,
71 | 0x20, 0x00, 0x76, 0x00,
72 | 0x31, 0x00, 0x34, 0x00,
73 | 0x35, 0x00, 0x34, 0x00,
74 | 0x29, 0x00
75 | };
76 | }
77 | }
78 |
79 | [MemoryAddress(CountLength = 4, BytesToSkip = 0x10)]
80 | public int City { get { return 0x0; } }
81 |
82 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x14)]
83 | public int Club { get { return 0x0; } }
84 |
85 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x1C)]
86 | public int Continent { get { return 0x0; } }
87 |
88 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x38)]
89 | public int Nation { get { return 0x0; } }
90 |
91 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x0)]
92 | public int League { get { return 0x0; } }
93 |
94 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x4C)]
95 | public int Stadium { get { return 0x0; } }
96 |
97 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x58)]
98 | public int Team { get { return 0x0; } }
99 |
100 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x3C)]
101 | public int Person { get { return 0x0; } }
102 |
103 | public int CurrentDateTime { get { return 0x267ED1E; } }
104 | }
105 |
106 | public class VersionPersonEnumPointers : IVersionPersonEnumPointers
107 | {
108 | public int Player { get { return 0x26FE180; } }
109 | public int Staff { get { return 0x26FC2F4; } }
110 | public int PlayerStaff { get { return 0x2703958; } }
111 | public int HumanManager { get { return 0x26F45E8; } }
112 | public int Official { get { return 0x26FF640; } }
113 | // RETIRED PERSON: 0x26FF640
114 | // NON PLAYER: 0x26FAEBC
115 |
116 | }
117 |
118 | ///
119 | /// How many bytes the pointer should be corrected for persons.
120 | ///
121 | public class PersonVersionOffsets : IPersonVersionOffsets
122 | {
123 | public int Person { get { return -0xC4; } }
124 | public int Player { get { return -0x21C; } }
125 | public int Staff { get { return -0x84; } }
126 | public int HumanManager { get { return -0x44; } }
127 | public int PlayerStaff { get { return -0x2A0; } }
128 | public int Official { get { return 0xA4; } }
129 | }
130 | }
131 | }
132 |
133 |
--------------------------------------------------------------------------------
/Defines/Versions/Steam_14_3_0_Mac.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Diagnostics;
4 | using FMScoutFramework.Core.Attributes;
5 | using FMScoutFramework.Core.Managers;
6 |
7 | namespace FMScoutFramework.Core.Entities.GameVersions
8 | {
9 |
10 | internal class Steam_14_3_0_Mac : IIVersion
11 | {
12 | public IVersionMemoryAddresses MemoryAddresses { get; private set; }
13 | public IVersionPersonEnumPointers PersonEnum { get; private set; }
14 | public IPersonVersionOffsets PersonOffsets { get; private set; }
15 |
16 | public Steam_14_3_0_Mac ()
17 | {
18 | MemoryAddresses = new VersionMemoryAddresses ();
19 | PersonEnum = new VersionPersonEnumPointers();
20 | PersonOffsets = new PersonVersionOffsets();
21 | }
22 |
23 | public string Description {
24 | get { return "14.3.0 Steam"; }
25 | }
26 |
27 | public string MainVersionNumber
28 | {
29 | get { return "14"; }
30 | }
31 |
32 | public bool SupportsProcess(FMProcess process, byte[] context)
33 | {
34 | #if LINUX || WINDOWS
35 | return false;
36 | #endif
37 | #if MAC
38 | // Attempt to read the number of continents.
39 | // They MUST be 7
40 | // Then double check the date!
41 | int memoryAddress = ProcessManager.ReadInt32 (MemoryAddresses.MainAddress + MemoryAddresses.MainOffset);
42 | memoryAddress = ProcessManager.ReadInt32(memoryAddress);
43 | int xorValueOne = ProcessManager.ReadInt32 (memoryAddress + 0x2C + 0x4);
44 | int xorValueTwo = ProcessManager.ReadInt32 (memoryAddress + 0x2C);
45 | memoryAddress = xorValueTwo ^ xorValueOne;
46 | memoryAddress = ProcessManager.ReadInt32 (memoryAddress + MemoryAddresses.XorDistance);
47 |
48 | int numberOfObjects = ProcessManager.ReadArrayLength (memoryAddress);
49 | if (numberOfObjects != 7)
50 | return false;
51 |
52 | DateTime dt = ProcessManager.ReadDateTime (MemoryAddresses.CurrentDateTime);
53 | if (dt.Year < 2012 || dt.Year > 2150)
54 | return false;
55 |
56 | process.VersionDescription = "14.3.0 474129 (m.e v1454)";
57 | return true;
58 | #endif
59 | }
60 |
61 | public class VersionMemoryAddresses : IVersionMemoryAddresses
62 | {
63 | public int MainAddress { get { return 0x32A7000; } }
64 | public int MainOffset { get { return 0x1C; } }
65 | public int XorDistance { get { return 0x54; } }
66 | public int StringOffset { get { return 0xC; } }
67 |
68 | public byte[] versionSig {
69 | get {
70 | return new byte[] {
71 | 0x31, 0x00, 0x34, 0x00,
72 | 0x2E, 0x00, 0x33, 0x00,
73 | 0x2E, 0x00, 0x30, 0x00,
74 | 0x20, 0x00, 0x34, 0x00,
75 | 0x37, 0x00, 0x34, 0x00,
76 | 0x31, 0x00, 0x32, 0x00,
77 | 0x39, 0x00, 0x20, 0x00,
78 | 0x28, 0x00, 0x6D, 0x00,
79 | 0x2E, 0x00, 0x65, 0x00,
80 | 0x20, 0x00, 0x76, 0x00,
81 | 0x31, 0x00, 0x34, 0x00,
82 | 0x35, 0x00, 0x34, 0x00,
83 | 0x29, 0x00
84 | };
85 | }
86 | }
87 |
88 | [MemoryAddress(CountLength = 4, BytesToSkip = 0x14)]
89 | public int City { get { return 0x32A7000; } }
90 |
91 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x1C)]
92 | public int Club { get { return 0x32A7000; } }
93 |
94 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x2C)]
95 | public int Continent { get { return 0x32A7000; } }
96 |
97 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x64)]
98 | public int Nation { get { return 0x32A7000; } }
99 |
100 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x24)]
101 | public int League { get { return 0x32A7000; } }
102 |
103 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x8C)]
104 | public int Stadium { get { return 0x32A7000; } }
105 |
106 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0xA4)]
107 | public int Team { get { return 0x32A7000; } }
108 |
109 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x6C)]
110 | public int Person { get { return 0x32A7000; } }
111 |
112 | public int CurrentDateTime { get { return 0x3431C44; } }
113 | }
114 |
115 | public class VersionPersonEnumPointers : IVersionPersonEnumPointers
116 | {
117 | public int Player { get { return 0x339DEA4; } }
118 | public int Staff { get { return 0x3399CA4; } }
119 | public int PlayerStaff { get { return 0x33A0D14; } }
120 | public int HumanManager { get { return 0x33A6C5C; } }
121 | public int Official { get { return 0x33AAAF8; } }
122 | }
123 |
124 | ///
125 | /// How many bytes the pointer should be corrected for persons.
126 | /// Complies with 'AddressUsedInGame' in FMRTE
127 | ///
128 | public class PersonVersionOffsets : IPersonVersionOffsets
129 | {
130 | public int Person { get { return -0xC4; } }
131 | public int Player { get { return -0x20C; } } // OK
132 | public int Staff { get { return -0x44; } }
133 | public int HumanManager { get { return -0x44; } }
134 | public int PlayerStaff { get { return -0x15c; } }
135 | public int Official { get { return 0x0; } }
136 | }
137 | }
138 | }
139 |
140 |
--------------------------------------------------------------------------------
/Defines/Versions/Steam_14_3_1_Linux.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Diagnostics;
4 | using FMScoutFramework.Core.Attributes;
5 | using FMScoutFramework.Core.Managers;
6 |
7 | namespace FMScoutFramework.Core.Entities.GameVersions
8 | {
9 |
10 | internal class Steam_14_3_1_Linux : IIVersion
11 | {
12 | public IVersionMemoryAddresses MemoryAddresses { get; private set; }
13 | public IVersionPersonEnumPointers PersonEnum { get; private set; }
14 | public IPersonVersionOffsets PersonOffsets { get; private set; }
15 |
16 | public Steam_14_3_1_Linux ()
17 | {
18 | MemoryAddresses = new VersionMemoryAddresses ();
19 | PersonEnum = new VersionPersonEnumPointers();
20 | PersonOffsets = new PersonVersionOffsets();
21 | }
22 |
23 | public string Description {
24 | get { return "14.3.1 Steam"; }
25 | }
26 |
27 | public string MainVersionNumber
28 | {
29 | get { return "14"; }
30 | }
31 |
32 | public bool SupportsProcess(FMProcess process, byte[] context)
33 | {
34 | #if WINDOWS || MAC
35 | return false;
36 | #endif
37 | #if LINUX
38 | // Try to read the version number from the Heap
39 | // Look for the version signature
40 | int memoryAddress = ProcessManager.ReadInt32 (MemoryAddresses.MainAddress);
41 | memoryAddress = ProcessManager.ReadInt32(memoryAddress + MemoryAddresses.MainOffset);
42 | int xorValueOne = ProcessManager.ReadInt32 (memoryAddress + 0x2C + 0x4);
43 | int xorValueTwo = ProcessManager.ReadInt32 (memoryAddress + 0x2C);
44 | memoryAddress = xorValueTwo ^ xorValueOne;
45 | memoryAddress = ProcessManager.ReadInt32 (memoryAddress + MemoryAddresses.XorDistance);
46 |
47 | int numberOfObjects = ProcessManager.ReadArrayLength (memoryAddress);
48 | if (numberOfObjects != 7)
49 | return false;
50 |
51 | DateTime dt = ProcessManager.ReadDateTime (ProcessManager.fmProcess.BaseAddress + MemoryAddresses.CurrentDateTime);
52 | if (dt.Year < 2012 || dt.Year > 2150)
53 | return false;
54 |
55 | process.VersionDescription = "14.3.1 487634 (m.e v1454)";
56 | return true;
57 | #endif
58 | }
59 |
60 | public class VersionMemoryAddresses : IVersionMemoryAddresses
61 | {
62 | public int MainAddress { get { return 0xA9A1AF8; } }
63 | public int MainOffset { get { return 0x1C; } }
64 | public int XorDistance { get { return 0x54; } }
65 | public int StringOffset { get { return 0xC; } }
66 |
67 | public byte[] versionSig {
68 | get {
69 | return new byte[] {
70 | 0x31, 0x00, 0x34, 0x00,
71 | 0x2E, 0x00, 0x33, 0x00,
72 | 0x2E, 0x00, 0x30, 0x00,
73 | 0x20, 0x00, 0x34, 0x00,
74 | 0x37, 0x00, 0x34, 0x00,
75 | 0x31, 0x00, 0x32, 0x00,
76 | 0x37, 0x00, 0x20, 0x00,
77 | 0x28, 0x00, 0x6D, 0x00,
78 | 0x2E, 0x00, 0x65, 0x00,
79 | 0x20, 0x00, 0x76, 0x00,
80 | 0x31, 0x00, 0x34, 0x00,
81 | 0x35, 0x00, 0x34, 0x00,
82 | 0x29, 0x00
83 | };
84 | }
85 | }
86 |
87 | [MemoryAddress(CountLength = 4, BytesToSkip = 0x14)]
88 | public int City { get { return 0xA9A1AF8; } }
89 |
90 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x1C)]
91 | public int Club { get { return 0xA9A1AF8; } }
92 |
93 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x2C)]
94 | public int Continent { get { return 0xA9A1AF8; } }
95 |
96 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x64)]
97 | public int Nation { get { return 0xA9A1AF8; } }
98 |
99 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x24)]
100 | public int League { get { return 0xA9A1AF8; } }
101 |
102 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x8C)]
103 | public int Stadium { get { return 0xA9A1AF8; } }
104 |
105 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0xA4)]
106 | public int Team { get { return 0xA9A1AF8; } }
107 |
108 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x6C)]
109 | public int Person { get { return 0xA9A1AF8; } }
110 |
111 | public int CurrentDateTime { get { return 0x45D8; } }
112 | }
113 |
114 | public class VersionPersonEnumPointers : IVersionPersonEnumPointers
115 | {
116 | public int Player { get { return 0x9E8AE44; } }
117 | public int Staff { get { return 0x9E85EAC; } }
118 | public int PlayerStaff { get { return 0x9E901AC; } }
119 | public int HumanManager { get { return 0x9E9D6CC; } } // Not fixed
120 | public int Official { get { return 0x9EA2428; } }
121 | // RETIRED PERSON: 0x9EA6FB8
122 | }
123 |
124 | ///
125 | /// How many bytes the pointer should be corrected for persons.
126 | /// Complies with 'AddressUsedInGame' in FMRTE
127 | ///
128 | public class PersonVersionOffsets : IPersonVersionOffsets
129 | {
130 | public int Person { get { return -0xC4; } }
131 | public int Player { get { return -0x20C; } } // OK
132 | public int Staff { get { return -0x144; } } // OK
133 | public int HumanManager { get { return -0x44; } }
134 | public int PlayerStaff { get { return -0x15c; } }
135 | public int Official { get { return 0x0; } }
136 | }
137 | }
138 | }
139 |
140 |
--------------------------------------------------------------------------------
/Defines/Versions/Steam_14_3_0_Linux.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Diagnostics;
4 | using FMScoutFramework.Core.Attributes;
5 | using FMScoutFramework.Core.Managers;
6 |
7 | namespace FMScoutFramework.Core.Entities.GameVersions
8 | {
9 |
10 | internal class Steam_14_3_0_Linux : IIVersion
11 | {
12 | public IVersionMemoryAddresses MemoryAddresses { get; private set; }
13 | public IVersionPersonEnumPointers PersonEnum { get; private set; }
14 | public IPersonVersionOffsets PersonOffsets { get; private set; }
15 |
16 | public Steam_14_3_0_Linux ()
17 | {
18 | MemoryAddresses = new VersionMemoryAddresses ();
19 | PersonEnum = new VersionPersonEnumPointers();
20 | PersonOffsets = new PersonVersionOffsets();
21 | }
22 |
23 | public string Description {
24 | get { return "14.3.0 Steam"; }
25 | }
26 |
27 | public string MainVersionNumber
28 | {
29 | get { return "14"; }
30 | }
31 |
32 | public bool SupportsProcess(FMProcess process, byte[] context)
33 | {
34 | #if WINDOWS || MAC
35 | return false;
36 | #endif
37 | #if LINUX
38 |
39 | // Try to read the version number from the Heap
40 | // Look for the version signature
41 | int memoryAddress = ProcessManager.ReadInt32 (MemoryAddresses.MainAddress);
42 | memoryAddress = ProcessManager.ReadInt32(memoryAddress + 0x1C);
43 | int xorValueOne = ProcessManager.ReadInt32 (memoryAddress + 0x2C + MemoryAddresses.MainOffset);
44 | int xorValueTwo = ProcessManager.ReadInt32 (memoryAddress + 0x2C);
45 | memoryAddress = xorValueTwo ^ xorValueOne;
46 | memoryAddress = ProcessManager.ReadInt32 (memoryAddress + MemoryAddresses.XorDistance);
47 |
48 | int numberOfObjects = ProcessManager.ReadArrayLength (memoryAddress);
49 | if (numberOfObjects != 7)
50 | return false;
51 |
52 | DateTime dt = ProcessManager.ReadDateTime (ProcessManager.fmProcess.BaseAddress + MemoryAddresses.CurrentDateTime);
53 | if (dt.Year < 2012 || dt.Year > 2150)
54 | return false;
55 |
56 | process.VersionDescription = "14.3.0 474127 (m.e v1454)";
57 | return true;
58 | #endif
59 | }
60 |
61 | public class VersionMemoryAddresses : IVersionMemoryAddresses
62 | {
63 | public int MainAddress { get { return 0xA9A0AF0; } }
64 | public int MainOffset { get { return 0x1C; } }
65 | public int XorDistance { get { return 0x54; } }
66 | public int StringOffset { get { return 0xC; } }
67 |
68 | public byte[] versionSig {
69 | get {
70 | return new byte[] {
71 | 0x31, 0x00, 0x34, 0x00,
72 | 0x2E, 0x00, 0x33, 0x00,
73 | 0x2E, 0x00, 0x30, 0x00,
74 | 0x20, 0x00, 0x34, 0x00,
75 | 0x37, 0x00, 0x34, 0x00,
76 | 0x31, 0x00, 0x32, 0x00,
77 | 0x37, 0x00, 0x20, 0x00,
78 | 0x28, 0x00, 0x6D, 0x00,
79 | 0x2E, 0x00, 0x65, 0x00,
80 | 0x20, 0x00, 0x76, 0x00,
81 | 0x31, 0x00, 0x34, 0x00,
82 | 0x35, 0x00, 0x34, 0x00,
83 | 0x29, 0x00
84 | };
85 | }
86 | }
87 |
88 | [MemoryAddress(CountLength = 4, BytesToSkip = 0x14)]
89 | public int City { get { return 0xA9A0AF0; } }
90 |
91 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x1C)]
92 | public int Club { get { return 0xA9A0AF0; } }
93 |
94 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x2C)]
95 | public int Continent { get { return 0xA9A0AF0; } }
96 |
97 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x64)]
98 | public int Nation { get { return 0xA9A0AF0; } }
99 |
100 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x24)]
101 | public int League { get { return 0xA9A0AF0; } }
102 |
103 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x8C)]
104 | public int Stadium { get { return 0xA9A0AF0; } }
105 |
106 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0xA4)]
107 | public int Team { get { return 0xA9A0AF0; } }
108 |
109 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x6C)]
110 | public int Person { get { return 0xA9A0AF0; } }
111 |
112 | public int CurrentDateTime { get { return 0x45D8; } }
113 | }
114 |
115 | public class VersionPersonEnumPointers : IVersionPersonEnumPointers
116 | {
117 | public int Player { get { return 0x9E8A074; } }
118 | public int Staff { get { return 0x9E850DC; } }
119 | public int PlayerStaff { get { return 0x9E8F3DC; } }
120 | public int HumanManager { get { return 0x1f12814; } } // Not fixed
121 | public int Official { get { return 0x9EA1658; } }
122 | // RETIRED PERSON: 0x9EA61E8
123 | }
124 |
125 | ///
126 | /// How many bytes the pointer should be corrected for persons.
127 | /// Complies with 'AddressUsedInGame' in FMRTE
128 | ///
129 | public class PersonVersionOffsets : IPersonVersionOffsets
130 | {
131 | public int Person { get { return -0xC4; } }
132 | public int Player { get { return -0x20C; } } // OK
133 | public int Staff { get { return -0x144; } } // OK
134 | public int HumanManager { get { return -0x44; } }
135 | public int PlayerStaff { get { return -0x15c; } }
136 | public int Official { get { return 0x0; } }
137 | }
138 | }
139 | }
140 |
141 |
--------------------------------------------------------------------------------
/Entities/Ingame/Contract.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
4 | using FMScoutFramework.Core.Managers;
5 | using FMScoutFramework.Core.Offsets;
6 |
7 | namespace FMScoutFramework.Core.Entities.InGame
8 | {
9 | public class Contract : BaseObject, IContract
10 | {
11 | public ContractOffsets ContractOffsets;
12 | public Contract (int memoryAddress, IVersion version)
13 | : base(memoryAddress, version)
14 | {
15 | ContractOffsets = new ContractOffsets(version);
16 | }
17 | public Contract (int memoryAddress, ArraySegment originalBytes, IVersion version)
18 | : base(memoryAddress, originalBytes, version)
19 | {
20 | ContractOffsets = new ContractOffsets(version);
21 | }
22 |
23 | public Team Team {
24 | get {
25 | return PropertyInvoker.GetPointer (ContractOffsets.Team, OriginalBytes, MemoryAddress, DatabaseMode, Version);
26 | }
27 | }
28 |
29 | public JobType JobType {
30 | get {
31 | return (JobType)(PropertyInvoker.Get(ContractOffsets.JobType, OriginalBytes, MemoryAddress, DatabaseMode));
32 | }
33 | }
34 |
35 | public Int32 Wage {
36 | get {
37 | return PropertyInvoker.Get (ContractOffsets.Wage, OriginalBytes, MemoryAddress, DatabaseMode);
38 | }
39 | }
40 |
41 | public DateTime DateStarted {
42 | get {
43 | return PropertyInvoker.Get (ContractOffsets.DateStarted, OriginalBytes, MemoryAddress, DatabaseMode);
44 | }
45 | }
46 |
47 | public DateTime DateExpires {
48 | get {
49 | return PropertyInvoker.Get (ContractOffsets.DateExpires, OriginalBytes, MemoryAddress, DatabaseMode);
50 | }
51 | }
52 |
53 | public SquadStatus SquadStatus {
54 | get {
55 | return (SquadStatus)(PropertyInvoker.Get (ContractOffsets.SquadStatus, OriginalBytes, MemoryAddress, DatabaseMode));
56 | }
57 | }
58 |
59 | public TransferStatus TransferStatus {
60 | get {
61 | return (TransferStatus)(PropertyInvoker.Get (ContractOffsets.TransferStatus, OriginalBytes, MemoryAddress, DatabaseMode));
62 | }
63 | }
64 |
65 | public sbyte SquadNumber {
66 | get {
67 | return PropertyInvoker.Get(ContractOffsets.SquadNumber, OriginalBytes, MemoryAddress, DatabaseMode);
68 | }
69 | }
70 |
71 | public bool isTransferListed {
72 | get {
73 | return ((sbyte)this.TransferStatus == 5) || ((sbyte)this.TransferStatus == 7);
74 | }
75 | }
76 |
77 | public ContractClause[] ContractClauses {
78 | get {
79 | int numberOfClauses = ProcessManager.ReadArrayLength (MemoryAddress + ContractOffsets.Clauses, ContractClausesOffsets.ClauseLength);
80 | ContractClause[] result = new ContractClause[numberOfClauses];
81 | for (int i = 0; i < numberOfClauses; i++) {
82 | int clauseAddress = PropertyInvoker.Get (ContractOffsets.Clauses, OriginalBytes, MemoryAddress, DatabaseMode);
83 | result [i] = new ContractClause ((clauseAddress + (i * ContractClausesOffsets.ClauseLength)), Version);
84 | }
85 |
86 | return result;
87 | }
88 | }
89 |
90 | public ContractBonus[] ContractBonuses {
91 | get {
92 | int numberOfBonuses = ProcessManager.ReadArrayLength (MemoryAddress + ContractOffsets.Bonuses, ContractBonusOffsets.BonusLength);
93 | ContractBonus[] result = new ContractBonus[numberOfBonuses];
94 | for (int i = 0; i < numberOfBonuses; i++) {
95 | int bonusAddress = PropertyInvoker.Get (ContractOffsets.Bonuses, OriginalBytes, MemoryAddress, DatabaseMode);
96 | result [i] = new ContractBonus ((bonusAddress + (i * ContractBonusOffsets.BonusLength)), Version);
97 | }
98 |
99 | return result;
100 | }
101 | }
102 |
103 | public ContractType ContractType {
104 | get {
105 | return (ContractType)(PropertyInvoker.Get (ContractOffsets.Type, OriginalBytes, MemoryAddress, DatabaseMode));
106 | }
107 | }
108 | }
109 |
110 | public enum JobType {
111 | Free = 0,
112 | Coach = 2,
113 | Chairman = 4,
114 | Director = 6,
115 | ManagingDirector = 8,
116 | DirectorOfFootball = 10,
117 | Physio = 12,
118 | Scout = 14,
119 | Manager = 16,
120 | AssistantManager = 20,
121 | MediaPundit = 22,
122 | GeneralManager = 24,
123 | FitnessCoach = 26,
124 | GoalkeeperCoach = 34,
125 | U21Manager = 40,
126 | ChiefScout = 44,
127 | YouthCoach = 48,
128 | HeadOfPhysio = 50,
129 | U19Manager = 52,
130 | FirstTeamCoach = 54,
131 | HeadOfYouthDevelopment = 64,
132 | CaretakerManager = 144
133 | }
134 |
135 | public enum SquadStatus {
136 | Invalid = -1,
137 | NotYetSet = 0,
138 | KeyPlayer = 1,
139 | FirstTeamRegular = 2,
140 | FirstTeamSquadRotation = 3,
141 | MainBackupPlayer = 4,
142 | HotProspectForTheFuture = 5,
143 | DecentYoungster = 6,
144 | NotNeeded = 7,
145 | SquadStatusCount = 8
146 | }
147 |
148 | public enum TransferStatus {
149 | TransferListed = 5,
150 | LoadListed = 6,
151 | TransferAndLoadListed = 7
152 | }
153 |
154 | public enum ContractType {
155 | PartTime = 0,
156 | FullTime = 1,
157 | Amateur = 2,
158 | Youth = 3,
159 | NonContract = 4
160 | }
161 | }
162 |
163 |
--------------------------------------------------------------------------------
/Entities/Ingame/Team.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 | using FMScoutFramework.Core.Managers;
4 | using FMScoutFramework.Core.Offsets;
5 | using FMScoutFramework.Core.Attributes;
6 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
7 | using FMScoutFramework.Core.Utilities;
8 |
9 | namespace FMScoutFramework.Core.Entities.InGame
10 | {
11 | public class Team : BaseObject, ITeam
12 | {
13 | public TeamOffsets TeamOffsets;
14 | public Team (int memoryAddress, IVersion version)
15 | : base(memoryAddress, version)
16 | {
17 | this.TeamOffsets = new TeamOffsets(version);
18 | }
19 | public Team (int memoryAddress, ArraySegment originalBytes, IVersion version)
20 | : base(memoryAddress, originalBytes, version)
21 | {
22 | this.TeamOffsets = new TeamOffsets(version);
23 | }
24 |
25 | public int RowID {
26 | get {
27 | return PropertyInvoker.Get(TeamOffsets.RowID, OriginalBytes, MemoryAddress, DatabaseMode);
28 | }
29 | }
30 |
31 | public int ID {
32 | get {
33 | return PropertyInvoker.Get (TeamOffsets.ID, OriginalBytes, MemoryAddress, DatabaseMode);
34 | }
35 | }
36 |
37 | private int ClubAddress {
38 | get {
39 | return PropertyInvoker.Get (TeamOffsets.Club, OriginalBytes, MemoryAddress, DatabaseMode);
40 | }
41 | }
42 |
43 | public Club Club {
44 | get {
45 | return PropertyInvoker.GetPointer (TeamOffsets.Club, OriginalBytes, MemoryAddress, DatabaseMode, Version);
46 | }
47 | }
48 |
49 | private short PreviousReputation {
50 | get {
51 | return PropertyInvoker.Get (TeamOffsets.PreviousReputation, OriginalBytes, MemoryAddress, DatabaseMode);
52 | }
53 | }
54 |
55 | public TeamType TeamType {
56 | get {
57 | return (TeamType)PropertyInvoker.Get(TeamOffsets.TeamType, OriginalBytes, MemoryAddress, DatabaseMode);
58 | }
59 | }
60 |
61 | public ushort Reputation {
62 | get {
63 | if (Version.GetType () == typeof(Steam_14_3_0_Linux) ||
64 | Version.GetType() == typeof(Steam_14_3_0_Mac) ||
65 | Version.GetType() == typeof(Steam_14_3_0_Windows) ||
66 | Version.GetType() == typeof(Steam_14_3_1_Linux) ||
67 | Version.GetType() == typeof(Steam_14_3_1_Windows))
68 | {
69 | try{
70 | int rotateAmount = ((MemoryAddress + TeamOffsets.Reputation) & 15);
71 | uint encryptedRep = PropertyInvoker.Get (TeamOffsets.Reputation, OriginalBytes, MemoryAddress, DatabaseMode);
72 | encryptedRep = BitwiseOperations.rol_short (encryptedRep, rotateAmount);
73 | encryptedRep = (encryptedRep ^ 0x130E);
74 | encryptedRep = BitwiseOperations.rol_short (encryptedRep, 9);
75 | encryptedRep = ~encryptedRep;
76 |
77 | return (ushort)encryptedRep;
78 | }
79 | catch {
80 | return 0;
81 | }
82 | }
83 | else if (Version.GetType() == typeof(Steam_16_3_0_Windows) ||
84 | Version.GetType() == typeof(Steam_16_3_1_Windows))
85 | {
86 | try
87 | {
88 | int rotateAmount = ((MemoryAddress + TeamOffsets.Reputation) & 0xf);
89 | uint encryptedRep = PropertyInvoker.Get(TeamOffsets.Reputation, OriginalBytes, MemoryAddress, DatabaseMode);
90 | /* Encryption
91 | encryptedRep = (encryptedRep ^ 0x144b);
92 | encryptedRep = ~encryptedRep & 0xffff;
93 | encryptedRep = BitwiseOperations.rol_short(encryptedRep, 5) & 0xffff;
94 | encryptedRep = (encryptedRep ^ 0x9634);
95 | encryptedRep = BitwiseOperations.ror_short(encryptedRep, rotateAmount) & 0xffff;
96 | */
97 |
98 | encryptedRep = BitwiseOperations.rol_short(encryptedRep, rotateAmount) & 0xffff;
99 | encryptedRep = (encryptedRep ^ 0x9634);
100 | encryptedRep = BitwiseOperations.ror_short(encryptedRep, 5) & 0xffff;
101 | encryptedRep = ~encryptedRep & 0xffff;
102 | encryptedRep = (encryptedRep ^ 0x144b);
103 |
104 | return (ushort)encryptedRep;
105 | }
106 | catch
107 | {
108 | return 0;
109 | }
110 | }
111 | else {
112 | return 0;
113 | }
114 | }
115 | }
116 |
117 | public override string ToString ()
118 | {
119 | if (this.Club.Name != "-")
120 | return string.Format ("{0} ({1})", this.Club.Name, this.TeamType.ToString());
121 | else
122 | return "-";
123 | }
124 | }
125 |
126 | public enum TeamType {
127 | First = 0,
128 | Reserves = 1,
129 | A = 2,
130 | B = 3,
131 | SuperdraftA = 4,
132 | SuperdraftB = 5,
133 | SuperdraftC = 6,
134 | SuperdraftD = 7,
135 | Waivers = 8,
136 | U23 = 9,
137 | U21 = 10,
138 | U19 = 11,
139 | U18 = 12,
140 | C = 13,
141 | Amateur = 14,
142 | II = 15,
143 | Team2 = 16,
144 | Team3 = 17,
145 | U20 = 18,
146 | YouthEvaluation = 22,
147 | DutchReserves = 30
148 | }
149 | }
--------------------------------------------------------------------------------
/VirtualMemory/Managers/PropertyInvoker.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq.Expressions;
4 | using FMScoutFramework.Core.Entities;
5 | using FMScoutFramework.Core.Entities.GameVersions;
6 |
7 | namespace FMScoutFramework.Core.Managers
8 | {
9 | internal static class PropertyInvoker
10 | {
11 | public static T Get(int offset, ArraySegment baseObject, int memoryAddress, DatabaseModeEnum databaseMode)
12 | {
13 | if (databaseMode == DatabaseModeEnum.Cached)
14 | return (T)ProcessManager.ReadFromBuffer (baseObject.Array, baseObject.Offset + offset, typeof(T));
15 | else { // realtime
16 | int offsetToFind = memoryAddress + offset;
17 |
18 | if (typeof(Int16) == typeof(T))
19 | return (T)(object)ProcessManager.ReadInt16 (offsetToFind);
20 | else if (typeof(Byte) == typeof(T))
21 | return (T)(object)ProcessManager.ReadByte (offsetToFind);
22 | else if (typeof(DateTime) == typeof(T))
23 | return (T)(object)ProcessManager.ReadDateTime (offsetToFind);
24 | else if (typeof(Int32) == typeof(T))
25 | return (T)(object)ProcessManager.ReadInt32 (offsetToFind);
26 | else if (typeof(SByte) == typeof(T))
27 | return (T)(object)ProcessManager.ReadSByte (offsetToFind);
28 | else if (typeof(float) == typeof(T))
29 | return (T)(object)ProcessManager.ReadFloat (offsetToFind);
30 | else if (typeof(UInt32) == typeof(T))
31 | return (T)(object)ProcessManager.ReadUInt32 (offsetToFind);
32 | else if (typeof(ushort) == typeof(T))
33 | return (T)(object)ProcessManager.ReadUInt16 (offsetToFind);
34 | else
35 | return default(T);
36 | }
37 | }
38 |
39 | public static void Set(int offset, ArraySegment baseObject, int memoryAddress, DatabaseModeEnum databaseMode, T value)
40 | {
41 | if (databaseMode == DatabaseModeEnum.Cached)
42 | {
43 | throw new NotImplementedException();
44 | }
45 | else
46 | {
47 | int offsetToFind = memoryAddress + offset;
48 |
49 | if (typeof(Int16) == typeof(T))
50 | ProcessManager.WriteInt16((short)(object)value, offsetToFind);
51 | else if (typeof(Byte) == typeof(T))
52 | ProcessManager.WriteByte((byte)(object)value, offsetToFind);
53 | else if (typeof(DateTime) == typeof(T))
54 | ProcessManager.WriteDateTime((DateTime)(object)value, offsetToFind);
55 | else if (typeof(Int32) == typeof(T))
56 | ProcessManager.WriteInt32((int)(object)value, offsetToFind);
57 | else if (typeof(SByte) == typeof(T))
58 | ProcessManager.WriteSByte((sbyte)(object)value, offsetToFind);
59 | else if (typeof(float) == typeof(T))
60 | ProcessManager.WriteFloat((float)(object)value, offsetToFind);
61 | else if (typeof(UInt32) == typeof(T))
62 | ProcessManager.WriteInt32((int)(object)value, offsetToFind);
63 | else if (typeof(ushort) == typeof(T))
64 | ProcessManager.WriteInt16((ushort)(object)value, offsetToFind);
65 | }
66 | }
67 |
68 |
69 | public static string GetString(int offset, int additionalStringOffset, ArraySegment baseObject, int memoryAddress, DatabaseModeEnum databaseMode)
70 | {
71 | if (databaseMode == DatabaseModeEnum.Cached)
72 | return ProcessManager.ReadString (baseObject, offset, additionalStringOffset);
73 | else // realtime
74 | return ProcessManager.ReadString (memoryAddress + offset, additionalStringOffset);
75 | }
76 |
77 | private static Dictionary> pointerDelegateDictionary = new Dictionary>();
78 | public static T GetPointer(int offset, ArraySegment baseObject, int memoryAddress, DatabaseModeEnum databaseMode, IVersion version)
79 | where T: class
80 | {
81 | if (databaseMode == DatabaseModeEnum.Cached) {
82 | int memAddress = ProcessManager.ReadInt32 (baseObject.Array, offset + baseObject.Offset);
83 | var objectStore = ((Dictionary)ObjectManagerWrapper.ObjectManagers [databaseMode].ObjectStore [typeof(T)]);
84 | if (objectStore.ContainsKey (memAddress))
85 | return objectStore [memAddress] as T;
86 | else
87 | return default(T);
88 | } else {
89 | int memAddress = memoryAddress + offset;
90 |
91 | /*
92 | if (typeof(T) == typeof(Contract))
93 | memAddress = ProcessManager.ReadInt32 (memAddress); */
94 |
95 | if (!pointerDelegateDictionary.ContainsKey (typeof(T))) {
96 | System.Reflection.ConstructorInfo ci =
97 | typeof(T).GetConstructor (new[] { typeof(int), typeof(IVersion) });
98 |
99 | ParameterExpression memAddressParam = Expression.Parameter (typeof(int), "memAdd");
100 | ParameterExpression versionParam = Expression.Parameter (typeof(IVersion), "version");
101 |
102 | LambdaExpression lambda = Expression.Lambda (
103 | Expression.Convert (Expression.New (ci, memAddressParam, versionParam), typeof(object))
104 | , memAddressParam, versionParam);
105 |
106 | lock (pointerDelegateLock) {
107 | if (!pointerDelegateDictionary.ContainsKey (typeof(T))) {
108 | pointerDelegateDictionary.Add (typeof(T),
109 | (Func)lambda.Compile ());
110 | }
111 | }
112 | }
113 | return (T)pointerDelegateDictionary [typeof(T)].Invoke (ProcessManager.ReadInt32 (memAddress), version);
114 | }
115 | }
116 |
117 | private static object pointerDelegateLock = new object();
118 | }
119 | }
120 |
121 |
--------------------------------------------------------------------------------
/FMScoutFrameworkTest/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/FMScoutFrameworkTest/Form1.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Defines/Offsets/PersonTypes/StaffOffsets.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using FMScoutFramework.Core.Entities.GameVersions;
3 |
4 | namespace FMScoutFramework.Core.Offsets
5 | {
6 | public sealed class StaffOffsets
7 | {
8 |
9 | public IVersion Version;
10 |
11 | public StaffOffsets(IVersion version) {
12 | this.Version = version;
13 | }
14 |
15 | public short StaffAttributes
16 | {
17 | get
18 | {
19 | if (Version.GetType() == typeof(Steam_14_3_0_Linux) ||
20 | Version.GetType() == typeof(Steam_14_3_0_Mac) ||
21 | Version.GetType() == typeof(Steam_14_3_1_Linux))
22 | return 0x4;
23 | else if (Version.GetType() == typeof(Steam_15_2_1_Windows) ||
24 | Version.GetType () == typeof(Steam_15_3_2_Mac) ||
25 | Version.GetType () == typeof(Steam_15_3_2_Windows))
26 | return 0x4;
27 | else
28 | return 0x0;
29 | }
30 | }
31 |
32 | public short HomeReputation
33 | {
34 | get
35 | {
36 | if (Version.GetType() == typeof(Steam_14_3_0_Linux) ||
37 | Version.GetType() == typeof(Steam_14_3_0_Mac) ||
38 | Version.GetType() == typeof(Steam_14_3_1_Linux))
39 | return 0x68;
40 | else if (Version.GetType() == typeof(Steam_15_2_1_Windows) ||
41 | Version.GetType () == typeof(Steam_15_3_2_Mac) ||
42 | Version.GetType () == typeof(Steam_15_3_2_Windows))
43 | return 0x70;
44 | else
45 | return 0x0;
46 | }
47 | }
48 |
49 | public short CurrentReputation
50 | {
51 | get
52 | {
53 | if (Version.GetType() == typeof(Steam_14_3_0_Linux) ||
54 | Version.GetType() == typeof(Steam_14_3_0_Mac) ||
55 | Version.GetType() == typeof(Steam_14_3_1_Linux))
56 | return 0x6A;
57 | else if (Version.GetType() == typeof(Steam_15_2_1_Windows) ||
58 | Version.GetType () == typeof(Steam_15_3_2_Mac) ||
59 | Version.GetType () == typeof(Steam_15_3_2_Windows))
60 | return 0x72;
61 | else
62 | return 0x0;
63 | }
64 | }
65 |
66 | public short WorldReputation
67 | {
68 | get
69 | {
70 | if (Version.GetType() == typeof(Steam_14_3_0_Linux) ||
71 | Version.GetType() == typeof(Steam_14_3_0_Mac) ||
72 | Version.GetType() == typeof(Steam_14_3_1_Linux))
73 | return 0x6C;
74 | else if (Version.GetType() == typeof(Steam_15_2_1_Windows) ||
75 | Version.GetType () == typeof(Steam_15_3_2_Mac) ||
76 | Version.GetType () == typeof(Steam_15_3_2_Windows))
77 | return 0x74;
78 | else
79 | return 0x0;
80 | }
81 | }
82 |
83 | public short CurrentAbility
84 | {
85 | get
86 | {
87 | if (Version.GetType() == typeof(Steam_14_3_0_Linux) ||
88 | Version.GetType() == typeof(Steam_14_3_0_Mac) ||
89 | Version.GetType() == typeof(Steam_14_3_1_Linux))
90 | return 0x6E;
91 | else if (Version.GetType() == typeof(Steam_15_2_1_Windows) ||
92 | Version.GetType () == typeof(Steam_15_3_2_Mac) ||
93 | Version.GetType () == typeof(Steam_15_3_2_Windows))
94 | return 0x76;
95 | else
96 | return 0x0;
97 | }
98 | }
99 |
100 | public short PotentialAbility
101 | {
102 | get
103 | {
104 | if (Version.GetType() == typeof(Steam_14_3_0_Linux) ||
105 | Version.GetType() == typeof(Steam_14_3_0_Mac) ||
106 | Version.GetType() == typeof(Steam_14_3_1_Linux))
107 | return 0x70;
108 | else if (Version.GetType() == typeof(Steam_15_2_1_Windows) ||
109 | Version.GetType () == typeof(Steam_15_3_2_Mac) ||
110 | Version.GetType () == typeof(Steam_15_3_2_Windows))
111 | return 0x78;
112 | else
113 | return 0x0;
114 | }
115 | }
116 |
117 | public short RowID
118 | {
119 | get
120 | {
121 | if (Version.GetType() == typeof(Steam_14_3_0_Linux) ||
122 | Version.GetType() == typeof(Steam_14_3_0_Mac) ||
123 | Version.GetType() == typeof(Steam_14_3_1_Linux))
124 | return 0x80;
125 | else if (Version.GetType() == typeof(Steam_15_2_1_Windows) ||
126 | Version.GetType () == typeof(Steam_15_3_2_Mac) ||
127 | Version.GetType () == typeof(Steam_15_3_2_Windows))
128 | return 0x88;
129 | else
130 | return 0x0;
131 | }
132 | }
133 |
134 | public short ID
135 | {
136 | get
137 | {
138 | if (Version.GetType() == typeof(Steam_14_3_0_Linux) ||
139 | Version.GetType() == typeof(Steam_14_3_0_Mac) ||
140 | Version.GetType() == typeof(Steam_14_3_1_Linux))
141 | return 0x84;
142 | else if (Version.GetType() == typeof(Steam_15_2_1_Windows) ||
143 | Version.GetType () == typeof(Steam_15_3_2_Mac) ||
144 | Version.GetType () == typeof(Steam_15_3_2_Windows))
145 | return 0x8C;
146 | else
147 | return 0x0;
148 | }
149 | }
150 |
151 | public short PersonAddress {
152 | get {
153 | if (Version.GetType () == typeof(Steam_14_3_0_Linux) ||
154 | Version.GetType () == typeof(Steam_14_3_0_Mac) ||
155 | Version.GetType () == typeof(Steam_14_3_1_Linux))
156 | return 0x90;
157 | else if (Version.GetType () == typeof(Steam_15_2_1_Windows) ||
158 | Version.GetType () == typeof(Steam_15_3_2_Mac) ||
159 | Version.GetType () == typeof(Steam_15_3_2_Windows)) {
160 | return 0x98;
161 | }
162 | else {
163 | return 0x0;
164 | }
165 | }
166 | }
167 |
168 | public short JobAttributes {
169 | get {
170 | if (Version.GetType() == typeof(Steam_14_3_0_Linux) ||
171 | Version.GetType() == typeof(Steam_14_3_0_Mac) ||
172 | Version.GetType() == typeof(Steam_14_3_1_Linux))
173 | return 0x144;
174 | else if (Version.GetType() == typeof(Steam_15_2_1_Windows))
175 | return 0x14C;
176 | else
177 | return 0x0;
178 | }
179 | }
180 | }
181 | }
182 |
183 |
--------------------------------------------------------------------------------
/Defines/Versions/Steam_15_3_2_Mac.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Diagnostics;
4 | using FMScoutFramework.Core.Attributes;
5 | using FMScoutFramework.Core.Managers;
6 |
7 | namespace FMScoutFramework.Core.Entities.GameVersions
8 | {
9 |
10 | internal class Steam_15_3_2_Mac : IIVersion
11 | {
12 | public IVersionMemoryAddresses MemoryAddresses { get; private set; }
13 | public IVersionPersonEnumPointers PersonEnum { get; private set; }
14 | public IPersonVersionOffsets PersonOffsets { get; private set; }
15 |
16 | public Steam_15_3_2_Mac ()
17 | {
18 | MemoryAddresses = new VersionMemoryAddresses ();
19 | PersonEnum = new VersionPersonEnumPointers();
20 | PersonOffsets = new PersonVersionOffsets();
21 | }
22 |
23 | public string Description {
24 | get { return "15.3.2 Steam"; }
25 | }
26 |
27 | public string MainVersionNumber
28 | {
29 | get { return "15"; }
30 | }
31 |
32 | public bool SupportsProcess(FMProcess process, byte[] context)
33 | {
34 | #if LINUX || WINDOWS
35 | return false;
36 | #endif
37 | #if MAC
38 | // Attempt to read the number of continents.
39 | // They MUST be 7
40 | // Then double check the date!
41 | int numberOfObjects = GameManager.TryGetPointerObjects(MemoryAddresses.MainAddress, MemoryAddresses.Continent, ProcessManager.fmProcess, "15");
42 | if (numberOfObjects != 7)
43 | return false;
44 |
45 | DateTime dt = ProcessManager.ReadDateTime (MemoryAddresses.CurrentDateTime);
46 | if (dt.Year < 2012 || dt.Year > 2150)
47 | return false;
48 |
49 | process.VersionDescription = "15.3.2 627044 (m.e v1555)";
50 | return true;
51 | #endif
52 | }
53 |
54 | public class VersionMemoryAddresses : IVersionMemoryAddresses
55 | {
56 | public int MainAddress { get { return 0x2D28944; } }
57 | public int MainOffset { get { return 0x0; } }
58 | public int XorDistance { get { return 0x40; } }
59 | public int StringOffset { get { return 0x0; } }
60 |
61 | public byte[] versionSig {
62 | get {
63 | return new byte[] {
64 | 0x31, 0x00, 0x34, 0x00,
65 | 0x2E, 0x00, 0x33, 0x00,
66 | 0x2E, 0x00, 0x30, 0x00,
67 | 0x20, 0x00, 0x34, 0x00,
68 | 0x37, 0x00, 0x34, 0x00,
69 | 0x31, 0x00, 0x32, 0x00,
70 | 0x39, 0x00, 0x20, 0x00,
71 | 0x28, 0x00, 0x6D, 0x00,
72 | 0x2E, 0x00, 0x65, 0x00,
73 | 0x20, 0x00, 0x76, 0x00,
74 | 0x31, 0x00, 0x34, 0x00,
75 | 0x35, 0x00, 0x34, 0x00,
76 | 0x29, 0x00
77 | };
78 | }
79 | }
80 |
81 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0xC)]
82 | public int Award { get { return 0xC; } }
83 |
84 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x10)]
85 | public int City { get { return 0x10; } }
86 |
87 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x14)]
88 | public int Club { get { return 0x14; } }
89 |
90 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x18)]
91 | public int League { get { return 0x18; } }
92 |
93 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x1C)]
94 | public int Continent { get { return 0x1C; } }
95 |
96 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x20)]
97 | public int Currency { get { return 0x20; } }
98 |
99 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x24)]
100 | public int Unknown1 { get { return 0x24; } }
101 |
102 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
103 | public int Injury { get { return 0x28; } }
104 |
105 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x2C)]
106 | public int MediaSource { get { return 0x2C; } }
107 |
108 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x30)]
109 | public int Language { get { return 0x30; } }
110 |
111 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x34)]
112 | public int LocalRegion { get { return 0x34; } }
113 |
114 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x38)]
115 | public int Nation { get { return 0x38; } }
116 |
117 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x3C)]
118 | public int Person { get { return 0x3C; } }
119 |
120 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x40)]
121 | public int Unknown2 { get { return 0x40; } }
122 |
123 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x44)]
124 | public int Unknown3 { get { return 0x44; } }
125 |
126 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x48)]
127 | public int Sponsors { get { return 0x48; } }
128 |
129 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x4C)]
130 | public int Stadium { get { return 0x4C; } }
131 |
132 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x50)]
133 | public int Unknown4 { get { return 0x50; } }
134 |
135 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x54)]
136 | public int Unknown5 { get { return 0x54; } }
137 |
138 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x58)]
139 | public int Team { get { return 0x58; } }
140 |
141 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x5C)]
142 | public int Weather { get { return 0x5C; } }
143 |
144 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x60)]
145 | public int Unknown6 { get { return 0x60; } }
146 |
147 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x64)]
148 | public int Derby { get { return 0x64; } }
149 |
150 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x68)]
151 | public int Agreement { get { return 0x68; } }
152 |
153 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x6C)]
154 | public int Firstname { get { return 0x6C; } }
155 |
156 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x70)]
157 | public int Lastname { get { return 0x70; } }
158 |
159 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x74)]
160 | public int Commonname { get { return 0x74; } }
161 |
162 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x78)]
163 | public int Unknown7 { get { return 0x78; } }
164 |
165 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x7C)]
166 | public int Unknown8 { get { return 0x7C; } }
167 |
168 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x80)]
169 | public int Unknown9 { get { return 0x80; } }
170 |
171 | public int CurrentDateTime { get { return 0x2D0FD6C; } }
172 | }
173 |
174 | public class VersionPersonEnumPointers : IVersionPersonEnumPointers
175 | {
176 | public int Player { get { return 0x2C78E9C; } }
177 | public int Staff { get { return 0x2C74A08; } }
178 | public int PlayerStaff { get { return 0x2C7BEBC; } }
179 | public int HumanManager { get { return 0x2C80270; } }
180 | public int Official { get { return 0x2C8639C; } }
181 | public int NonPlayer { get { return 0x2C85B68; } }
182 | public int Retired { get { return 0x2C87798; } }
183 | public int Spokesperson { get { return 0x2C8D25C; } }
184 | public int AgentType { get { return 0x2C8A45C; } }
185 | public int Journalist { get { return 0x2C88C88; } }
186 | }
187 |
188 | ///
189 | /// How many bytes the pointer should be corrected for persons.
190 | /// Complies with 'AddressUsedInGame' in FMRTE
191 | ///
192 | public class PersonVersionOffsets : IPersonVersionOffsets
193 | {
194 | public int Person { get { return -0xC4; } }
195 | public int Player { get { return -0x208; } } // OK
196 | public int Staff { get { return -0x84; } }
197 | public int NonPlayer { get { return 0x0; } }
198 | public int PlayerStaff { get { return -0x28C; } }
199 | public int Official { get { return -0xA4; } }
200 | public int Retired { get { return 0x0; } }
201 | public int Spokesperson { get { return -0x40; } }
202 | public int Agent { get { return 0x0; } }
203 | public int Journalist { get { return -0x4C; } }
204 | public int HumanManager { get { return 0x0; } }
205 | }
206 | }
207 | }
--------------------------------------------------------------------------------
/Defines/Versions/Steam_16_2_0_Linux.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Diagnostics;
4 | using FMScoutFramework.Core.Attributes;
5 | using FMScoutFramework.Core.Managers;
6 |
7 | namespace FMScoutFramework.Core.Entities.GameVersions
8 | {
9 |
10 | internal class Steam_16_2_0_Linux : IIVersion
11 | {
12 | public IVersionMemoryAddresses MemoryAddresses { get; private set; }
13 | public IVersionPersonEnumPointers PersonEnum { get; private set; }
14 | public IPersonVersionOffsets PersonOffsets { get; private set; }
15 |
16 | public Steam_16_2_0_Linux ()
17 | {
18 | MemoryAddresses = new VersionMemoryAddresses ();
19 | PersonEnum = new VersionPersonEnumPointers();
20 | PersonOffsets = new PersonVersionOffsets();
21 | }
22 |
23 | public string Description {
24 | get { return "16.2.0 Steam"; }
25 | }
26 |
27 | public string MainVersionNumber
28 | {
29 | get { return "16"; }
30 | }
31 |
32 | public bool SupportsProcess(FMProcess process, byte[] context)
33 | {
34 | #if WINDOWS || MAC
35 | return false;
36 | #endif
37 | #if LINUX
38 | // Attempt to read the number of continents.
39 | // They MUST be 7
40 | // Then double check the date!
41 | int numberOfObjects = GameManager.TryGetPointerObjects(MemoryAddresses.MainAddress, MemoryAddresses.Continent, ProcessManager.fmProcess, "15");
42 | if (numberOfObjects != 7)
43 | return false;
44 |
45 | DateTime dt = ProcessManager.ReadDateTime (MemoryAddresses.CurrentDateTime);
46 | if (dt.Year < 2012 || dt.Year > 2150)
47 | return false;
48 |
49 | process.VersionDescription = "16.2.0 750458 (m.e v1630)";
50 | return true;
51 | #endif
52 | }
53 |
54 | public class VersionMemoryAddresses : IVersionMemoryAddresses
55 | {
56 | public int MainAddress { get { return 0xae8af84; } }
57 | public int MainOffset { get { return 0x0; } }
58 | public int XorDistance { get { return 0x5C; } }
59 | public int StringOffset { get { return 0x0; } }
60 |
61 | public byte[] versionSig {
62 | get {
63 | return new byte[] {
64 | 0x31, 0x00, 0x34, 0x00,
65 | 0x2E, 0x00, 0x33, 0x00,
66 | 0x2E, 0x00, 0x30, 0x00,
67 | 0x20, 0x00, 0x34, 0x00,
68 | 0x37, 0x00, 0x34, 0x00,
69 | 0x31, 0x00, 0x32, 0x00,
70 | 0x39, 0x00, 0x20, 0x00,
71 | 0x28, 0x00, 0x6D, 0x00,
72 | 0x2E, 0x00, 0x65, 0x00,
73 | 0x20, 0x00, 0x76, 0x00,
74 | 0x31, 0x00, 0x34, 0x00,
75 | 0x35, 0x00, 0x34, 0x00,
76 | 0x29, 0x00
77 | };
78 | }
79 | }
80 |
81 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0xC)]
82 | public int Award { get { return 0xC; } }
83 |
84 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x10)]
85 | public int City { get { return 0x10; } }
86 |
87 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x14)]
88 | public int Club { get { return 0x14; } }
89 |
90 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x18)]
91 | public int League { get { return 0x18; } }
92 |
93 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x1C)]
94 | public int Continent { get { return 0x1C; } }
95 |
96 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x20)]
97 | public int Currency { get { return 0x20; } }
98 |
99 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x24)]
100 | public int Unknown1 { get { return 0x24; } }
101 |
102 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
103 | public int Injury { get { return 0x28; } }
104 |
105 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x2C)]
106 | public int MediaSource { get { return 0x2C; } }
107 |
108 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x30)]
109 | public int Language { get { return 0x30; } }
110 |
111 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x34)]
112 | public int LocalRegion { get { return 0x34; } }
113 |
114 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x38)]
115 | public int Nation { get { return 0x38; } }
116 |
117 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x3C)]
118 | public int Person { get { return 0x3C; } }
119 |
120 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x40)]
121 | public int Unknown2 { get { return 0x40; } }
122 |
123 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x44)]
124 | public int Unknown3 { get { return 0x44; } }
125 |
126 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x48)]
127 | public int Sponsors { get { return 0x48; } }
128 |
129 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x4C)]
130 | public int Stadium { get { return 0x4C; } }
131 |
132 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x50)]
133 | public int Unknown4 { get { return 0x50; } }
134 |
135 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x54)]
136 | public int Unknown5 { get { return 0x54; } }
137 |
138 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x58)]
139 | public int Team { get { return 0x58; } }
140 |
141 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x5C)]
142 | public int Weather { get { return 0x5C; } }
143 |
144 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x60)]
145 | public int Unknown6 { get { return 0x60; } }
146 |
147 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x64)]
148 | public int Derby { get { return 0x64; } }
149 |
150 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x68)]
151 | public int Agreement { get { return 0x68; } }
152 |
153 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x6C)]
154 | public int Firstname { get { return 0x6C; } }
155 |
156 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x70)]
157 | public int Lastname { get { return 0x70; } }
158 |
159 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x74)]
160 | public int Commonname { get { return 0x74; } }
161 |
162 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x78)]
163 | public int Unknown7 { get { return 0x78; } }
164 |
165 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x7C)]
166 | public int Unknown8 { get { return 0x7C; } }
167 |
168 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x80)]
169 | public int Unknown9 { get { return 0x80; } }
170 |
171 | public int CurrentDateTime { get { return 0xae7a9a0; } }
172 | }
173 |
174 | public class VersionPersonEnumPointers : IVersionPersonEnumPointers
175 | {
176 | public int Player { get { return 0x2C78E9C; } }
177 | public int Staff { get { return 0x2C74A08; } }
178 | public int PlayerStaff { get { return 0x2C7BEBC; } }
179 | public int HumanManager { get { return 0x2C80270; } }
180 | public int Official { get { return 0x2C8639C; } }
181 | public int NonPlayer { get { return 0x2C85B68; } }
182 | public int Retired { get { return 0x2C87798; } }
183 | public int Spokesperson { get { return 0x2C8D25C; } }
184 | public int AgentType { get { return 0x2C8A45C; } }
185 | public int Journalist { get { return 0x2C88C88; } }
186 | }
187 |
188 | ///
189 | /// How many bytes the pointer should be corrected for persons.
190 | /// Complies with 'AddressUsedInGame' in FMRTE
191 | ///
192 | public class PersonVersionOffsets : IPersonVersionOffsets
193 | {
194 | public int Person { get { return -0xC4; } }
195 | public int Player { get { return -0x208; } } // OK
196 | public int Staff { get { return -0x84; } }
197 | public int NonPlayer { get { return 0x0; } }
198 | public int PlayerStaff { get { return -0x28C; } }
199 | public int Official { get { return -0xA4; } }
200 | public int Retired { get { return 0x0; } }
201 | public int Spokesperson { get { return -0x40; } }
202 | public int Agent { get { return 0x0; } }
203 | public int Journalist { get { return -0x4C; } }
204 | public int HumanManager { get { return 0x0; } }
205 | }
206 | }
207 | }
--------------------------------------------------------------------------------
/Defines/Versions/Steam_15_3_2_Windows.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Diagnostics;
4 | using FMScoutFramework.Core.Attributes;
5 | using FMScoutFramework.Core.Managers;
6 |
7 | namespace FMScoutFramework.Core.Entities.GameVersions
8 | {
9 |
10 | internal class Steam_15_3_2_Windows : IIVersion
11 | {
12 | public IVersionMemoryAddresses MemoryAddresses { get; private set; }
13 | public IVersionPersonEnumPointers PersonEnum { get; private set; }
14 | public IPersonVersionOffsets PersonOffsets { get; private set; }
15 |
16 | public Steam_15_3_2_Windows()
17 | {
18 | MemoryAddresses = new VersionMemoryAddresses();
19 | PersonEnum = new VersionPersonEnumPointers();
20 | PersonOffsets = new PersonVersionOffsets();
21 | }
22 |
23 | public string Description
24 | {
25 | get { return "15.3.2 Steam"; }
26 | }
27 |
28 | public string MainVersionNumber
29 | {
30 | get { return "15"; }
31 | }
32 |
33 | public bool SupportsProcess(FMProcess process, byte[] context)
34 | {
35 | #if LINUX || MAC
36 | return false;
37 | #endif
38 |
39 | #if WINDOWS
40 | if (process.VersionDescription != "15.3.2f627042") return false;
41 |
42 | var dt = ProcessManager.ReadDateTime(process.BaseAddress + MemoryAddresses.CurrentDateTime);
43 | if (dt.Year < 2012 || dt.Year > 2150)
44 | return false;
45 |
46 | return true;
47 | #endif
48 | }
49 |
50 | public class VersionMemoryAddresses : IVersionMemoryAddresses
51 | {
52 | public int MainAddress { get { return 0x1A8484E; } }
53 | public int MainOffset { get { return 0x0; } }
54 | public int XorDistance { get { return 0x40; } } // Not XOR but useful
55 | public int StringOffset { get { return 0x0; } }
56 |
57 | public byte[] versionSig
58 | {
59 | get
60 | {
61 | return new byte[] {
62 | 0x31, 0x00, 0x34, 0x00,
63 | 0x2E, 0x00, 0x33, 0x00,
64 | 0x2E, 0x00, 0x30, 0x00,
65 | 0x20, 0x00, 0x34, 0x00,
66 | 0x37, 0x00, 0x34, 0x00,
67 | 0x31, 0x00, 0x32, 0x00,
68 | 0x37, 0x00, 0x20, 0x00,
69 | 0x28, 0x00, 0x6D, 0x00,
70 | 0x2E, 0x00, 0x65, 0x00,
71 | 0x20, 0x00, 0x76, 0x00,
72 | 0x31, 0x00, 0x34, 0x00,
73 | 0x35, 0x00, 0x34, 0x00,
74 | 0x29, 0x00
75 | };
76 | }
77 | }
78 |
79 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0xC)]
80 | public int Award { get { return 0x0; } }
81 |
82 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x10)]
83 | public int City { get { return 0x0; } }
84 |
85 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x14)]
86 | public int Club { get { return 0x0; } }
87 |
88 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x18)]
89 | public int League { get { return 0x0; } }
90 |
91 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x1C)]
92 | public int Continent { get { return 0x0; } }
93 |
94 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x20)]
95 | public int Currency { get { return 0x0; } }
96 |
97 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x24)]
98 | public int Unknown1 { get { return 0x0; } }
99 |
100 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
101 | public int Injury { get { return 0x0; } }
102 |
103 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x2C)]
104 | public int MediaSource { get { return 0x0; } }
105 |
106 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x30)]
107 | public int Language { get { return 0x0; } }
108 |
109 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x34)]
110 | public int LocalRegion { get { return 0x0; } }
111 |
112 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x38)]
113 | public int Nation { get { return 0x0; } }
114 |
115 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x3C)]
116 | public int Person { get { return 0x0; } }
117 |
118 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x40)]
119 | public int Unknown2 { get { return 0x0; } }
120 |
121 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x44)]
122 | public int Unknown3 { get { return 0x0; } }
123 |
124 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x48)]
125 | public int Sponsors { get { return 0x0; } }
126 |
127 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x4C)]
128 | public int Stadium { get { return 0x0; } }
129 |
130 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x50)]
131 | public int Unknown4 { get { return 0x0; } }
132 |
133 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x54)]
134 | public int Unknown5 { get { return 0x0; } }
135 |
136 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x58)]
137 | public int Team { get { return 0x0; } }
138 |
139 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x5C)]
140 | public int Weather { get { return 0x0; } }
141 |
142 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x60)]
143 | public int Unknown6 { get { return 0x0; } }
144 |
145 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x64)]
146 | public int Derby { get { return 0x0; } }
147 |
148 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x68)]
149 | public int Agreement { get { return 0x0; } }
150 |
151 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x6C)]
152 | public int Firstname { get { return 0x0; } }
153 |
154 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x70)]
155 | public int Lastname { get { return 0x0; } }
156 |
157 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x74)]
158 | public int Commonname { get { return 0x0; } }
159 |
160 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x78)]
161 | public int Unknown7 { get { return 0x0; } }
162 |
163 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x7C)]
164 | public int Unknown8 { get { return 0x0; } }
165 |
166 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x80)]
167 | public int Unknown9 { get { return 0x0; } }
168 |
169 | public int CurrentDateTime { get { return 0x1F9EBF4; } }
170 | }
171 |
172 | public class VersionPersonEnumPointers : IVersionPersonEnumPointers
173 | {
174 | public int Player { get { return 0x2266654; } }
175 | public int Staff { get { return 0x2264BC0; } }
176 | public int NonPlayer { get { return 0x2263EBC; } }
177 | public int PlayerStaff { get { return 0x226C1C8; } }
178 | public int HumanManager { get { return 0x225D490; } }
179 | public int Official { get { return 0x2267C40; } }
180 | public int RetiredPerson { get { return 0x2263B00; } }
181 | public int Journalist { get { return 0x226A7C4; } }
182 | }
183 |
184 | ///
185 | /// How many bytes the pointer should be corrected for persons.
186 | ///
187 | public class PersonVersionOffsets : IPersonVersionOffsets
188 | {
189 | public int Person { get { return -0xC4; } }
190 | public int Player { get { return -0x208; } }
191 | public int Staff { get { return -0x84; } }
192 | public int NonPlayer { get { return 0x0; } }
193 | public int HumanManager { get { return -0x44; } }
194 | public int PlayerStaff { get { return -0x28C; } }
195 | public int Official { get { return -0xA4; } }
196 | public int Retired { get { return 0x0; } }
197 | public int Journalist { get { return -0x4C; } }
198 | }
199 | }
200 | }
--------------------------------------------------------------------------------
/Defines/Versions/Steam_16_2_0_Windows.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Diagnostics;
4 | using FMScoutFramework.Core.Attributes;
5 | using FMScoutFramework.Core.Managers;
6 |
7 | namespace FMScoutFramework.Core.Entities.GameVersions
8 | {
9 |
10 | internal class Steam_16_2_0_Windows : IIVersion
11 | {
12 | public IVersionMemoryAddresses MemoryAddresses { get; private set; }
13 | public IVersionPersonEnumPointers PersonEnum { get; private set; }
14 | public IPersonVersionOffsets PersonOffsets { get; private set; }
15 |
16 | public Steam_16_2_0_Windows()
17 | {
18 | MemoryAddresses = new VersionMemoryAddresses();
19 | PersonEnum = new VersionPersonEnumPointers();
20 | PersonOffsets = new PersonVersionOffsets();
21 | }
22 |
23 | public string Description
24 | {
25 | get { return "16.2.0 Steam"; }
26 | }
27 |
28 | public string MainVersionNumber
29 | {
30 | get { return "16"; }
31 | }
32 |
33 | public bool SupportsProcess(FMProcess process, byte[] context)
34 | {
35 | #if LINUX || MAC
36 | return false;
37 | #endif
38 |
39 | #if WINDOWS
40 | if (process.VersionDescription != "16.2.0f750467") return false;
41 |
42 | var dt = ProcessManager.ReadDateTime(process.BaseAddress + MemoryAddresses.CurrentDateTime);
43 | if (dt.Year < 2012 || dt.Year > 2150)
44 | return false;
45 |
46 | return true;
47 | #endif
48 | }
49 |
50 | public class VersionMemoryAddresses : IVersionMemoryAddresses
51 | {
52 | public int MainAddress { get { return 0x2557388; } }
53 | public int MainOffset { get { return 0x0; } }
54 | public int XorDistance { get { return 0x48; } } // Not XOR but useful
55 | public int StringOffset { get { return 0x0; } }
56 |
57 | public byte[] versionSig
58 | {
59 | get
60 | {
61 | return new byte[] {
62 | 0x31, 0x00, 0x34, 0x00,
63 | 0x2E, 0x00, 0x33, 0x00,
64 | 0x2E, 0x00, 0x30, 0x00,
65 | 0x20, 0x00, 0x34, 0x00,
66 | 0x37, 0x00, 0x34, 0x00,
67 | 0x31, 0x00, 0x32, 0x00,
68 | 0x37, 0x00, 0x20, 0x00,
69 | 0x28, 0x00, 0x6D, 0x00,
70 | 0x2E, 0x00, 0x65, 0x00,
71 | 0x20, 0x00, 0x76, 0x00,
72 | 0x31, 0x00, 0x34, 0x00,
73 | 0x35, 0x00, 0x34, 0x00,
74 | 0x29, 0x00
75 | };
76 | }
77 | }
78 |
79 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0xC)]
80 | public int Award { get { return 0x0; } }
81 |
82 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x10)]
83 | public int City { get { return 0x0; } }
84 |
85 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x14)]
86 | public int Club { get { return 0x0; } }
87 |
88 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x18)]
89 | public int League { get { return 0x0; } }
90 |
91 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x1C)]
92 | public int Continent { get { return 0x0; } }
93 |
94 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x20)]
95 | public int Currency { get { return 0x0; } }
96 |
97 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x24)]
98 | public int Unknown1 { get { return 0x0; } }
99 |
100 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
101 | public int Injury { get { return 0x0; } }
102 |
103 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x2C)]
104 | public int MediaSource { get { return 0x0; } }
105 |
106 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x30)]
107 | public int Language { get { return 0x0; } }
108 |
109 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x34)]
110 | public int LocalRegion { get { return 0x0; } }
111 |
112 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x38)]
113 | public int Nation { get { return 0x0; } }
114 |
115 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x3C)]
116 | public int Person { get { return 0x0; } }
117 |
118 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x40)]
119 | public int Unknown2 { get { return 0x0; } }
120 |
121 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x44)]
122 | public int Unknown3 { get { return 0x0; } }
123 |
124 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x48)]
125 | public int Sponsors { get { return 0x0; } }
126 |
127 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x4C)]
128 | public int Stadium { get { return 0x0; } }
129 |
130 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x50)]
131 | public int Unknown4 { get { return 0x0; } }
132 |
133 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x54)]
134 | public int Unknown5 { get { return 0x0; } }
135 |
136 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x58)]
137 | public int Team { get { return 0x0; } }
138 |
139 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x5C)]
140 | public int Weather { get { return 0x0; } }
141 |
142 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x60)]
143 | public int Unknown6 { get { return 0x0; } }
144 |
145 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x64)]
146 | public int Derby { get { return 0x0; } }
147 |
148 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x68)]
149 | public int Agreement { get { return 0x0; } }
150 |
151 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x6C)]
152 | public int Firstname { get { return 0x0; } }
153 |
154 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x70)]
155 | public int Lastname { get { return 0x0; } }
156 |
157 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x74)]
158 | public int Commonname { get { return 0x0; } }
159 |
160 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x78)]
161 | public int Unknown7 { get { return 0x0; } }
162 |
163 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x7C)]
164 | public int Unknown8 { get { return 0x0; } }
165 |
166 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x80)]
167 | public int Unknown9 { get { return 0x0; } }
168 |
169 | public int CurrentDateTime { get { return 0x2542a92; } }
170 | }
171 |
172 | public class VersionPersonEnumPointers : IVersionPersonEnumPointers
173 | {
174 | public int Player { get { return 0x2266654; } }
175 | public int Staff { get { return 0x2264BC0; } }
176 | public int NonPlayer { get { return 0x2263EBC; } }
177 | public int PlayerStaff { get { return 0x226C1C8; } }
178 | public int HumanManager { get { return 0x225D490; } }
179 | public int Official { get { return 0x2267C40; } }
180 | public int RetiredPerson { get { return 0x2263B00; } }
181 | public int Journalist { get { return 0x226A7C4; } }
182 | }
183 |
184 | ///
185 | /// How many bytes the pointer should be corrected for persons.
186 | ///
187 | public class PersonVersionOffsets : IPersonVersionOffsets
188 | {
189 | public int Person { get { return -0xC4; } }
190 | public int Player { get { return -0x208; } }
191 | public int Staff { get { return -0x84; } }
192 | public int NonPlayer { get { return 0x0; } }
193 | public int HumanManager { get { return -0x44; } }
194 | public int PlayerStaff { get { return -0x28C; } }
195 | public int Official { get { return -0xA4; } }
196 | public int Retired { get { return 0x0; } }
197 | public int Journalist { get { return -0x4C; } }
198 | }
199 | }
200 | }
--------------------------------------------------------------------------------
/Entities/Ingame/ClubFinances.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using FMScoutFramework.Core.Entities.GameVersions;
4 | using FMScoutFramework.Core.Managers;
5 | using FMScoutFramework.Core.Offsets;
6 | using FMScoutFramework.Core.Attributes;
7 | using FMScoutFramework.Core.Entities.InGame.Interfaces;
8 | using FMScoutFramework.Core.Utilities;
9 |
10 | namespace FMScoutFramework.Core.Entities.InGame
11 | {
12 | public class ClubFinances : BaseObject, IClubFinances
13 | {
14 | public ClubFinancesOffsets ClubFinancesOffsets;
15 | public ClubFinances (int memoryAddress, IVersion version)
16 | : base(memoryAddress, version)
17 | {
18 | this.ClubFinancesOffsets = new ClubFinancesOffsets(version);
19 | }
20 | public ClubFinances (int memoryAddress, ArraySegment originalBytes, IVersion version)
21 | : base(memoryAddress, originalBytes, version)
22 | {
23 | this.ClubFinancesOffsets = new ClubFinancesOffsets(version);
24 | }
25 |
26 | public int Balance {
27 | get {
28 | if (Version.GetType() == typeof(Steam_14_3_0_Linux) ||
29 | Version.GetType() == typeof(Steam_14_3_0_Mac) ||
30 | Version.GetType() == typeof(Steam_14_3_0_Windows) ||
31 | Version.GetType() == typeof(Steam_14_3_1_Linux) ||
32 | Version.GetType() == typeof(Steam_14_3_1_Windows))
33 | {
34 | try {
35 | int rotateAmount = ((MemoryAddress + ClubFinancesOffsets.Balance) & 31);
36 | UInt32 encryptedBalance = (UInt32)ProcessManager.ReadUInt32(MemoryAddress + ClubFinancesOffsets.Balance);
37 | encryptedBalance = BitwiseOperations.rol(encryptedBalance, rotateAmount);
38 | encryptedBalance = (encryptedBalance ^ 0x513130E);
39 | encryptedBalance = BitwiseOperations.rol(encryptedBalance, 9);
40 | encryptedBalance = ~encryptedBalance;
41 |
42 | return (int)encryptedBalance;
43 | }
44 | catch {
45 | return 0;
46 | }
47 | }
48 | else if (Version.GetType() == typeof(Steam_16_3_0_Windows) ||
49 | Version.GetType() == typeof(Steam_16_3_1_Windows) ||
50 | Version.GetType() == typeof(Steam_16_3_2_Windows))
51 | {
52 | try
53 | {
54 | int rotateAmount = ((MemoryAddress + ClubFinancesOffsets.Balance) & 0x1f);
55 | uint encryptedBalance = (uint)ProcessManager.ReadInt32(MemoryAddress + ClubFinancesOffsets.Balance);
56 |
57 | encryptedBalance = BitwiseOperations.rol(encryptedBalance, rotateAmount);
58 | encryptedBalance = (encryptedBalance ^ 0xFAECECF1);
59 | encryptedBalance = ~encryptedBalance;
60 | encryptedBalance = BitwiseOperations.ror(encryptedBalance, 0x17);
61 | encryptedBalance = ~encryptedBalance;
62 |
63 | return (int)encryptedBalance;
64 | }
65 | catch
66 | {
67 | return 0;
68 | }
69 | }
70 | else {
71 | return 0;
72 | }
73 | }
74 | set
75 | {
76 | if (Version.GetType() == typeof(Steam_16_3_0_Windows) ||
77 | Version.GetType() == typeof(Steam_16_3_1_Windows) ||
78 | Version.GetType() == typeof(Steam_16_3_2_Windows))
79 | {
80 | try
81 | {
82 | int rotateAmount = ((MemoryAddress + ClubFinancesOffsets.Balance) & 0x1f);
83 | uint encryptedBalance = (uint)value;
84 |
85 | encryptedBalance = ~encryptedBalance;
86 | encryptedBalance = BitwiseOperations.rol(encryptedBalance, 0x17);
87 | encryptedBalance = ~encryptedBalance;
88 | encryptedBalance = (encryptedBalance ^ 0xFAECECF1);
89 | encryptedBalance = BitwiseOperations.ror(encryptedBalance, rotateAmount);
90 |
91 | PropertyInvoker.Set(ClubFinancesOffsets.Balance, OriginalBytes, MemoryAddress, DatabaseMode, value);
92 | }
93 | catch
94 | {
95 | // TODO: Add exception
96 | }
97 | }
98 | }
99 | }
100 |
101 | public int RemainingBudget {
102 | get {
103 | return PropertyInvoker.Get (ClubFinancesOffsets.RemainingBudget, OriginalBytes, MemoryAddress, DatabaseMode);
104 | }
105 | set
106 | {
107 | PropertyInvoker.Set(ClubFinancesOffsets.RemainingBudget, OriginalBytes, MemoryAddress, DatabaseMode, value);
108 | }
109 | }
110 |
111 | public int SeasonTransferFunds {
112 | get {
113 | return PropertyInvoker.Get (ClubFinancesOffsets.SeasonTransferFunds, OriginalBytes, MemoryAddress, DatabaseMode);
114 | }
115 | set
116 | {
117 | PropertyInvoker.Set(ClubFinancesOffsets.SeasonTransferFunds, OriginalBytes, MemoryAddress, DatabaseMode, value);
118 | }
119 | }
120 |
121 | public int TransferIncomePercentage {
122 | get {
123 | return PropertyInvoker.Get (ClubFinancesOffsets.TransferIncomePercentage, OriginalBytes, MemoryAddress, DatabaseMode);
124 | }
125 | set
126 | {
127 | PropertyInvoker.Set(ClubFinancesOffsets.TransferIncomePercentage, OriginalBytes, MemoryAddress, DatabaseMode, value);
128 | }
129 | }
130 |
131 | public int YouthGrantIncome {
132 | get {
133 | return PropertyInvoker.Get (ClubFinancesOffsets.YouthGrantIncome, OriginalBytes, MemoryAddress, DatabaseMode);
134 | }
135 | set
136 | {
137 | PropertyInvoker.Set(ClubFinancesOffsets.YouthGrantIncome, OriginalBytes, MemoryAddress, DatabaseMode, value);
138 | }
139 | }
140 |
141 | public int WeeklyWageBudget {
142 | get {
143 | return PropertyInvoker.Get (ClubFinancesOffsets.WeeklyWageBudget, OriginalBytes, MemoryAddress, DatabaseMode);
144 | }
145 | set
146 | {
147 | PropertyInvoker.Set(ClubFinancesOffsets.WeeklyWageBudget, OriginalBytes, MemoryAddress, DatabaseMode, value);
148 | }
149 | }
150 |
151 | public int HighestWage
152 | {
153 | get
154 | {
155 | return PropertyInvoker.Get(ClubFinancesOffsets.HighestWage, OriginalBytes, MemoryAddress, DatabaseMode);
156 | }
157 | set
158 | {
159 | PropertyInvoker.Set(ClubFinancesOffsets.HighestWage, OriginalBytes, MemoryAddress, DatabaseMode, value);
160 | }
161 | }
162 |
163 | public int HighestWagePaid {
164 | get {
165 | return PropertyInvoker.Get (ClubFinancesOffsets.HighestWagePaid, OriginalBytes, MemoryAddress, DatabaseMode);
166 | }
167 | set
168 | {
169 | PropertyInvoker.Set(ClubFinancesOffsets.HighestWagePaid, OriginalBytes, MemoryAddress, DatabaseMode, value);
170 | }
171 | }
172 |
173 | public int LatestSeasonTicketsAddress {
174 | get {
175 | return PropertyInvoker.Get (ClubFinancesOffsets.LatestSeasonTicketSales, OriginalBytes, MemoryAddress, DatabaseMode);
176 | }
177 | set
178 | {
179 | PropertyInvoker.Set(ClubFinancesOffsets.LatestSeasonTicketSales, OriginalBytes, MemoryAddress, DatabaseMode, value);
180 | }
181 | }
182 |
183 | public int LastestSeasonTickets {
184 | get {
185 | return PropertyInvoker.Get (0x0, OriginalBytes, this.LatestSeasonTicketsAddress, DatabaseMode);
186 | }
187 | set
188 | {
189 | PropertyInvoker.Set(0x0, OriginalBytes, this.LatestSeasonTicketsAddress, DatabaseMode, value);
190 | }
191 | }
192 | }
193 | }
--------------------------------------------------------------------------------
/FMScoutFramework.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Linux-Debug
5 | AnyCPU
6 | {E74FE82A-2E12-4C51-AD24-7D2DDE5C36A6}
7 | Library
8 | FMScoutFramework
9 | FMScoutFramework
10 | v4.5
11 |
12 |
13 | true
14 | full
15 | false
16 | bin\Debug
17 | DEBUG;LINUX;
18 | prompt
19 | 4
20 | false
21 | v4.5
22 | true
23 |
24 |
25 | true
26 | bin\Release
27 | RELEASE;LINUX;
28 | prompt
29 | 4
30 | false
31 | v4.5
32 | true
33 |
34 |
35 | true
36 | false
37 | bin\Windows-Debug
38 | DEBUG;WINDOWS;
39 | 4
40 |
41 |
42 | true
43 | bin\Windows-Release
44 | RELEASE;WINDOWS;
45 | 4
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
--------------------------------------------------------------------------------
/Defines/Versions/Steam_16_3_0_Windows.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Diagnostics;
4 | using FMScoutFramework.Core.Attributes;
5 | using FMScoutFramework.Core.Managers;
6 |
7 | namespace FMScoutFramework.Core.Entities.GameVersions
8 | {
9 |
10 | internal class Steam_16_3_0_Windows : IIVersion
11 | {
12 | public IVersionMemoryAddresses MemoryAddresses { get; private set; }
13 | public IVersionPersonEnumPointers PersonEnum { get; private set; }
14 | public IPersonVersionOffsets PersonOffsets { get; private set; }
15 |
16 | public Steam_16_3_0_Windows()
17 | {
18 | MemoryAddresses = new VersionMemoryAddresses();
19 | PersonEnum = new VersionPersonEnumPointers();
20 | PersonOffsets = new PersonVersionOffsets();
21 | }
22 |
23 | public string Description
24 | {
25 | get { return "16.3.0 Steam"; }
26 | }
27 |
28 | public string MainVersionNumber
29 | {
30 | get { return "16"; }
31 | }
32 |
33 | public bool SupportsProcess(FMProcess process, byte[] context)
34 | {
35 | #if LINUX || MAC
36 | return false;
37 | #endif
38 |
39 | #if WINDOWS
40 | if (process.VersionDescription != "16.3.0f776772") return false;
41 |
42 | var dt = ProcessManager.ReadDateTime(process.BaseAddress + MemoryAddresses.CurrentDateTime);
43 | if (dt.Year < 2012 || dt.Year > 2150)
44 | return false;
45 |
46 | return true;
47 | #endif
48 | }
49 |
50 | public class VersionMemoryAddresses : IVersionMemoryAddresses
51 | {
52 | public int MainAddress { get { return 0x25706C8; } }
53 | public int MainOffset { get { return 0x0; } }
54 | public int XorDistance { get { return 0x48; } } // Not XOR but useful
55 | public int StringOffset { get { return 0x0; } }
56 |
57 | public byte[] versionSig
58 | {
59 | get
60 | {
61 | return new byte[] {
62 | 0x31, 0x00, 0x34, 0x00,
63 | 0x2E, 0x00, 0x33, 0x00,
64 | 0x2E, 0x00, 0x30, 0x00,
65 | 0x20, 0x00, 0x34, 0x00,
66 | 0x37, 0x00, 0x34, 0x00,
67 | 0x31, 0x00, 0x32, 0x00,
68 | 0x37, 0x00, 0x20, 0x00,
69 | 0x28, 0x00, 0x6D, 0x00,
70 | 0x2E, 0x00, 0x65, 0x00,
71 | 0x20, 0x00, 0x76, 0x00,
72 | 0x31, 0x00, 0x34, 0x00,
73 | 0x35, 0x00, 0x34, 0x00,
74 | 0x29, 0x00
75 | };
76 | }
77 | }
78 |
79 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0xC)]
80 | public int Award { get { return 0x0; } }
81 |
82 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x10)]
83 | public int City { get { return 0x0; } }
84 |
85 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x14)]
86 | public int Club { get { return 0x0; } }
87 |
88 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x18)]
89 | public int League { get { return 0x0; } }
90 |
91 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x1C)]
92 | public int Continent { get { return 0x0; } }
93 |
94 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x20)]
95 | public int Currency { get { return 0x0; } }
96 |
97 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x24)]
98 | public int Unknown1 { get { return 0x0; } }
99 |
100 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
101 | public int Injury { get { return 0x0; } }
102 |
103 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x2C)]
104 | public int MediaSource { get { return 0x0; } }
105 |
106 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x30)]
107 | public int Language { get { return 0x0; } }
108 |
109 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x34)]
110 | public int LocalRegion { get { return 0x0; } }
111 |
112 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x38)]
113 | public int Nation { get { return 0x0; } }
114 |
115 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x3C)]
116 | public int Person { get { return 0x0; } }
117 |
118 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x40)]
119 | public int Unknown2 { get { return 0x0; } }
120 |
121 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x44)]
122 | public int Unknown3 { get { return 0x0; } }
123 |
124 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x48)]
125 | public int Sponsors { get { return 0x0; } }
126 |
127 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x4C)]
128 | public int Stadium { get { return 0x0; } }
129 |
130 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x50)]
131 | public int Unknown4 { get { return 0x0; } }
132 |
133 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x54)]
134 | public int Unknown5 { get { return 0x0; } }
135 |
136 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x58)]
137 | public int Team { get { return 0x0; } }
138 |
139 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x5C)]
140 | public int Weather { get { return 0x0; } }
141 |
142 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x60)]
143 | public int Unknown6 { get { return 0x0; } }
144 |
145 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x64)]
146 | public int Derby { get { return 0x0; } }
147 |
148 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x68)]
149 | public int Agreement { get { return 0x0; } }
150 |
151 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x6C)]
152 | public int Firstname { get { return 0x0; } }
153 |
154 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x70)]
155 | public int Lastname { get { return 0x0; } }
156 |
157 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x74)]
158 | public int Commonname { get { return 0x0; } }
159 |
160 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x78)]
161 | public int Unknown7 { get { return 0x0; } }
162 |
163 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x7C)]
164 | public int Unknown8 { get { return 0x0; } }
165 |
166 | [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x80)]
167 | public int Unknown9 { get { return 0x0; } }
168 |
169 | public int CurrentDateTime { get { return 0x255BCDA; } }
170 | }
171 |
172 | public class VersionPersonEnumPointers : IVersionPersonEnumPointers
173 | {
174 | public int Player { get { return 0x277F19C; } } // Done
175 | public int Staff { get { return 0x277D734; } } // Done
176 | public int NonPlayer { get { return 0x2263EBC; } }
177 | public int PlayerStaff { get { return 0x2785E00; } } // Done
178 | public int HumanManager { get { return 0x2775720; } } // Done
179 | public int Official { get { return 0x2267C40; } }
180 | public int RetiredPerson { get { return 0x2263B00; } }
181 | public int Journalist { get { return 0x226A7C4; } }
182 | }
183 |
184 | ///
185 | /// How many bytes the pointer should be corrected for persons.
186 | ///
187 | public class PersonVersionOffsets : IPersonVersionOffsets
188 | {
189 | public int Person { get { return -0x0; } }
190 | public int Player { get { return -0x154; } }
191 | public int Staff { get { return -0x84; } }
192 | public int NonPlayer { get { return 0x0; } }
193 | public int HumanManager { get { return -0x44; } }
194 | public int PlayerStaff { get { return -0x28C; } }
195 | public int Official { get { return -0xA4; } }
196 | public int Retired { get { return 0x0; } }
197 | public int Journalist { get { return -0x4C; } }
198 | }
199 | }
200 | }
--------------------------------------------------------------------------------