コード例 #1
0
 /// <summary>
 /// Gets the first local <see cref="MemoryChunk"/> in this <see cref="IMemoryHandler"/> that contains the given address.
 /// </summary>
 /// <param name="handler">The <see cref="IMemoryHandler"/> handling the request.</param>
 /// <param name="address">The <see cref="uint"/> address to query.</param>
 /// <param name="acceptClones">A <see cref="bool"/> indicating whether to include chunks where <see cref="MemoryChunk.IsClone"/> is set to 'true'.</param>
 /// <returns>A <see cref="MemoryChunk"/> from <see cref="IMemoryHandler.Chunks"/> that contains the given address, or 'null' if none is found.</returns>
 public static MemoryChunk?GetChunk(this IMemoryHandler handler, uint address, bool acceptClones = true)
 {
     if (handler.Chunks.Any(c => c.Contains(address)))
     {
         return(handler.Chunks.First(c => c.Contains(address) && (acceptClones || !c.IsClone)));
     }
     else
     {
         return(null);
     }
 }
コード例 #2
0
 public void RemoveMemoryHandler(IMemoryHandler memoryHandler)
 {
     memoryHandlers.Remove(memoryHandler);
 }
コード例 #3
0
 public void AddMemoryHandler(IMemoryHandler memoryHandler)
 {
     memoryHandlers.Add(memoryHandler);
 }
コード例 #4
0
 public void RemoveMemoryHandler(IMemoryHandler memoryHandler)
 {
     memoryHandlers.Remove(memoryHandler);
 }
コード例 #5
0
 public void AddMemoryHandler(IMemoryHandler memoryHandler)
 {
     memoryHandlers.Add(memoryHandler);
 }
コード例 #6
0
 /// <summary>
 /// Checks whether this <see cref="IMemoryHandler"/> manages the given address in memory.
 /// </summary>
 /// <param name="handler">The <see cref="IMemoryHandler"/> handling the request.</param>
 /// <param name="address">The <see cref="uint"/> address to query.</param>
 /// <returns>A <see cref="bool"/> whether <paramref name="address"/> lies within one of the <see cref="IMemoryHandler.Chunks"/> that are managed (not clones) by this <see cref="IMemoryHandler"/>.</returns>
 public static bool Manages(this IMemoryHandler handler, uint address)
 {
     return(handler.Chunks.Any(c => !c.IsClone && c.Contains(address)));
 }