Add fs hook for F drive in iidxhook9 #303

Merged
willxinc merged 1 commits from fs-hook-fix into master 2024-05-12 03:17:40 +03:00
willxinc commented 2024-05-12 02:53:48 +03:00 (Migrated from github.com)

This is checked by / used by the game for enabling video recording

This is checked by / used by the game for enabling video recording
icex2 (Migrated from github.com) reviewed 2024-05-12 02:57:07 +03:00
@@ -0,0 +16,4 @@
static void *my_avs_fs_mount(const char *dest, const char *src, const char *fs_type, const char *options);
static const struct hook_symbol avs_fs_hook_syms[] = {
{.name = "XCgsqzn000004b", // avs_fs_mount
icex2 (Migrated from github.com) commented 2024-05-12 02:57:06 +03:00

suggestion: I guess it's fine to hook it like that, but that might introduce re-usability issues with different AVS versions. I suggest to at least ifdef guard it and check that the AVS_VERSION define is within the right version range. Probably just throw an error for now if it isn't, so the next dev has visibility on that matter at least and needs to double check.

suggestion: I guess it's fine to hook it like that, but that might introduce re-usability issues with different AVS versions. I suggest to at least ifdef guard it and check that the AVS_VERSION define is within the right version range. Probably just throw an error for now if it isn't, so the next dev has visibility on that matter at least and needs to double check.
icex2 (Migrated from github.com) reviewed 2024-05-12 02:57:49 +03:00
@@ -0,0 +25,4 @@
static void *my_avs_fs_mount(const char *dest, const char *src, const char *fs_type, const char *options)
{
// quick check for "F:\"
if (src[0] == 'F' && src[1] == ':' && src[2] == '\0') {
icex2 (Migrated from github.com) commented 2024-05-12 02:57:49 +03:00

question: Is it always capital 'F'? Seen some odd stuff in the past where they also used the lower-case drive letters because reasons.

question: Is it always capital 'F'? Seen some odd stuff in the past where they also used the lower-case drive letters because reasons.
icex2 (Migrated from github.com) reviewed 2024-05-12 02:59:26 +03:00
@@ -0,0 +30,4 @@
log_misc("Redirecting %s to %s", src, dev_folder_drive);
CreateDirectoryA("dev/vfs/", NULL);
CreateDirectoryA("dev/vfs/drive_f/", NULL);
icex2 (Migrated from github.com) commented 2024-05-12 02:59:26 +03:00

suggestion: Not happy with the solution as it forces you to a hardcoded path. Maybe someone still wants these recordings on a separate disk or usb thumb drive? How about making this path configurable? We also got d and e folders configurable, iirc.

suggestion: Not happy with the solution as it forces you to a hardcoded path. Maybe someone still wants these recordings on a separate disk or usb thumb drive? How about making this path configurable? We also got d and e folders configurable, iirc.
icex2 (Migrated from github.com) reviewed 2024-05-12 03:00:21 +03:00
icex2 (Migrated from github.com) left a comment

See my comments

See my comments
willxinc (Migrated from github.com) reviewed 2024-05-12 03:07:21 +03:00
@@ -0,0 +16,4 @@
static void *my_avs_fs_mount(const char *dest, const char *src, const char *fs_type, const char *options);
static const struct hook_symbol avs_fs_hook_syms[] = {
{.name = "XCgsqzn000004b", // avs_fs_mount
willxinc (Migrated from github.com) commented 2024-05-12 03:07:21 +03:00

The hook is scoped to iidxhook9, so the symbol will always be that.

The hook is scoped to iidxhook9, so the symbol will always be that.
willxinc (Migrated from github.com) reviewed 2024-05-12 03:07:26 +03:00
@@ -0,0 +25,4 @@
static void *my_avs_fs_mount(const char *dest, const char *src, const char *fs_type, const char *options)
{
// quick check for "F:\"
if (src[0] == 'F' && src[1] == ':' && src[2] == '\0') {
willxinc (Migrated from github.com) commented 2024-05-12 03:07:26 +03:00

Yes

Yes
willxinc (Migrated from github.com) reviewed 2024-05-12 03:09:51 +03:00
@@ -0,0 +30,4 @@
log_misc("Redirecting %s to %s", src, dev_folder_drive);
CreateDirectoryA("dev/vfs/", NULL);
CreateDirectoryA("dev/vfs/drive_f/", NULL);
willxinc (Migrated from github.com) commented 2024-05-12 03:09:51 +03:00

Sounds reasonable, however this is not a regular path, but an AVS fs path instead, so I think exposing it might cause confusion, whereas most people should have a dev folder setup.

Sounds reasonable, however this is not a regular path, but an AVS fs path instead, so I think exposing it might cause confusion, whereas most people should have a dev folder setup.
icex2 (Migrated from github.com) reviewed 2024-05-12 03:13:48 +03:00
@@ -0,0 +16,4 @@
static void *my_avs_fs_mount(const char *dest, const char *src, const char *fs_type, const char *options);
static const struct hook_symbol avs_fs_hook_syms[] = {
{.name = "XCgsqzn000004b", // avs_fs_mount
icex2 (Migrated from github.com) commented 2024-05-12 03:13:47 +03:00

Right, thanks for highlighting. Kinda missed that detail.

Right, thanks for highlighting. Kinda missed that detail.
icex2 (Migrated from github.com) approved these changes 2024-05-12 03:16:36 +03:00
Sign in to join this conversation.