LongSoft / UEFITool

UEFI firmware image viewer and editor
BSD 2-Clause "Simplified" License
4.46k stars 630 forks source link

UEFIFind fails to open input file when path is long on Windows #406

Open platomav opened 1 month ago

platomav commented 1 month ago

Hello,

This ticket seems directly related to #363, but now the affected utility is UEFIFind and not UEFIExtract. Specifically, UEFIFind is not able to load a file when its path is "long" on Windows (MAX_PATH, UNC), failing with exit code 5 (U_FILE_OPEN).

C:\Users\plato\Desktop>UEFIFind.exe "C:\Users\plato\Desktop\test_test_test_test_test_test_test_test_test_test_test_test\pkg\MacBookProEFIUpdate_2.pkg_extracted\temp\Payload_gzip_cpio\Payload~_extracted\System\Library\CoreServices\Firmware Updates\MacBookProEFIUpdateTwo-2.8\MBP51_007E_06B_LOCKED.scap" body list 244942494F534924 || echo %errorlevel%
5

Test Path - Success

C:\Users\plato\Desktop\test_test\pkg\MacBookProEFIUpdate_2.pkg_extracted\temp\Payload_gzip_cpio\Payload~_extracted\System\Library\CoreServices\Firmware Updates\MacBookProEFIUpdateTwo-2.8\MBP51_007E_06B_LOCKED.scap

Test Path - Failure

C:\Users\plato\Desktop\test_test_test_test_test_test_test_test_test_test_test_test\pkg\MacBookProEFIUpdate_2.pkg_extracted\temp\Payload_gzip_cpio\Payload~_extracted\System\Library\CoreServices\Firmware Updates\MacBookProEFIUpdateTwo-2.8\MBP51_007E_06B_LOCKED.scap

test_long_path.zip