fix(il2cpp): refuse a seed path under a non-directory as caller input (#6271)

Co-authored-by: Abelo9996 <Abelo9996@users.noreply.github.com>
This commit is contained in:
Abel Yagubyan
2026-10-22 05:48:27 -04:00
committed by GitHub
parent 690a63abd6
commit 2d91e2d578
2 changed files with 45 additions and 0 deletions
+7
View File
@@ -69,6 +69,13 @@ export class Il2cppGhidraSeedWriter implements Il2cppSeedWriterPort {
} catch (cause) {
if (cause instanceof Error && "code" in cause && cause.code === "ENOENT")
return ok(undefined);
if (cause instanceof Error && "code" in cause && cause.code === "ENOTDIR")
return err(
invalid(
"ghidra_seeds",
`--ghidra-seeds ${output.path} has a parent path component that is not a directory; choose an output path inside an existing directory.`,
),
);
return err(
new EvidenceFileError("write", "io", { path: output.path, cause }),
);