📄 htxbehead.cc
字号:
{0, 0}};static ht_mask_ptable xbesectionheader[] = { {"section flags", STATICTAG_EDIT_DWORD_LE("00000000")" "STATICTAG_FLAGS("00000000", ATOM_XBE_SECTION_FLAGS_STR)}, {"virtual address", STATICTAG_EDIT_DWORD_LE("00000004")}, {"virtual size", STATICTAG_EDIT_DWORD_LE("00000008")}, {"raw address", STATICTAG_EDIT_DWORD_LE("0000000c")}, {"raw size", STATICTAG_EDIT_DWORD_LE("00000010")}, {"section name address", STATICTAG_EDIT_DWORD_LE("00000014")}, {"section name reference counter", STATICTAG_EDIT_DWORD_LE("00000018")}, {"head shared page reference counter address", STATICTAG_EDIT_DWORD_LE("0000001c")}, {"tail shared page reference counter address", STATICTAG_EDIT_DWORD_LE("00000020")}, {0, 0}};static ht_tag_flags_s xbe_library_flags[] ={ {-1, "XBE - library flags"}, {15, "[15] Debug Build"}, {0, 0}};static ht_mask_ptable xbelibraryversion[] = { {"library name", STATICTAG_EDIT_CHAR("00000000")STATICTAG_EDIT_CHAR("00000001")STATICTAG_EDIT_CHAR("00000002")STATICTAG_EDIT_CHAR("00000003")STATICTAG_EDIT_CHAR("00000004")STATICTAG_EDIT_CHAR("00000005")STATICTAG_EDIT_CHAR("00000006")STATICTAG_EDIT_CHAR("00000007")}, {"major version", STATICTAG_EDIT_WORD_LE("00000008")}, {"minor version", STATICTAG_EDIT_WORD_LE("0000000a")}, {"build version", STATICTAG_EDIT_WORD_LE("0000000c")}, {"library flags", STATICTAG_EDIT_WORD_LE("0000000e")" "STATICTAG_FLAGS("0000000a", ATOM_XBE_LIBRARY_FLAGS_STR)}, {0, 0}};static ht_view *htxbeheader_init(Bounds *b, File *file, ht_format_group *group){ ht_xbe_shared_data *xbe_shared=(ht_xbe_shared_data *)group->get_shared_data(); ht_xbe_header_viewer *v = new ht_xbe_header_viewer(); v->init(b, DESC_XBE_HEADER, VC_EDIT | VC_SEARCH, file, group); registerAtom(ATOM_XBE_INIT_FLAGS, xbe_init_flags); registerAtom(ATOM_XBE_SECTION_FLAGS, xbe_section_flags); registerAtom(ATOM_XBE_MEDIA_FLAGS, xbe_media_flags); registerAtom(ATOM_XBE_REGION, xbe_region_codes); registerAtom(ATOM_XBE_LIBRARY_FLAGS, xbe_library_flags); ht_mask_sub *s; ht_collapsable_sub *cs; s = new ht_mask_sub(); s->init(file, 0); char info[128]; ht_snprintf(info, sizeof info, "* XBE header"); s->add_mask(info); v->insertsub(s); /* FIXME: */ bool xbe_bigendian = false; s = new ht_mask_sub(); s->init(file, 1); s->add_staticmask_ptable(xbemagic, 0x0, xbe_bigendian); /* image header */ s->add_staticmask_ptable(xbeimageheader, 0x0, xbe_bigendian); cs = new ht_collapsable_sub(); cs->init(file, s, 1, "image header", 1); v->insertsub(cs); /* image header */ s = new ht_mask_sub(); s->init(file, 2); s->add_staticmask_ptable(xbecertificate, xbe_shared->header.certificate_address-xbe_shared->header.base_address, xbe_bigendian); cs = new ht_collapsable_sub(); cs->init(file, s, 1, "certificate", 1); v->insertsub(cs); /* library versions */ for (uint i=0; i < xbe_shared->header.number_of_library_versions; i++) { s = new ht_mask_sub(); s->init(file, 50+i); s->add_staticmask_ptable(xbelibraryversion, xbe_shared->header.library_versions_address-xbe_shared->header.base_address+i*sizeof *xbe_shared->libraries, xbe_bigendian); char t[256]; ht_snprintf(t, sizeof t, "library %d: %-9s %d.%d.%d", i, &xbe_shared->libraries[i].library_name, xbe_shared->libraries[i].major_version, xbe_shared->libraries[i].minor_version, xbe_shared->libraries[i].build_version); cs=new ht_collapsable_sub(); cs->init(file, s, 1, t, 1); v->insertsub(cs); } /* section headers */ for (uint i=0; i<xbe_shared->sections.number_of_sections; i++) { const char *name;// uint ofs; s=new ht_mask_sub(); s->init(file, 100+i); s->add_staticmask_ptable(xbesectionheader, xbe_shared->header.section_header_address-xbe_shared->header.base_address+i*sizeof *xbe_shared->sections.sections, xbe_bigendian); if (xbe_shared->sections.sections[i].section_name_address) { name = (char *)xbe_shared->sections.sections[i].section_name_address; } else { name = "<empty>"; } char t[256]; ht_snprintf(t, sizeof t, "section header %d: %s - rva %08x vsize %08x", i, name, xbe_shared->sections.sections[i].virtual_address, xbe_shared->sections.sections[i].virtual_size); cs=new ht_collapsable_sub(); cs->init(file, s, 1, t, 1); v->insertsub(cs); } return v;}format_viewer_if htxbeheader_if = { htxbeheader_init, 0};/* * CLASS ht_pe_header_viewer */void ht_xbe_header_viewer::init(Bounds *b, const char *desc, int caps, File *file, ht_format_group *group){ ht_uformat_viewer::init(b, desc, caps, file, group); VIEW_DEBUG_NAME("ht_xbe_header_viewer");}/*static ht_format_viewer *find_hex_viewer(ht_group *group){ // FIXME: God forgive us... ht_group *vr_group=group; while (strcmp(vr_group->desc, VIEWERGROUP_NAME)) vr_group=vr_group->group; ht_view *c=vr_group->getfirstchild(); while (c) { if (c->desc && (strcmp(c->desc, DESC_HEX)==0)) { return (ht_format_viewer*)c; } c=c->next; } return NULL;}*/bool ht_xbe_header_viewer::ref_sel(LINE_ID *id){ return true;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -