Exception thrown in DXSETUP.EXE #175

Closed
opened 2026-01-29 21:06:50 +00:00 by claunia · 3 comments
Owner

Originally created by @fuzz6001 on GitHub (Jun 20, 2024).

Use rolling release. 7eb86b223f

DXSETUP.zip

e:\DXSETUP.EXE: System.AggregateException: One or more errors occurred. (Requested to read 4 bytes from content, 0 returned)
 ---> System.IO.EndOfStreamException: Requested to read 4 bytes from content, 0 returned
   at SabreTools.IO.Extensions.ByteArrayReaderExtensions.ReadToBuffer(Byte[] content, Int32& offset, Int32 length)
   at SabreTools.IO.Extensions.ByteArrayReaderExtensions.ReadUInt32(Byte[] content, Int32& offset)
   at SabreTools.Serialization.Wrappers.PortableExecutable.ParseDebugTable()
   at SabreTools.Serialization.Wrappers.PortableExecutable.get_DebugData()
   at SabreTools.Serialization.Wrappers.PortableExecutable.FindCodeViewDebugTableByPath(String path)
   at BinaryObjectScanner.Protection.Macrovision.SafeDiscCheckPortableExecutable(String file, PortableExecutable pex, Boolean includeDebug) in /home/runner/work/BinaryObjectScanner/BinaryObjectScanner/BinaryObjectScanner/Protection/Macrovision.SafeDisc.cs:line 111
   at BinaryObjectScanner.Protection.Macrovision.CheckPortableExecutable(String file, PortableExecutable pex, Boolean includeDebug) in /home/runner/work/BinaryObjectScanner/BinaryObjectScanner/BinaryObjectScanner/Protection/Macrovision.cs:line 149
   at BinaryObjectScanner.FileType.Executable.<>c__DisplayClass29_0.<RunPortableExecutableChecks>b__0(IPortableExecutableCheck checkClass) in /home/runner/work/BinaryObjectScanner/BinaryObjectScanner/BinaryObjectScanner/FileType/Executable.cs:line 499
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)
   at System.Threading.Tasks.TaskReplicator.Replica.Execute()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction`1 action, ParallelOptions options, Boolean stopOnFirstFailure)
   at System.Threading.Tasks.Parallel.ForWorker[TLocal,TInt](TInt fromInclusive, TInt toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Parallel.ForWorker[TLocal,TInt](TInt fromInclusive, TInt toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, Action`1 body)
   at BinaryObjectScanner.FileType.Executable.RunPortableExecutableChecks(String file, Stream stream, PortableExecutable pex, Boolean includeDebug) in /home/runner/work/BinaryObjectScanner/BinaryObjectScanner/BinaryObjectScanner/FileType/Executable.cs:line 495
   at BinaryObjectScanner.Scanner.ProcessExecutable(Executable executable, String fileName, Stream stream) in /home/runner/work/BinaryObjectScanner/BinaryObjectScanner/BinaryObjectScanner/Scanner.cs:line 501
   at BinaryObjectScanner.Scanner.GetInternalProtections(String fileName, Stream stream) in /home/runner/work/BinaryObjectScanner/BinaryObjectScanner/BinaryObjectScanner/Scanner.cs:line 350
