/* Data from an executable.

   Corey Minyard
   minyard@wf-rch.cirr.com
*/


struct s_entry_table
{
	BYTE	type;
	union
	{
		struct {
			BYTE	flags;
			BYTE	seg_num;
			WORD	int3f;
			WORD	seg_off;
		} seg;

		BYTE data[3];
	} u;
};

struct s_oseg_data
{
	int	desc;
	char	*data;
};

struct s_resource_table
{
	WORD	typeid;
	WORD	offset;
	WORD	length;
	WORD	flags;
	WORD	id;
	WORD	handle;
	WORD	usage;
};

struct s_resname_table
{
	char	*name;
	WORD	index;
};

struct s_modref_table
{
	WORD	offset;
};


struct s_exe_data
{
	unsigned int		seg_mult;
	struct s_entry_table	*entries;
	int			num_entries;
	struct s_segment_table	*segments;
	struct s_oseg_data	*oseg_data;
	int			num_segments;
	struct s_resource_table	*resources;
	int			num_resources;
	struct s_resource_table	*resource_names;
	struct s_resname_table	*resnames;
	int			num_resnames;
	char			*resname_strings;
	char			*import_strings;
	struct s_modref_table	*modrefs;
	int			num_modrefs;
	struct s_resname_table	*nonresnames;
	int			num_nonresnames;
	char			*nonresname_strings;
};
