From 0455bed516d32ecf4d23d35c49083e87f8233b94 Mon Sep 17 00:00:00 2001 From: Ruben Vereecken Date: Thu, 27 Feb 2025 17:03:31 +0000 Subject: [PATCH 1/2] Added support for relative paths for dumpTree --- src/dump.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dump.ts b/src/dump.ts index 826b4693..2e302662 100644 --- a/src/dump.ts +++ b/src/dump.ts @@ -69,7 +69,7 @@ namespace Il2Cpp { * classes within `System.Core` and `System.Runtime.CompilerServices.Unsafe` * are dumped into `System/Core.cs` and * `System/Runtime/CompilerServices/Unsafe.cs`, respectively. - * + * * ```ts * Il2Cpp.perform(() => { * Il2Cpp.dumpTree(); @@ -77,6 +77,7 @@ namespace Il2Cpp { * ``` */ export function dumpTree(path?: string, ignoreAlreadyExistingDirectory: boolean = false): void { + if (!path?.startsWith("/")) path = `${Il2Cpp.application.dataPath!}/${path}`; path = path ?? `${Il2Cpp.application.dataPath!}/${Il2Cpp.application.identifier ?? "unknown"}_${Il2Cpp.application.version ?? "unknown"}`; if (!ignoreAlreadyExistingDirectory && directoryExists(path)) { @@ -97,7 +98,7 @@ namespace Il2Cpp { } file.flush(); - file.close(); + file.close(); } ok(`dump saved to ${path}`); From 3945f832006951e3df6fcef346411b1d5bffda97 Mon Sep 17 00:00:00 2001 From: Ruben Vereecken Date: Sun, 2 Mar 2025 18:06:35 +0000 Subject: [PATCH 2/2] Update dump.ts --- src/dump.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dump.ts b/src/dump.ts index 2e302662..2f9ef021 100644 --- a/src/dump.ts +++ b/src/dump.ts @@ -77,7 +77,7 @@ namespace Il2Cpp { * ``` */ export function dumpTree(path?: string, ignoreAlreadyExistingDirectory: boolean = false): void { - if (!path?.startsWith("/")) path = `${Il2Cpp.application.dataPath!}/${path}`; + if (path && !path?.startsWith("/")) path = `${Il2Cpp.application.dataPath!}/${path}`; path = path ?? `${Il2Cpp.application.dataPath!}/${Il2Cpp.application.identifier ?? "unknown"}_${Il2Cpp.application.version ?? "unknown"}`; if (!ignoreAlreadyExistingDirectory && directoryExists(path)) {