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