Game Vendor: Steam
Game Version: 1.0
Game Process: avengers.exe
Game File Version: 1.3.13.18
Hello folks. Yet another new game with a different engine. This time around: Foundation Engine.
I'll be posting my discoveries in this topic, as I progress. Should help those of you who actively work on the game, while for others it may prove a decent read.. or an annoying mouse scroll of walls of text Whichever your reaction, both I will enjoy
What I first like to do is find a means to get to the version of the game. That helps me use the formatted way in which developers store this internally, somewhere in the .exe, or just computed in some structure that gets initialized at game start. And I got this:
Code: Select all
00000001412C4316 | E8 95ABDBFF | CALL avengers.14107EEB0 | <-- this gets a base pointer
00000001412C431B | 48:8B13 | MOV RDX,QWORD PTR DS:[RBX] |
00000001412C431E | 48:8BCB | MOV RCX,RBX |
00000001412C4321 | 48:8BF8 | MOV RDI,RAX |
00000001412C4324 | FF92 C0000000 | CALL QWORD PTR DS:[RDX+C0] | <-- GetVersion
Code: Select all
000000014107EEB0 | 48:8B05 B978FF01 | MOV RAX,QWORD PTR DS:[143076770]
000000014107EEB7 | 48:8B00 | MOV RAX,QWORD PTR DS:[RAX]
000000014107EEBA | C3 | RET
Code: Select all
000000014107EEB0 | 48:8B05 B978FF01 | MOV RAX,QWORD PTR DS:[143076770] | 000000015E9BBA60
000000014107EEB7 | 48:8B00 | MOV RAX,QWORD PTR DS:[RAX] | 000000015E9BBB30
000000014107EEBA | C3 | RET |
000000015E9BBA60 000000015E9BBB30 <-- (MOV RAX,QWORD PTR DS:[143076770])
000000015E9BBA68 000000015E9B84D0
000000015E9BBA70 000000015E9BE0C0
000000015E9BBA78 000000015E9BC6E0
000000015E9BBA80 0000000000000000
000000015E9BBA88 000000015E9C4720
000000015E9BBA90 000000015E9BC710
000000015E9BBA98 000000015E9BD6F0
000000015E9BBAA0 000000015E9BDC00
000000015E9BBAA8 000000015E9BD710
000000015E9BBAB0 000000015E9BD810
000000015E9BBAB8 000000015E9BD960
000000015E9BBAC0 000000015E9BD930
000000015E9BBAC8 000000015E9BDA30
000000015E9BBAD0 000000015E9BDE90
000000015E9BBAD8 000000015E9BDFE0
000000015E9BBAE0 000000015E9BE000
000000015E9BBAE8 000000015E9BE0F0
000000015E9BBAF0 000000015E9BCDB0
000000015E9BBAF8 000000015E9BD650
000000015E9BBB00 000000015E9BE1E0
000000015E9BBB08 000000015E9BE6F0
000000015E9BBB10 000000015E9BEB10
000000015E9BBB18 000000015E9BE2B0
000000015E9BBB20 000000015E9BADC0
000000015E9BBB28 0000000000000AD3
000000015E9BBB30 00000001428E9858 <-- pBase (MOV RAX,QWORD PTR DS:[RAX])
000000015E9BBB38 0000000001000100
000000015E9BBB40 000000015E9BFA90 "Marvel's Avengers" == (LEA RAX,[RAX+10])
Then the CALL @ 1412C4324 (CALL QWORD PTR DS:[RDX+C0]) does this:
Code: Select all
0000000141081B00 | 48:8D81 38020000 | LEA RAX,QWORD PTR DS:[RCX+238] | [rcx+238]:"v1.3 build 13.18"
0000000141081B07 | 48:8378 18 10 | CMP QWORD PTR DS:[RAX+18],10 | <-- engine does a check for a flag here; if not below 0x10, then
0000000141081B0C | 72 03 | JB avengers.141081B11 |
0000000141081B0E | 48:8B00 | MOV RAX,QWORD PTR DS:[RAX] | reads the Version p->str here
0000000141081B11 | C3 | RET |
So you'll see me use this method to get the game's version compared to the version for which my table is created. If the 2 versions match, then the table will just enable main script. If they don't match, you'll see a warning and some comments. Just like I did in the table for Serious Sam 4:
Now you know the reason and logic behind the version check in my tables
As far as the names of the structures, who they are and what they do.. If you can't use RTTI ([Link]) to get the information you need, I usually look at the member-functions (or virtual table; short, vtable) for "bread-crumbs" And in this case, looking at that "pBase" pointer's member-functions I found several things.
Most standard Engine types will have the first member-function a destructor. The rest of them will do other things. Among them I usually look for either a "GetClass" (name) function or leads to a name in any function. The list I got for that 'pBase' is shown below:
Code: Select all
00000001428E9858:
$ ==> 0000000141081030
$+8 0000000141E744C0
$+10 0000000141084390
$+18 00000001410841F0
$+20 0000000141082380
$+28 0000000141082E00
$+30 0000000141085460
$+38 0000000141081710
$+40 0000000141083630
$+48 0000000141085B70
$+50 00000001410842E0
$+58 00000001410836D0
$+60 0000000141081A10
$+68 00000001410819F0
$+70 00000001410844E0
$+78 0000000141081490
$+80 0000000141081810
$+88 0000000141085D30
$+90 0000000141085D30
$+98 0000000141081EF0
$+A0 0000000141081C40
$+A8 0000000141081C30
..
Code: Select all
0000000141084390 | 48:895C24 08 | MOV QWORD PTR SS:[RSP+8],RBX | prologue
..
000000014108441B | 4C:8D05 DE5D8601 | LEA R8,QWORD PTR DS:[1428EA200] | 00000001428EA200:"PreInit"
0000000141084422 | 48:8BC8 | MOV RCX,RAX |
0000000141084425 | 48:8D15 784C8601 | LEA RDX,QWORD PTR DS:[1428E90A4] | 00000001428E90A4:"NxApp"
Code: Select all
0000000141082380 | 48:8BC4 | MOV RAX,RSP | prologue
..
000000014108291A | 4C:8D05 D7798601 | LEA R8,QWORD PTR DS:[1428EA2F8] | 00000001428EA2F8:"Old Driver detected. Driver version: %s"
0000000141082921 | 48:8D15 7C678601 | LEA RDX,QWORD PTR DS:[1428E90A4] | 00000001428E90A4:"NxApp"
Code: Select all
0000000141082E00 | 48:895C24 10 | MOV QWORD PTR SS:[RSP+10],RBX | prologue
..
0000000141082E1D | 4C:8D05 8C758601 | LEA R8,QWORD PTR DS:[1428EA3B0] | 00000001428EA3B0:"Creating window..."
0000000141082E24 | 48:8BC8 | MOV RCX,RAX |
0000000141082E27 | 48:8D15 76628601 | LEA RDX,QWORD PTR DS:[1428E90A4] | 00000001428E90A4:"NxApp"
Code: Select all
00000001410856B0 | 40:53 | PUSH RBX | prologue
..
00000001410857B2 | 4C:8D05 D74C8601 | LEA R8,QWORD PTR DS:[1428EA490] | 00000001428EA490:"Finished enforcing display settings"
00000001410857B9 | 48:8BC8 | MOV RCX,RAX |
00000001410857BC | 48:8D15 F54C8601 | LEA RDX,QWORD PTR DS:[1428EA4B8] | 00000001428EA4B8:"NxApp (Render Thread)"
BR,
Sun