REVERSE ENGINEERING: The Classic Collection was released without compiler optimizations enabled
Posted: Thu Mar 14, 2024 11:12 am
Hey everyone. I'm new to the Battlefront 2 modding scene, but with the disaster that is Apsyr's release, I decided to do some static analysis on the binaries...And BOY did I find something pretty big (or at least I think I did). I'm a software engineer with some reverse engineering experience, but please note that I have no experience with the engine, so if I say something obvious or stupid, please excuse me.
Take a look at the following decompiler output from Ghidra. Notice anything?
![Image](https://i.imgur.com/7epqcus.png)
How about those zero multiplications and then additions? A compiler would normally completely wipe that out with optimizations enabled. This, however, is still in the build.
What are we looking at? Matrix multiplication. It looks like they're doing something with the identity matrix, so they may be generating some sort of projection or translation matrix.
The fact that I can tell what this is doing at a glance is huge. We don't have the debug symbols, but the decomp is more or less readable out of the gate.
This is true for BOTH GAMES in the classic collection. I think we could reverse engineer the battlefront engine with this if we wanted to.
Is anyone interested in looking into this with me? I've backed up the release day builds in case they realize their mistake and patch it.
Take a look at the following decompiler output from Ghidra. Notice anything?
![Image](https://i.imgur.com/7epqcus.png)
How about those zero multiplications and then additions? A compiler would normally completely wipe that out with optimizations enabled. This, however, is still in the build.
What are we looking at? Matrix multiplication. It looks like they're doing something with the identity matrix, so they may be generating some sort of projection or translation matrix.
The fact that I can tell what this is doing at a glance is huge. We don't have the debug symbols, but the decomp is more or less readable out of the gate.
This is true for BOTH GAMES in the classic collection. I think we could reverse engineer the battlefront engine with this if we wanted to.
Is anyone interested in looking into this with me? I've backed up the release day builds in case they realize their mistake and patch it.