emoose / DQXIS-SDK

Wrapper DLL & SDK for Dragon Quest XI S
GNU General Public License v3.0
24 stars 3 forks source link

DLL injection fixes #11

Open emoose opened 3 years ago

emoose commented 3 years ago

The latest 0.6.7 release should now be injectable (eg. using the DLL injector included with UUU), DevConsole should now unlock fine with it, and it seems RenderFix/CustomActions/FirstPerson are all working too, not sure about the other things though.

~~Need to look into improving how INI stuff is handled too - atm it'll expect DQXIS-SDK.ini in same folder as game EXE but most MS store users probably can't write there.. the default settings it uses when INI doesn't exist are probably fine for the time being, but will need to find a proper solution for it soon. (maybe if DQXIS-SDK.ini isn't found in the game dir, it should fallback to the games Documents/.../Config folder - SDK already has code to retrieve the correct path for that, though I'm not sure how it works with MS store versions...)~~

If anyone knows any other recent x64 injector tools that could be included with DQXIS-SDK releases please let me know - the UUU injector seems nice but I know things are a bit iffy around redistributing that, so any other suggestions are welcomed.

emoose commented 3 years ago

E: changed it to use hardcoded paths to known DQXIS documents folders instead, much less hacky this way. Old method is detailed below:


a49622d now lets us read DQXIS-SDK.ini config from the games config folders, as explained in that commit the way this is handled is kinda ugly though (the games FPath::GeneratedConfigDir func needs some kind of setup by the game before we can use it, so that commit makes the SDK init wait until that func is ready first, if it wasn't found at the EXE path)

This means game can execute some code before our patches/hooks are in place though... not a big deal right now, but could cause issues in future if something needs patching before game uses it. (eg. I could see LoadUnpackedFiles having problems with this, but if you're using that you'll probably have INI next to the game EXE anyway, which puts the hooks/patches in place before game starts)

I'm not sure if this will work that well with injection though, DLL could always get injected after game has finished up using the FPaths function... gonna need to look into it some more before releasing. (E: hopefully this is fixed by 813c715, I'll look into what injectors are available tomorrow so one can be included in the release)

E: hmm, maybe I'll change things to make it check a bunch of hardcoded paths instead, it could probably just loop through %DOCUMENTS%\My Games\DRAGON QUEST XI S\ and %DOCUMENTS%\My Games\ドラゴンクエスト XI S\ folders until it finds a DQXIS-SDK.ini file, this way there's no need to bother with waiting for the game to init etc... not sure if the title might be localized in other non-EN/non-JP languages tho...