Home
FM Discord
YouTube Channel
FM24 Data Update
FM26 Data Update
FM26 OOP Player Roles
Downloads
Graphics
Challenges
Blog
Forums
Videos
Tactics
FM26
FM26 Real Name Fix
FM26 Shortlists
FM26 DB
FM26 Men's Wonderkids
FM26 Women's Wonderkids
FM26 Men's Club Finances
FM26 Women's Club Finances
FM24 Update
FM24
FM23
FM Saves
FM Database
FM Guides
Installation Guides
Records
Search
Footygamer
Please use this thread for discussing decompiling, reverse engineering and debugging Football Manager's code and assets.
Decompiling Unity games lets you extract and read the original C# code to understand how game systems work under the hood. Tools like AssetRipper can extract entire Unity projects including scripts, assets, and scenes, while Il2CppDumper generates dummy DLLs from IL2CPP builds. dnSpy is particularly powerful because it combines decompilation with live debugging - you can set breakpoints, inspect variables, and step through the actual game code as it runs. ILSpy and dotPeek are great for quick code browsing and exporting decompiled source. These tools are essential for reverse-engineering game mechanics, finding hidden variables, understanding data structures, and figuring out method signatures for Harmony patches.
https://github.com/AssetRipper/AssetRipper
https://github.com/dnSpy/dnSpy
https://github.com/icsharpcode/ILSpy
https://www.jetbrains.com/decompiler/
https://github.com/Perfare/Il2CppDumper
https://github.com/SamboyCoding/Cpp2IL
https://github.com/djkaty/Il2CppInspector
thehologram
I used Il2CppDumper and it worked fine to produce something valid that loads up in dnSpy. My cursory review of the api is that what is exposed looks barely useful. Not sure if they even have the raw memory pointer available in the underlying reference objects. Will need to actually wire that up to confirm. I think they have the database id so there is probably an api to look up objects from the id or hopefully done automatically. Seems like it might be convoluted to get access to underlying data. A lot of it was very generic wrappers so for example no obvious way to navigate through teams to squads to players and staff from just the C# api. Or to just get all attributes on a player or even their name. Probably still easier to go straight at the underlying raw pointers in something like cheat engine like before. I'm really not sure if I'll have time for a while to hack around seriously so I guess tdg6661 may need to step up for cheat engine again. I guess we will have to reverse engineer the underlying screens to see how they are using the data-binding and object marshaling for better examples.
That kind of disappoints me so I just hope I overlooked something obvious as I only spent 30 minutes or so on it.
As an aside, I've never converted my IronPython-based scripting console to Il2Cpp even though I suspect it has a decent chance of working. I would love to do that if the api was more pleasant to work with but I'm not sure it would be so probably still not the time to fix that up.
Footygamer
What's the IronPython scripting console?
Also just tagging @tdg6661 since you mentioned him and I don't know if he's aware of this thread
thehologram
No need. I'm sure he is aware of the game and took back the CE table from me for FM24 and did a lot of extra work to it. Probably capable of doing the work themselves. Also I think that discussion might be more appropriate in another one of your other threads here.
The console is this. Haven't updated the public repository for years as I just keep private forks for whatever games I'm toying with. The challenge with il2cpp is that we have to remap all of the mono_ apis to the il2cpp_ equivalents and recompile it. Doable but usually of questionable value. Also a lot of newer unity games ship with jit/reflection apis disabled so you have to swap out one of the System dlls which I'm not sure how that would work with il2cpp and might not allow reflection at all which would break the value of the python scripting.
https://github.com/TheHologram/unity-console
On that note I was able to get the core of my FM23 CE table partially working. That is found vtable offsets for player, clubs and whatnot. The challenge now would be correlating the C# objects with the underlying player objects assuming there is some thing useful. Next will be to get some stable way of matching what is on screen with those objects. To get that table working.
BassyBoyYT
I have also started to try to reverse engineer the game and have got everything ripped. My experience in C# and unity is close to zero, but I am so fed up I am willing to learn most of it. Currently trying to import the project to Unity and have got all scripts extracted. For some weird reason using BepInEx to generate the plugins and after extracting to scripts gives the UnityEngine.UI error that the C# language is not 10. Weird because the game uses these….
Anyway, hopefully it's useful to some of you. I'm now going to try and get it to work in Unity. If there's owt I can do lemme know!
thehologram
The code generator is generating newer syntax than the mono compiler supports I guess. Its just a compiler syntax thing.
namespace FM.UI;public class PersonReference {}When it should be something like this for C# 9
namespace FM.UI{public class PersonReference { }}BassyBoyYT
I'll just ask the question right up then, what is the solution or how would you try to resolve this? Change the syntax for every script?
benithemaker
I did some experiments yesterday and managed to build an asset bundle with the files I modified, replaced it with the original bundle but it made the game crash. I think they're using a custom-built plugin for the packaging process. Maybe addressable settings cause the crash, not sure.
Also, Importing assets into the project is killing me (takes about an hour each time), but I'm still experimenting.
thehologram
If you can ask the code decompiler to generate a different syntax do that. Otherwise unfortunately you need to change the syntax. If you have Claude or Copilot you could ask the AI to do that for you I guess. Probably just easier to edit every file. Maybe sed/awk your way through and change
namespace XXX;tonamespace xxx {then add}to the end of every file.Alternately use a different compiler to compile it. Not sure your setup. I think you can externalize Unity to compile with a Visual Studio instead. Its been a while since I hacked inside Unity directly.
BassyBoy
Alright! Thanks for the response! I'll give it a bash when I'm back home.
thehologram
On the data access front, I haven't found the exact code but the behavior seems to be very cache oriented. Basically the C# objects look like they get a cache of the real data periodically. So for example click on your manager after hitting continue and it will load the manager object from the game_plugin.dll object and marshal it to the C# object. It will use that data for display until you press Continue or similar event. They did this occasionally in the older games to speed up data access on some screens. I think the implication is that you will not be able to make direct changes to the underlying object from C#. It is likely used for display only and changes will got through methods which are called.
Not entirely unreasonable for performance but it makes it more difficult to write in game editors and what not. For direct edits, CE may still be the better tool this time around. Not 100% confident in the finding but seems to be the case based on data access patterns.
Brululul
I just started to explore some of the code, besides this thread, is there any discord/forum where modding and decompiling is being discussed? would be curious to see what everyone else is doing, I am a unity dev myself but tbh I have limited knowledge on modding.
thehologram
I'm not aware of any at the moment. I've unplugged from various scenes I was involved in over the years. I'm sure there are discords and what not but I'm not a member of any of that. nexusmods will likely enter the picture at some point for distribution if its easy to useful mods that work. I'm pretty much stick to this forum and fearlessrevolution.com for my hacking away at stuff. I noticed they had hacking boards here so I joined in.
A lot of times discussion is diffuse because the hacking tends to be related to a specific game and a lot of talk is on those forums like this one but the tools used work on a lot of games so those devs are elsewhere.
BassyBoy
In one of my servers we have a dedicated thread for it but that's just me for the moment. I am a fan of making a discord to discuss this. I'm a n00b myself but so stubborn and want to learn it xD
Anyway lemme know if we wanna sweet set up a discord 🙂
Footygamer
This seems to relate to what they said here about building a bridge from Unity to their old code base: https://www.youtube.com/watch?v=im49swPfWIo
@Brululul there is a Discord link here: https://discord.gg/DHQtJAGUk9
heygraa
Can anyone unlock more than 60 fps in the game's code so it runs smoothly at higher refresh rates? I'd be very grateful!
Brululul
fyi, I managed to patch https://github.com/yukieiji/UnityExplorer by commenting the line that was causing crashes in the interop dll (temp fix)
Extract and replace inside BepInEx folder