Merge 18490 via bugfix_symcheck_pe_case

This commit is contained in:
Luke Dashjr 2023-11-15 23:49:11 +00:00
commit cb2d1032bd

View File

@ -133,7 +133,7 @@ MACHO_ALLOWED_LIBRARIES = {
'QuartzCore', # animation
}
PE_ALLOWED_LIBRARIES = {
PE_ALLOWED_LIBRARIES = {libname.lower() for libname in (
'ADVAPI32.dll', # security & registry
'IPHLPAPI.DLL', # IP helper API
'KERNEL32.dll', # win32 base APIs
@ -154,7 +154,7 @@ PE_ALLOWED_LIBRARIES = {
'VERSION.dll', # version checking
'WINMM.dll', # WinMM audio API
'WTSAPI32.dll',
}
)}
def check_version(max_versions, version, arch) -> bool:
(lib, _, ver) = version.rpartition('_')
@ -225,7 +225,7 @@ def check_MACHO_sdk(binary) -> bool:
def check_PE_libraries(binary) -> bool:
ok: bool = True
for dylib in binary.libraries:
if dylib not in PE_ALLOWED_LIBRARIES:
if dylib.lower() not in PE_ALLOWED_LIBRARIES:
print(f'{dylib} is not in ALLOWED_LIBRARIES!')
ok = False
return ok