elfviewer : don't display section header if they don't exist (seems like commercial games doesn't have section headers)
This commit is contained in:
parent
98068809aa
commit
08f8da2fea
|
@ -47,14 +47,14 @@ void ElfViewer::display(bool enabled)
|
|||
}
|
||||
if (ImGui::TreeNode("Elf"))
|
||||
{
|
||||
const auto* elf_header = elf->GetElfHeader();
|
||||
if (ImGui::TreeNodeEx("Elf Header", ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen, "Elf Header"))
|
||||
{
|
||||
if (ImGui::IsItemClicked())
|
||||
selected = ELF_HEADER;
|
||||
}
|
||||
if (ImGui::TreeNode("Elf Program Headers"))
|
||||
{
|
||||
const auto* elf_header = elf->GetElfHeader();
|
||||
{
|
||||
for (u16 i = 0; i < elf_header->e_phnum; i++)
|
||||
{
|
||||
const auto* pheader = elf->GetProgramHeader();
|
||||
|
@ -67,9 +67,12 @@ void ElfViewer::display(bool enabled)
|
|||
}
|
||||
ImGui::TreePop();
|
||||
}
|
||||
if (ImGui::TreeNode("Elf Section Headers"))
|
||||
if (elf_header->e_shnum != 0)
|
||||
{
|
||||
ImGui::TreePop();
|
||||
if (ImGui::TreeNode("Elf Section Headers"))
|
||||
{
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue