diff options
| author | Brian Potchik <brian@vector35.com> | 2024-07-18 23:06:19 -0400 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2024-07-18 23:06:19 -0400 |
| commit | 5fc08034ea071119c5407898c81d0aa012512430 (patch) | |
| tree | 8aa1b5e8351cb5df68f794a82f0205f213d25869 /examples | |
| parent | 4360736956684054546340387193161131118796 (diff) | |
MemoryMap update with new segment model.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/triage/byte.cpp | 37 | ||||
| -rw-r--r-- | examples/triage/byte.h | 1 |
2 files changed, 1 insertions, 37 deletions
diff --git a/examples/triage/byte.cpp b/examples/triage/byte.cpp index 79e3bd50..3acab281 100644 --- a/examples/triage/byte.cpp +++ b/examples/triage/byte.cpp @@ -160,48 +160,13 @@ void ByteView::setSelectionOffsets(BNAddressRange range) void ByteView::updateRanges() { - m_ranges = m_data->GetAllocatedRanges(); - // Remove regions not backed by the file - for (auto& i : m_data->GetSegments()) - if (i->GetDataLength() < i->GetLength()) - removeRange(i->GetStart() + i->GetDataLength(), i->GetEnd()); + m_ranges = m_data->GetBackedAddressRanges(); m_allocatedLength = 0; for (auto& i : m_ranges) m_allocatedLength += i.end - i.start; } -void ByteView::removeRange(uint64_t begin, uint64_t end) -{ - std::vector<BNAddressRange> newRanges; - for (auto& i : m_ranges) - { - if ((end <= i.start) || (begin >= i.end)) - { - newRanges.push_back(i); - } - else if ((begin <= i.start) && (end >= i.end)) - { - continue; - } - else if ((begin <= i.start) && (end < i.end)) - { - newRanges.push_back(BNAddressRange {end, i.end}); - } - else if ((begin > i.start) && (end >= i.end)) - { - newRanges.push_back(BNAddressRange {i.start, begin}); - } - else - { - newRanges.push_back(BNAddressRange {i.start, begin}); - newRanges.push_back(BNAddressRange {end, i.end}); - } - } - m_ranges = newRanges; -} - - void ByteView::setTopToAddress(uint64_t addr) { for (auto& i : m_ranges) diff --git a/examples/triage/byte.h b/examples/triage/byte.h index 1c8c20f8..53a037e7 100644 --- a/examples/triage/byte.h +++ b/examples/triage/byte.h @@ -40,7 +40,6 @@ class ByteView : public QAbstractScrollArea, public View QTimer* m_cursorTimer; void updateRanges(); - void removeRange(uint64_t begin, uint64_t end); void setTopToAddress(uint64_t addr); |
