Unable to extract cab file - is not a directory or file, skipping #203

Closed
opened 2026-01-29 21:07:05 +00:00 by claunia · 9 comments
Owner

Originally created by @Feathered-Serpent on GitHub (Aug 19, 2025).

Heya,

noticed this on a German game "Simon the Sorcerer: Wer will schon Kontakt?"

>ProtectionScan.exe -d content1.cab
0,00%:  -
0,00%: content1.cab - Checking file
0,00%:  -
C:\Users\<username>\AppData\Local\Temp\18a49eec-9bff-44f0-8d4a-ba720bc8321f is not a directory or file, skipping...
Time elapsed: 00:00:00.0004348
Time elapsed: 00:00:00.7882069
100,00%: content1.cab -

(Filesize: 1.976.850.298 Bytes)

>ProtectionScan.exe -d content2.cab
0,00%:  -
0,00%: content2.cab - Checking file
0,00%:  -
C:\Users\<username>\AppData\Local\Temp\ea332bd4-744c-4298-825f-1fa698262a45 is not a directory or file, skipping...
Time elapsed: 00:00:00.0009055
Time elapsed: 00:00:00.2552529
100,00%: content2.cab -

(Filesize: 419.364.014 Bytes)

With 7zip I can easily extract the cab files and then run the scan against the extracted files, resulting in a find:
content2\bin_engine.dll: ProtectDISC 9.5-9.11 [Build 0x16008 / 90120]

Protection ID also detects it:

Image
Originally created by @Feathered-Serpent on GitHub (Aug 19, 2025). Heya, noticed this on a German game "Simon the Sorcerer: Wer will schon Kontakt?" ``` >ProtectionScan.exe -d content1.cab 0,00%: - 0,00%: content1.cab - Checking file 0,00%: - C:\Users\<username>\AppData\Local\Temp\18a49eec-9bff-44f0-8d4a-ba720bc8321f is not a directory or file, skipping... Time elapsed: 00:00:00.0004348 Time elapsed: 00:00:00.7882069 100,00%: content1.cab - ``` (Filesize: 1.976.850.298 Bytes) ``` >ProtectionScan.exe -d content2.cab 0,00%: - 0,00%: content2.cab - Checking file 0,00%: - C:\Users\<username>\AppData\Local\Temp\ea332bd4-744c-4298-825f-1fa698262a45 is not a directory or file, skipping... Time elapsed: 00:00:00.0009055 Time elapsed: 00:00:00.2552529 100,00%: content2.cab - ``` (Filesize: 419.364.014 Bytes) With 7zip I can easily extract the cab files and then run the scan against the extracted files, resulting in a find: `content2\bin_engine.dll: ProtectDISC 9.5-9.11 [Build 0x16008 / 90120]` Protection ID also detects it: <img width="647" height="307" alt="Image" src="https://github.com/user-attachments/assets/745159e1-0723-4be1-a1e2-d29245a07f7b" />
Author
Owner

@mnadareski commented on GitHub (Aug 19, 2025):

The "not a directory or file" just means that it didn't start extracting the cabinet so it tried to scan a temp directory that didn't exist.

On the other side, there are some fixes that are going into a base library of mine that might make MS-CAB handling safer, assuming that it's an MS-CAB and not an IS-CAB. If the MS-CAB uses LZX compression, then extracting for scan is only supported in the 32-bit version because of library dependencies. Which is very likely what you're running into.

@mnadareski commented on GitHub (Aug 19, 2025): The "not a directory or file" just means that it didn't start extracting the cabinet so it tried to scan a temp directory that didn't exist. On the other side, there are some fixes that are going into a base library of mine that might make MS-CAB handling safer, assuming that it's an MS-CAB and not an IS-CAB. If the MS-CAB uses LZX compression, then extracting for scan is only supported in the 32-bit version because of library dependencies. Which is very likely what you're running into.
Author
Owner

@Feathered-Serpent commented on GitHub (Aug 19, 2025):

using the win_x86-executables I don't get any message on content1.cab, same message on content2.cab:

Image

how can I check what kind of cab files those are?

@Feathered-Serpent commented on GitHub (Aug 19, 2025): using the win_x86-executables I don't get any message on content1.cab, same message on content2.cab: <img width="1335" height="403" alt="Image" src="https://github.com/user-attachments/assets/85a665ff-7627-4a49-99c5-099aa7e4504c" /> how can I check what kind of cab files those are?
Author
Owner

@mnadareski commented on GitHub (Aug 19, 2025):

You have 2 easy options:

  • Open the CAB with a hex editor and check the first couple of bytes. If it starts with MSCF then it's an MS-CAB. If it starts with ISc(, then it's an InstallShield CAB
  • Use the InfoTool program from my Serialization library and let it parse the file. The textfile that's output should have the file type and a lot more info
