Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

htflthd.cc

Go to the documentation of this file.
00001 /* 
00002  *      HT Editor
00003  *      htflthd.cc
00004  *
00005  *      Copyright (C) 2003 Sebastian Biallas (sb@biallas.net)
00006  *
00007  *      This program is free software; you can redistribute it and/or modify
00008  *      it under the terms of the GNU General Public License version 2 as
00009  *      published by the Free Software Foundation.
00010  *
00011  *      This program is distributed in the hope that it will be useful,
00012  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *      GNU General Public License for more details.
00015  *
00016  *      You should have received a copy of the GNU General Public License
00017  *      along with this program; if not, write to the Free Software
00018  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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 };

Generated on Fri May 7 21:15:33 2004 by doxygen 1.3.5