changed getblock function to just check beginning of block
This commit is contained in:
@@ -49,12 +49,22 @@ public class Reader {
|
||||
/// </summary>
|
||||
/// <param name="memAddr">memory address in current system endianness</param>
|
||||
/// <returns>A <see cref="Kaitai.BlendFile.FileBlock"/> object</returns>
|
||||
/*
|
||||
public FileBlock? GetBlock(long memAddr) {
|
||||
var blocks = OrderedBlocks.Where(x =>
|
||||
memAddr >= x.MemAddr.ToPointer() && memAddr < x.MemAddr.ToPointer() + x.LenBody);
|
||||
|
||||
return blocks.MaxBy(x => x.LenBody);
|
||||
}
|
||||
*/
|
||||
|
||||
public FileBlock? GetBlock(long memAddr)
|
||||
{
|
||||
return OrderedBlocks.FirstOrDefault(x => x.MemAddr.ToMemAddr() == memAddr);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="Reader"/> class
|
||||
|
||||
Reference in New Issue
Block a user