Loader: a title DLL that fails to prepare is named in the error

Reading and loading a title DLL report its path when they fail;
preparing it, in between, did not. A DLL the PE parser refuses ended
the run with just "malformed image: ..." (or the like), without saying
which of the title's DLLs it was.

The prepare step now adds "preparing <path>" like its neighbours.
This commit is contained in:
Duff committed 2026-11-24 02:54:49 +01:00
1 parent 35e8407c9c
commit 39245bc085
2 files changed
+18 -2

No files matched your search

+2 -2
View File
@@ -152,8 +152,8 @@ fn map_dll(
return Ok(());
}
let original = std::fs::read(&path).with_context(|| format!("reading {}", path.display()))?;
let image = load(&prepare(&original)?, dirs.1)
.with_context(|| format!("loading {}", path.display()))?;
let prepared = prepare(&original).with_context(|| format!("preparing {}", path.display()))?;
let image = load(&prepared, dirs.1).with_context(|| format!("loading {}", path.display()))?;
map_imports(&image.info, dirs, wanted, seen, loaded)?;
loaded.push((name, image));
Ok(())