2025-07-04 00:04:51 +03:00
|
|
|
|
/* This software is licensed by the MIT License, see LICENSE file */
|
|
|
|
|
/* Copyright <20> 2024-2025 Gregory Lirent */
|
2025-07-02 16:06:50 +03:00
|
|
|
|
|
|
|
|
|
using System.Text.Json.Serialization;
|
2025-07-03 15:22:40 +03:00
|
|
|
|
using WebmrAPI.Utils;
|
2025-07-02 16:06:50 +03:00
|
|
|
|
|
|
|
|
|
namespace WebmrAPI.Models
|
|
|
|
|
{
|
2025-07-03 15:22:40 +03:00
|
|
|
|
public class MemoryRegion : ConcurrentObject
|
2025-07-02 16:06:50 +03:00
|
|
|
|
{
|
|
|
|
|
private long _addr = 0;
|
|
|
|
|
private ulong _size = 0;
|
|
|
|
|
|
|
|
|
|
[JsonIgnore]
|
|
|
|
|
public long MemoryAddress
|
|
|
|
|
{
|
|
|
|
|
get => LockedGet(ref _addr);
|
|
|
|
|
set => LockedSet(ref _addr, value);
|
|
|
|
|
}
|
|
|
|
|
public ulong MemorySize
|
|
|
|
|
{
|
|
|
|
|
get => LockedGet(ref _size);
|
|
|
|
|
set => LockedSet(ref _size, value);
|
|
|
|
|
}
|
|
|
|
|
public string? BaseAddress
|
|
|
|
|
{
|
2025-07-02 18:13:00 +03:00
|
|
|
|
get => (MemoryAddress > 0) ? $"0x{MemoryAddress:X16}" : null;
|
2025-07-02 16:06:50 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|