mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-20 15:55:15 +00:00
Lock stream when reading raw section
This commit is contained in:
@@ -224,8 +224,15 @@ namespace BurnOutSharp.ExecutableType.Microsoft
|
||||
if (section == null)
|
||||
return null;
|
||||
|
||||
stream.Seek((int)section.PointerToRawData, SeekOrigin.Begin);
|
||||
return stream.ReadBytes((int)section.VirtualSize);
|
||||
lock (stream)
|
||||
{
|
||||
long originalPosition = stream.Position;
|
||||
stream.Seek((int)section.PointerToRawData, SeekOrigin.Begin);
|
||||
byte[] sectionData = stream.ReadBytes((int)section.VirtualSize);
|
||||
stream.Seek(originalPosition, SeekOrigin.Begin);
|
||||
return sectionData;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user