mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-19 09:54:54 +00:00
elf headers and elf program headers in imgui elfviewer
This commit is contained in:
parent
6511b280cf
commit
f2198ef27d
3 changed files with 105 additions and 82 deletions
|
@ -12,6 +12,7 @@ void ElfViewer::display(bool enabled)
|
|||
int SELF_HEADER = 0;
|
||||
int ELF_HEADER = 1;
|
||||
int SEG_HEADER_START = 100;
|
||||
int ELF_PROGRAM_HEADER_START = 200;
|
||||
|
||||
static int selected = -1;
|
||||
ImGui::Begin("Self/Elf Viewer", &enabled);
|
||||
|
@ -58,6 +59,8 @@ void ElfViewer::display(bool enabled)
|
|||
{
|
||||
if (ImGui::TreeNodeEx((void*)(intptr_t)i,ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen, "%d", i))
|
||||
{
|
||||
if (ImGui::IsItemClicked())
|
||||
selected = ELF_PROGRAM_HEADER_START + i;
|
||||
}
|
||||
}
|
||||
ImGui::TreePop();
|
||||
|
@ -80,6 +83,13 @@ void ElfViewer::display(bool enabled)
|
|||
{
|
||||
ImGui::TextWrapped(elf->SELFSegHeader(selected-100).c_str());
|
||||
}
|
||||
if (selected == ELF_HEADER) {
|
||||
ImGui::TextWrapped(elf->ElfHeaderStr().c_str());
|
||||
}
|
||||
if (selected >= 200 && selected < 300)
|
||||
{
|
||||
ImGui::TextWrapped(elf->ElfPHeaderStr(selected - 200).c_str());
|
||||
}
|
||||
ImGui::EndChild();
|
||||
ImGui::End();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue