Wulf wrote: ↑Sun Jan 30, 2022 4:22 pm
...
Yeah, we knew. That doesn't skip the "Sony Interactive presents" and "Santa Monica" ones
P.S.: In games where this doesn't work - game still needs the .bik there to play it - you can replace the file with a 0-frames one. Just rename your original to .BAK and extract the attached one below to your folder:
Again, can be used with any games having their intros as .bik files, whereas each of those files have to be renamed to .BAK and this one here copied several times and named like the originals.
Wulf wrote: ↑Sun Jan 30, 2022 4:46 pm
...
Been meaning to ask..
why do you use pushfq/popfq? I mean.. I know what they're for. Why do you use them where they make no sense? Not only that, but why do you use them in an INDEPENDENT thread? See this post of yours:
viewtopic.php?p=232840#p232840. It just doesn't make sense. If you are in a standalone thread, you don't need preserving of registers or flags T_T
Code: Select all
[ENABLE]
alloc(code, 0x1000)
CreateThread(code)
code:
pushfq // no need for this
mov rcx, GoW.exe+76BE70
mov rcx, [rcx]
call GoW.exe+76BE70
popfq // no need for this
ret
[DISABLE]
dealloc(code)
What you do need is proper stack intialization, which, on x64, the default is this:
So you code above becomes:
Code: Select all
[ENABLE]
alloc(code, 0x1000)
CreateThread(code)
code:
sub rsp,28
mov rcx, GoW.exe+76BE70
mov rcx, [rcx]
call GoW.exe+76BE70
add rsp,28
ret
[DISABLE]
dealloc(code)
Why? Because that "call GoW.exe+76BE70" may require stack room, which you've never accounted for. If there was no CALL in your code, you wouldn't need sub rsp,28/add rsp,28 + ret. But then again, that's good practice to prefix/suffix your functions with those 3 lines. That's what a C++ compiler would do anyway.
Wulf wrote: ↑Sun Jan 30, 2022 9:01 pm
...
Yeah, it's useful. Especially since the Lua files in first post refer to the specific VMs they're used in. Take a look at this:
[Link]. The top folder in each hierarchy is the Lua VM name. The subsequent Lua files within each root folder are what's run inside that VM. If you can find a way to get all of those VMs, then they can be stored in a structure and used later on.
I've started looking at this:
[Link]. Want to adapt it to God of War. With what I just said above, the code could do a GetVM() every time you want to run a Lua script in the context of a specific VM. For example, in "Mafia-Definitive-Edition-ScriptHook/files/scripts/dev.lua", you could do..
Code: Select all
printPlayerPosition = [[
vec = game.game:GetActivePlayer():GetPos();
posi = string.format('vec = Math:newVector(%f,%f,%f)', vec.x, vec.y, vec.z);
printToLog("dev.log", posi);
dir = game.game:GetActivePlayer():GetDir();
diri = string.format('dir = Math:newVector(%f,%f,%f)', dir.x, dir.y, dir.z);
printToLog("dev.log", diri);
]]
..after you've ran a GetVM() to specify which VM's lua_state you want to use for the execution of the above. Which VM you want to run this piece of code in. My table does everything in the Lua state of goPlayer; I don't use other VMs, so that's maybe why some shit doesn't work.
What the ScriptHook does extra than what there already is in my table is to offer the possibility to run .lua files (instead of copy-pasting stuff to an UDF), add bind keys and obtain
print logs (to a physical file, on disk: dev.log). That way you can track what the fuck fails and so on.
Cheers,
Sun