Пример #1
0
 private int PointerToOffset(int value)
 {
     if (map.ContainsVirtualOffset(value))
     {
         return(map.GetOffset(value));
     }
     throw new InvalidOperationException();
 }
Пример #2
0
 public int VirtualAddressToFileOffset(int value)
 {
     if (DefaultMemoryBlock.ContainsVirtualOffset(value))
     {
         return(DefaultMemoryBlock.GetOffset(value));
     }
     if (ActiveStructureMemoryAllocation.ContainsVirtualOffset(value))
     {
         return(ActiveStructureMemoryAllocation.GetOffset(value));
     }
     foreach (var block in StructureMemoryBlocks.Where(block => block.ContainsVirtualOffset(value)))
     {
         return(block.GetOffset(value));
     }
     throw new InvalidOperationException();
 }