@mnadareski commented on GitHub (Aug 19, 2025): You have 2 easy options: - Open the CAB with a hex editor and check the first couple of bytes. If it starts with `MSCF` then it's an MS-CAB. If it starts with `ISc(`, then it's an InstallShield CAB - Use the InfoTool program from my [Serialization library](https://github.com/SabreTools/SabreTools.Serialization) and let it parse the file. The textfile that's output should have the file type and a lot more info
Author
Owner

@Feathered-Serpent commented on GitHub (Aug 19, 2025):

Seems like both are MS-CAB files:

Image
@Feathered-Serpent commented on GitHub (Aug 19, 2025): Seems like both are MS-CAB files: <img width="688" height="447" alt="Image" src="https://github.com/user-attachments/assets/57227baf-baad-49f5-8f4e-cea83f214869" />
Author
Owner

@mnadareski commented on GitHub (Aug 19, 2025):

Okay, then it might be one of the cabinet types that will benefit from when some of the dependent libraries are updated. Some of the incompatibilities were addressed in the latest rolling release. You can try that out if you want.

@mnadareski commented on GitHub (Aug 19, 2025): Okay, then it might be one of the cabinet types that will benefit from when some of the dependent libraries are updated. Some of the incompatibilities were addressed in the [latest rolling release](https://github.com/SabreTools/BinaryObjectScanner/releases/tag/rolling). You can try that out if you want.
Author
Owner

@Feathered-Serpent commented on GitHub (Aug 19, 2025):

x64 is working fine with the rolling release.

x86 got me no information about content1.cab and OoM on content2.cab:

>ProtectionScan.exe -d content1.cab
0,00%:  -
0,00%: content1.cab - Checking file
Time elapsed: 00:00:02.6973391
100,00%: content1.cab -

>ProtectionScan.exe -d content2.cab
0,00%: content2.cab - Checking file
0,00%:  -
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.IO.MemoryStream.set_Capacity(Int32 value)
   at System.IO.MemoryStream.EnsureCapacity(Int32 value)
   at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count)
   at BinaryObjectScanner.FileType.MicrosoftCAB.DecompressBlocks(MicrosoftCabinet cabArchive, String filename, CFFOLDER folder, Int32 folderIndex, Boolean includeDebug)
   at BinaryObjectScanner.FileType.MicrosoftCAB.ExtractFolder(MicrosoftCabinet cabArchive, String filename, String outDir, CFFOLDER folder, Int32 folderIndex, Boolean includeDebug)
   at BinaryObjectScanner.FileType.MicrosoftCAB.ExtractCabinet(MicrosoftCabinet cabArchive, String filename, String outDir, Boolean forwardOnly, Boolean includeDebug)
0,00%:  -
C:\Users\<username>\AppData\Local\Temp\e6a54b91-409f-416e-85d2-11441d2814f1 is not a directory or file, skipping...
Time elapsed: 00:00:00.0008353
Time elapsed: 00:00:00.6065847
100,00%: content2.cab -
@Feathered-Serpent commented on GitHub (Aug 19, 2025): x64 is working fine with the rolling release. x86 got me no information about content1.cab and OoM on content2.cab: ``` >ProtectionScan.exe -d content1.cab 0,00%: - 0,00%: content1.cab - Checking file Time elapsed: 00:00:02.6973391 100,00%: content1.cab - >ProtectionScan.exe -d content2.cab 0,00%: content2.cab - Checking file 0,00%: - System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.IO.MemoryStream.set_Capacity(Int32 value) at System.IO.MemoryStream.EnsureCapacity(Int32 value) at System.IO.MemoryStream.Write(Byte[] buffer, Int32 offset, Int32 count) at BinaryObjectScanner.FileType.MicrosoftCAB.DecompressBlocks(MicrosoftCabinet cabArchive, String filename, CFFOLDER folder, Int32 folderIndex, Boolean includeDebug) at BinaryObjectScanner.FileType.MicrosoftCAB.ExtractFolder(MicrosoftCabinet cabArchive, String filename, String outDir, CFFOLDER folder, Int32 folderIndex, Boolean includeDebug) at BinaryObjectScanner.FileType.MicrosoftCAB.ExtractCabinet(MicrosoftCabinet cabArchive, String filename, String outDir, Boolean forwardOnly, Boolean includeDebug) 0,00%: - C:\Users\<username>\AppData\Local\Temp\e6a54b91-409f-416e-85d2-11441d2814f1 is not a directory or file, skipping... Time elapsed: 00:00:00.0008353 Time elapsed: 00:00:00.6065847 100,00%: content2.cab - ```
Author
Owner

@mnadareski commented on GitHub (Aug 19, 2025):

Good to know. I'll try to fix the out of memory error you're seeing there. Glad the rolling release mostly fixed things, though.

@mnadareski commented on GitHub (Aug 19, 2025): Good to know. I'll try to fix the out of memory error you're seeing there. Glad the rolling release mostly fixed things, though.
Author
Owner

@mnadareski commented on GitHub (Sep 7, 2025):

A bunch of the internals have been finally updated. This shouldn't OOM anymore.

@mnadareski commented on GitHub (Sep 7, 2025): A bunch of the internals have been finally updated. This shouldn't OOM anymore.
Author
Owner

@mnadareski commented on GitHub (Sep 20, 2025):

Internals have further been refined, this definitely shouldn't happen anymore.

@mnadareski commented on GitHub (Sep 20, 2025): Internals have further been refined, this definitely shouldn't happen anymore.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SabreTools/BinaryObjectScanner#203