Browse Source

The image's name is kept for VICTORY_WRITE_SITES (the program did not build)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
local 1 day ago
parent
commit
158b9aa329
1 changed files with 3 additions and 2 deletions
  1. 3 2
      apps/victory/src/run.rs

+ 3 - 2
apps/victory/src/run.rs

@@ -68,6 +68,7 @@ pub fn run(
     // and their patched copy are not read again, and were held for the
     // whole run (two blocks of 114.7 MB each for the title, in
     // physical memory: run 65's memory map).
+    let image_name = prepared.file_name();
     drop(prepared);
     drop(original);
     victory_hle::runtime::set_main_image(image.base());
@@ -163,9 +164,9 @@ pub fn run(
     let exe_name = exe.file_name().unwrap_or_default().to_string_lossy();
     show(&exe_name, image.bind_imports(&with_dlls, policy)?);
     if execute {
-        let (name, size) = (prepared.file_name(), image.info().size_of_image as usize);
+        let size = image.info().size_of_image as usize;
         // SAFETY: the image stays mapped, and nothing of it has run yet.
-        unsafe { victory_loader::write_sites::apply_asked(&name, image.base(), size) };
+        unsafe { victory_loader::write_sites::apply_asked(&image_name, image.base(), size) };
     }
     if !execute {
         println!("not executing (pass --execute to start the title)");