00001 /* 00002 * HT Editor 00003 * htpeimp.h 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 #ifndef __HTPEIMP_H__ 00022 #define __HTPEIMP_H__ 00023 00024 #include "formats.h" 00025 00026 extern format_viewer_if htpeimports_if; 00027 00028 /* 00029 * class ht_pe_import_library 00030 */ 00031 00032 class ht_pe_import_library: public Object { 00033 public: 00034 char *name; 00035 00036 ht_pe_import_library(char *name); 00037 ~ht_pe_import_library(); 00038 }; 00039 00040 /* 00041 * class ht_pe_import_function 00042 */ 00043 00044 class ht_pe_import_function: public Object { 00045 public: 00046 UINT libidx; 00047 bool byname; 00048 union { 00049 UINT ordinal; 00050 struct { 00051 char *name; 00052 UINT hint; 00053 } name; 00054 }; 00055 RVA address; 00056 00057 ht_pe_import_function(UINT libidx, RVA address, UINT ordinal); 00058 ht_pe_import_function(UINT libidx, RVA address, char *name, UINT hint); 00059 ~ht_pe_import_function(); 00060 }; 00061 00062 struct ht_pe_import { 00063 ht_clist *funcs; 00064 ht_clist *libs; 00065 }; 00066 00067 /* 00068 * CLASS ht_pe_import_viewer 00069 */ 00070 00071 class ht_pe_import_viewer: public ht_itext_listbox { 00072 protected: 00073 ht_format_group *format_group; 00074 bool grouplib; 00075 UINT sortby; 00076 /* new */ 00077 void dosort(); 00078 public: 00079 void init(bounds *b, char *desc, ht_format_group *fg); 00080 virtual void done(); 00081 /* overwritten */ 00082 virtual void handlemsg(htmsg *msg); 00083 virtual bool select_entry(void *entry); 00084 /* new */ 00085 char *func(UINT i, bool execute); 00086 }; 00087 00088 #endif /* !__HTPEIMP_H__ */