From 3bcaea187475326d11e0507212550dde7ed684d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Tue, 8 Sep 2026 22:09:23 +0200 Subject: [PATCH] strip any extension from imported dll names WINSPOOL.DRV imports produced a module path with a dot in it. Co-Authored-By: Claude Fable 5.1 --- tc/src/exe.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tc/src/exe.rs b/tc/src/exe.rs index b90858c7..0fa0e44f 100644 --- a/tc/src/exe.rs +++ b/tc/src/exe.rs @@ -106,7 +106,11 @@ fn read_imports(pe_file: &exe::PE, mem: &Memory) -> Vec { let name = std::str::from_utf8(imp.image_name(image)) .unwrap() .to_lowercase(); - let name = name.trim_end_matches(".dll"); + // The module name doubles as a Rust module path, so drop the extension + // (.dll, or .drv for winspool). + let name = name + .rsplit_once('.') + .map_or(name.as_str(), |(stem, _)| stem); for (addr, entry) in imp.iat_iter(image) { let func = match entry.as_import_symbol(image) { exe::ImportSymbol::Name(name) => std::str::from_utf8(name).unwrap().to_string(),