From eb76262e42cee8a91d0c60fe7646a4a033b46b71 Mon Sep 17 00:00:00 2001 From: mm00 Date: Thu, 8 May 2025 18:15:20 +0200 Subject: [PATCH] changed getblock function to just check beginning of block --- BlendFile/Reader.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/BlendFile/Reader.cs b/BlendFile/Reader.cs index 131c9c0..b9da8fb 100644 --- a/BlendFile/Reader.cs +++ b/BlendFile/Reader.cs @@ -49,12 +49,22 @@ public class Reader { /// /// memory address in current system endianness /// A object + /* 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); + + } + + /// /// Creates a new instance of the class