fix: windows, dll, pre-loading attack (#10608)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2025-01-26 19:39:38 +08:00 committed by GitHub
parent fc2e27bcf0
commit f08cb0412d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 138 additions and 17 deletions

View file

@ -133,7 +133,7 @@ impl MagInterface {
s.lib_handle = LoadLibraryExA(
lib_file_name_c.as_ptr() as _,
NULL,
LOAD_WITH_ALTERED_SEARCH_PATH,
LOAD_LIBRARY_SEARCH_SYSTEM32,
);
if s.lib_handle.is_null() {
return Err(Error::new(