From ccfa43b8517acb23ab8c5f7657b831f77e408514 Mon Sep 17 00:00:00 2001 From: Giovanni Bajo Date: Sun, 24 Nov 2024 18:25:55 +0100 Subject: [PATCH] dumpdfs: fix extract command after dragonfs changes --- tools/dumpdfs/dumpdfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/dumpdfs/dumpdfs.c b/tools/dumpdfs/dumpdfs.c index fd7407ba6..c828b15b7 100644 --- a/tools/dumpdfs/dumpdfs.c +++ b/tools/dumpdfs/dumpdfs.c @@ -835,13 +835,13 @@ int main( int argc, char *argv[] ) int offset = 0; if (!strstr(argv[2], ".dfs")) { - void *fs = memmem(filesystem, lSize, &root_dirent, sizeof(root_dirent)); + void *fs = memmem(filesystem, lSize, ((uint8_t *)&root_dirent)+4, sizeof(root_dirent)-8); //Exclude ROOT_NEXT_ENTRY and root file_pointer if (!fs) { fprintf(stderr, "cannot find DragonFS in ROM\n"); return -1; } - offset = fs - filesystem; + offset = (fs - filesystem) - 4; } if (dfs_init_pc( filesystem+offset, 1 ) != DFS_ESUCCESS)