3 static char RCSId[] = "$Id: dump.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
4 static char Copyright[] = "Copyright Robert J. Amstadt, 1993";
13 #include <linux/unistd.h>
14 #include <linux/head.h>
15 #include <linux/ldt.h>
19 #include "prototypes.h"
21 /**********************************************************************
25 PrintFileHeader(struct ne_header_s
*ne_header
)
27 printf("ne_header: %c%c\n",
28 ne_header
->ne_magic
& 0xff,
29 ne_header
->ne_magic
>> 8 );
30 printf("linker version: %d.%d\n", ne_header
->linker_version
,
31 ne_header
->linker_revision
);
32 printf("format flags: %04x\n", ne_header
->format_flags
);
33 printf("automatic data segment: %04x\n", ne_header
->auto_data_seg
);
34 printf("CS:IP %04x:%04x\n", ne_header
->cs
, ne_header
->ip
);
35 printf("SS:SP %04x:%04x\n", ne_header
->ss
, ne_header
->sp
);
36 printf("additional flags: %02x\n", ne_header
->additional_flags
);
37 printf("operating system: %02x\n", ne_header
->operating_system
);
38 printf("fast load offset: %04x\n", ne_header
->fastload_offset
);
39 printf("fast load length: %04x\n", ne_header
->fastload_length
);
42 /**********************************************************************
43 * PrintRelocationTable
46 PrintRelocationTable(char *exe_ptr
,
47 struct ne_segment_table_entry_s
*seg_entry_p
,
50 struct relocation_entry_s
*rep
;
53 u_short n_entries
, *sp
;
55 printf("RELOCATION TABLE %d:\n", segment
+ 1);
57 if (seg_entry_p
->seg_data_offset
== 0)
60 offset
= seg_entry_p
->seg_data_length
;
64 sp
= (u_short
*) (exe_ptr
+ seg_entry_p
->seg_data_offset
* 512 + offset
);
67 rep
= (struct relocation_entry_s
*) (sp
+ 1);
68 for (i
= 0; i
< n_entries
; i
++, rep
++)
70 printf(" ADDR TYPE %d, TYPE %d, OFFSET %04x,",
71 rep
->address_type
, rep
->relocation_type
, rep
->offset
);
72 printf("TARGET %04x %04x\n", rep
->target1
, rep
->target2
);
75 #endif /* ifndef WINELIB */