mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-29 00:10:02 -05:00
Added arrays
This commit is contained in:
@@ -34,19 +34,24 @@ namespace hex {
|
||||
if (ImGui::Begin("Pattern Data", &this->m_windowOpen)) {
|
||||
ImGui::BeginChild("##scrolling", ImVec2(0, 0), false, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoNav);
|
||||
|
||||
for (auto& [offset, size, color, name] : this->m_highlights) {
|
||||
std::vector<u8> buffer(size + 1, 0x00);
|
||||
if (this->m_dataProvider != nullptr && this->m_dataProvider->isReadable()) {
|
||||
|
||||
this->m_dataProvider->read(offset, buffer.data(), size);
|
||||
for (auto&[offset, size, color, name] : this->m_highlights) {
|
||||
std::vector<u8> buffer(size + 1, 0x00);
|
||||
|
||||
if (size <= 8) {
|
||||
u64 data = 0;
|
||||
std::memcpy(&data, buffer.data(), size);
|
||||
this->m_dataProvider->read(offset, buffer.data(), size);
|
||||
|
||||
ImGui::LabelText(name.c_str(), "[0x%08lx:0x%08lx] %lu (0x%08lx) \"%s\"", offset, offset + size, data, data, makeDisplayable(buffer.data(), buffer.size()).c_str());
|
||||
if (size <= 8) {
|
||||
u64 data = 0;
|
||||
std::memcpy(&data, buffer.data(), size);
|
||||
|
||||
ImGui::LabelText(name.c_str(), "[0x%08lx:0x%08lx] %lu (0x%08lx) \"%s\"", offset,
|
||||
offset + size, data, data,
|
||||
makeDisplayable(buffer.data(), buffer.size()).c_str());
|
||||
} else
|
||||
ImGui::LabelText(name.c_str(), "[0x%08lx:0x%08lx] [ ARRAY ] \"%s\"", offset, offset + size,
|
||||
makeDisplayable(buffer.data(), buffer.size()).c_str());
|
||||
}
|
||||
else
|
||||
ImGui::LabelText(name.c_str(), "[0x%08lx:0x%08lx] [ ARRAY ] \"%s\"", offset, offset + size, makeDisplayable(buffer.data(), buffer.size()).c_str());
|
||||
}
|
||||
|
||||
ImGui::EndChild();
|
||||
|
||||
Reference in New Issue
Block a user