Originally created by @fuzz6001 on GitHub (Jun 20, 2024). Use rolling release. 7eb86b223f578097ccf8307ad6e0136713040c19 [DXSETUP.zip](https://github.com/user-attachments/files/15912715/DXSETUP.zip) ``` e:\DXSETUP.EXE: System.AggregateException: One or more errors occurred. (Requested to read 4 bytes from content, 0 returned) ---> System.IO.EndOfStreamException: Requested to read 4 bytes from content, 0 returned at SabreTools.IO.Extensions.ByteArrayReaderExtensions.ReadToBuffer(Byte[] content, Int32& offset, Int32 length) at SabreTools.IO.Extensions.ByteArrayReaderExtensions.ReadUInt32(Byte[] content, Int32& offset) at SabreTools.Serialization.Wrappers.PortableExecutable.ParseDebugTable() at SabreTools.Serialization.Wrappers.PortableExecutable.get_DebugData() at SabreTools.Serialization.Wrappers.PortableExecutable.FindCodeViewDebugTableByPath(String path) at BinaryObjectScanner.Protection.Macrovision.SafeDiscCheckPortableExecutable(String file, PortableExecutable pex, Boolean includeDebug) in /home/runner/work/BinaryObjectScanner/BinaryObjectScanner/BinaryObjectScanner/Protection/Macrovision.SafeDisc.cs:line 111 at BinaryObjectScanner.Protection.Macrovision.CheckPortableExecutable(String file, PortableExecutable pex, Boolean includeDebug) in /home/runner/work/BinaryObjectScanner/BinaryObjectScanner/BinaryObjectScanner/Protection/Macrovision.cs:line 149 at BinaryObjectScanner.FileType.Executable.<>c__DisplayClass29_0.<RunPortableExecutableChecks>b__0(IPortableExecutableCheck checkClass) in /home/runner/work/BinaryObjectScanner/BinaryObjectScanner/BinaryObjectScanner/FileType/Executable.cs:line 499 at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`2.<ForWorker>b__1(RangeWorker& currentWorker, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) at System.Threading.Tasks.TaskReplicator.Replica.Execute() --- End of inner exception stack trace --- at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction`1 action, ParallelOptions options, Boolean stopOnFirstFailure) at System.Threading.Tasks.Parallel.ForWorker[TLocal,TInt](TInt fromInclusive, TInt toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally) --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.ForWorker[TLocal,TInt](TInt fromInclusive, TInt toExclusive, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally) at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally) at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, Action`1 body) at BinaryObjectScanner.FileType.Executable.RunPortableExecutableChecks(String file, Stream stream, PortableExecutable pex, Boolean includeDebug) in /home/runner/work/BinaryObjectScanner/BinaryObjectScanner/BinaryObjectScanner/FileType/Executable.cs:line 495 at BinaryObjectScanner.Scanner.ProcessExecutable(Executable executable, String fileName, Stream stream) in /home/runner/work/BinaryObjectScanner/BinaryObjectScanner/BinaryObjectScanner/Scanner.cs:line 501 at BinaryObjectScanner.Scanner.GetInternalProtections(String fileName, Stream stream) in /home/runner/work/BinaryObjectScanner/BinaryObjectScanner/BinaryObjectScanner/Scanner.cs:line 350 ```
Author
Owner

@mnadareski commented on GitHub (Jun 20, 2024):

This had to be fixed in Serialization. TL;DR is that the debug table is expected to exist if a certain set of things are set in the header and these have it stripped out regardless. Serialization needs to handle this by assuming that nothing will exist, unfortunately.

@mnadareski commented on GitHub (Jun 20, 2024): This had to be fixed in Serialization. TL;DR is that the debug table is expected to exist if a certain set of things are set in the header and these have it stripped out regardless. Serialization needs to handle this by assuming that nothing will exist, unfortunately.
Author
Owner

@mnadareski commented on GitHub (Jun 20, 2024):

In the meantime, latest WIP will have a fix that wraps the call above and stops it from throwing an exception all the way up the stack. That one went in as of e3eed76826

@mnadareski commented on GitHub (Jun 20, 2024): In the meantime, latest WIP will have a fix that wraps the call above and stops it from throwing an exception all the way up the stack. That one went in as of https://github.com/SabreTools/BinaryObjectScanner/commit/e3eed76826fe8a4254783eb59e91abe69233e935
Author
Owner

@fuzz6001 commented on GitHub (Jun 21, 2024):

Looks good 👍

E:\Test_net8.0_win-x64_Debug\Test\bin\Debug\net8.0\win-x64\publish>test -d e:\DXSETUP.EXE
0.00%:  -
0.00%: e:\DXSETUP.EXE - Checking file
100.00%: e:\DXSETUP.EXE -
Time elapsed: 00:00:00.4630160
@fuzz6001 commented on GitHub (Jun 21, 2024): Looks good :+1: ``` E:\Test_net8.0_win-x64_Debug\Test\bin\Debug\net8.0\win-x64\publish>test -d e:\DXSETUP.EXE 0.00%: - 0.00%: e:\DXSETUP.EXE - Checking file 100.00%: e:\DXSETUP.EXE - Time elapsed: 00:00:00.4630160 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SabreTools/BinaryObjectScanner#175