00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "fltstruc.h"
00022 #include "htatom.h"
00023 #include "htflt.h"
00024 #include "htflthd.h"
00025 #include "httag.h"
00026 #include "formats.h"
00027 #include "snprintf.h"
00028
00029 static ht_mask_ptable fltheader[]=
00030 {
00031 {"magic", STATICTAG_EDIT_DWORD_BE("00000000")},
00032 {"version", STATICTAG_EDIT_DWORD_BE("00000004")},
00033 {"entry", STATICTAG_EDIT_DWORD_BE("00000008")},
00034 {"data_start", STATICTAG_EDIT_DWORD_BE("0000000c")},
00035 {"data_end", STATICTAG_EDIT_DWORD_BE("00000010")},
00036 {"bss_end", STATICTAG_EDIT_DWORD_BE("00000014")},
00037 {"stack_size", STATICTAG_EDIT_DWORD_BE("00000018")},
00038 {"reloc_start", STATICTAG_EDIT_DWORD_BE("0000001c")},
00039 {"reloc_count", STATICTAG_EDIT_DWORD_BE("00000020")},
00040 {0, 0}
00041 };
00042
00043 static ht_view *htfltheader_init(bounds *b, ht_streamfile *file, ht_format_group *group)
00044 {
00045 ht_flt_shared_data *flt_shared=(ht_flt_shared_data *)group->get_shared_data();
00046
00047 ht_uformat_viewer *v=new ht_uformat_viewer();
00048 v->init(b, DESC_FLT_HEADER, VC_EDIT, file, group);
00049 ht_mask_sub *m = new ht_mask_sub();
00050 m->init(file, 0);
00051 char info[128];
00052 sprintf(info, "* FLAT header at offset %08x", flt_shared->header_ofs);
00053 m->add_mask(info);
00054 m->add_staticmask_ptable(fltheader, flt_shared->header_ofs, true);
00055
00056 v->insertsub(m);
00057 return v;
00058 }
00059
00060 format_viewer_if htfltheader_if = {
00061 htfltheader_init,
00062 0
00063 };