00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "htatom.h"
00022 #include "htendian.h"
00023 #include "htne.h"
00024 #include "htneent.h"
00025 #include "httag.h"
00026 #include "formats.h"
00027 #include "snprintf.h"
00028
00029 #include <stdlib.h>
00030
00031 static ht_view *htneimports_init(bounds *b, ht_streamfile *file, ht_format_group *group)
00032 {
00033 ht_ne_shared_data *ne_shared = (ht_ne_shared_data *)group->get_shared_data();
00034
00035 FILEOFS h = ne_shared->hdr_ofs;
00036 ht_uformat_viewer *v = new ht_uformat_viewer();
00037 v->init(b, DESC_NE_IMPORTS, VC_EDIT | VC_SEARCH, file, group);
00038 ht_mask_sub *m = new ht_mask_sub();
00039 m->init(file, 0);
00040
00041 char line[256];
00042 ht_snprintf(line, sizeof line, "* NE imported names and module reference table at offset %08x / %08x", h+ne_shared->hdr.imptab, h+ne_shared->hdr.modtab);
00043 m->add_mask(line);
00044
00045 for (UINT i=0; i<ne_shared->modnames_count; i++) {
00046 ht_snprintf(line, sizeof line, "%0d: %s", i+1, ne_shared->modnames[i]);
00047 m->add_mask(line);
00048 }
00049 v->insertsub(m);
00050
00051 return v;
00052 }
00053
00054 format_viewer_if htneimports_if = {
00055 htneimports_init,
00056 0
00057 };