fix tfile header len

This commit is contained in:
silverweed 2024-07-30 10:47:13 +02:00
parent 4fe4909cd9
commit c680a1b5c3
2 changed files with 5 additions and 3 deletions

View file

@ -256,7 +256,9 @@ void update_and_render(Arena *arena, App_State &app, f32 delta_time_ms)
ImGui::ColorEdit3("_Page List", app.viewer.col_section[Sec_Page_List], flags); ImGui::ColorEdit3("_Page List", app.viewer.col_section[Sec_Page_List], flags);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Page List")) viewer_jump_to_page_list(app, app.viewer.latest_page_list_gone_to); if (ImGui::Button("Page List"))
viewer_jump_to_page_list(app, app.viewer.latest_page_list_gone_to);
ImGui::SameLine(); ImGui::SameLine();
{ {
i64 page_list_to_go_to = app.viewer.latest_page_list_gone_to; i64 page_list_to_go_to = app.viewer.latest_page_list_gone_to;

View file

@ -376,7 +376,7 @@ Section find_section(App_State &app, u64 off, i64 hilite_cluster = -1)
// TFile starting sections // TFile starting sections
u64 root_header_padding = tdata.rng_root_file_obj.start - tdata.root_file_header_size; u64 root_header_padding = tdata.rng_root_file_obj.start - tdata.root_file_header_size;
if (off < tdata.rng_root_file_obj.start) if (off < tdata.rng_root_file_obj.start)
return { Sec_TFile_Header, { 0, tdata.root_file_header_size }, 0, root_header_padding, hilite }; return { Sec_TFile_Header, { 0, tdata.root_file_header_size + root_header_padding }, 0, root_header_padding, hilite };
if (tdata.rng_root_file_obj.start <= off && off < tdata.rng_root_file_obj.end()) if (tdata.rng_root_file_obj.start <= off && off < tdata.rng_root_file_obj.end())
return { Sec_TFile_Object, tdata.rng_root_file_obj, 0, 0, hilite }; return { Sec_TFile_Object, tdata.rng_root_file_obj, 0, 0, hilite };
@ -386,7 +386,7 @@ Section find_section(App_State &app, u64 off, i64 hilite_cluster = -1)
return { Sec_TFile_Info, tdata.rng_root_file_info, tdata.rng_root_file_info_header.len, 0, hilite }; return { Sec_TFile_Info, tdata.rng_root_file_info, tdata.rng_root_file_info_header.len, 0, hilite };
if (tdata.rng_root_file_free_header.start <= off && off < tdata.rng_root_file_free.end()) { if (tdata.rng_root_file_free_header.start <= off && off < tdata.rng_root_file_free.end()) {
printf("%lu\n", tdata.rng_root_file_free_header.len); // printf("%lu\n", tdata.rng_root_file_free_header.len);
return { Sec_TFile_FreeList, tdata.rng_root_file_free, tdata.rng_root_file_free_header.len, 0, hilite }; return { Sec_TFile_FreeList, tdata.rng_root_file_free, tdata.rng_root_file_free_header.len, 0, hilite };
} }