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

htlevxd.cc

Go to the documentation of this file.
00001 /* 
00002  *      HT Editor
00003  *      htlevxd.cc
00004  *
00005  *      Copyright (C) 1999-2002 Stefan Weyergraf (stefan@weyergraf.de)
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 "htatom.h"
00022 #include "htnewexe.h"
00023 #include "htle.h"
00024 #include "htlevxd.h"
00025 #include "httag.h"
00026 #include "formats.h"
00027 #include "snprintf.h"
00028 
00029 #include "lestruct.h"
00030 
00031 static ht_mask_ptable le_vxd_header[]=
00032 {
00033         {"next",                                                        STATICTAG_EDIT_DWORD_LE("00000000")},
00034         {"SDK version",                                 STATICTAG_EDIT_WORD_LE("00000004")},
00035         {"device number",                                       STATICTAG_EDIT_WORD_LE("00000006")},
00036         {"version major",                                       STATICTAG_EDIT_BYTE("00000008")},
00037         {"version minor",                                       STATICTAG_EDIT_BYTE("00000009")},
00038         {"flags",                                                       STATICTAG_EDIT_WORD_LE("0000000a")},
00039         {"name",                                                        STATICTAG_EDIT_CHAR("0000000c")STATICTAG_EDIT_CHAR("0000000d")STATICTAG_EDIT_CHAR("0000000e")STATICTAG_EDIT_CHAR("0000000f")STATICTAG_EDIT_CHAR("00000010")STATICTAG_EDIT_CHAR("00000011")STATICTAG_EDIT_CHAR("00000012")STATICTAG_EDIT_CHAR("00000013")},
00040         {"init order",                                          STATICTAG_EDIT_DWORD_LE("00000014")},
00041         {"offset of control function",          STATICTAG_EDIT_DWORD_LE("00000018")},
00042         {"offset of V86-control function",              STATICTAG_EDIT_DWORD_LE("0000001c")},
00043         {"offset of PM-control function",               STATICTAG_EDIT_DWORD_LE("00000020")},
00044         {"CS:IP of V86-control function",               STATICTAG_EDIT_DWORD_LE("00000024")},
00045         {"CS:IP of PM-control function",                STATICTAG_EDIT_DWORD_LE("00000028")},
00046         {"reference data from real mode",               STATICTAG_EDIT_DWORD_LE("0000002c")},
00047         {"offset of service table",                     STATICTAG_EDIT_DWORD_LE("00000030")},
00048         {"size of service table",                       STATICTAG_EDIT_DWORD_LE("00000034")},
00049         {"offset of win32 service table",               STATICTAG_EDIT_DWORD_LE("00000038")},
00050         {"prev",                                                        STATICTAG_EDIT_CHAR("0000003c")STATICTAG_EDIT_CHAR("0000003d")STATICTAG_EDIT_CHAR("0000003e")STATICTAG_EDIT_CHAR("0000003f")},
00051         {"size of this structure",                      STATICTAG_EDIT_DWORD_LE("00000040")},
00052         {"reserved",                                            STATICTAG_EDIT_CHAR("00000044")STATICTAG_EDIT_CHAR("00000045")STATICTAG_EDIT_CHAR("00000046")STATICTAG_EDIT_CHAR("00000047")},
00053         {"reserved",                                            STATICTAG_EDIT_CHAR("00000048")STATICTAG_EDIT_CHAR("00000049")STATICTAG_EDIT_CHAR("0000004a")STATICTAG_EDIT_CHAR("0000004b")},
00054         {"reserved",                                            STATICTAG_EDIT_CHAR("0000004c")STATICTAG_EDIT_CHAR("0000004d")STATICTAG_EDIT_CHAR("0000004e")STATICTAG_EDIT_CHAR("0000004f")},
00055         { NULL, NULL }
00056 };
00057 
00058 static ht_view *htlevxd_init(bounds *b, ht_streamfile *file, ht_format_group *group)
00059 {
00060         ht_le_shared_data *le_shared=(ht_le_shared_data *)group->get_shared_data();
00061         if (!le_shared->is_vxd) return NULL;
00062         ht_streamfile *myfile = le_shared->reloc_file;
00063 
00064         /* FIXME: */
00065         bool le_bigendian = false;
00066 
00067         ht_uformat_viewer *v = new ht_uformat_viewer();
00068         v->init(b, DESC_LE_VXD, VC_EDIT | VC_SEARCH, myfile, group);
00069         ht_mask_sub *m = new ht_mask_sub();
00070         m->init(myfile, 0);
00071 
00072         char info[128];
00073         ht_snprintf(info, sizeof info, "* LE VXD descriptor in section 1, offset %08x", le_shared->vxd_desc_linear_ofs);
00074         m->add_mask(info);
00075         m->add_staticmask_ptable(le_vxd_header, le_shared->vxd_desc_linear_ofs, le_bigendian);
00076         v->insertsub(m);
00077 
00078         le_shared->v_le_vxd = v;
00079         return v;
00080 }
00081 
00082 format_viewer_if htlevxd_if = {
00083         htlevxd_init,
00084         0
00085 };

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