home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.development      Operating system development chatter      4,255 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 4,076 of 4,255   
   Herbert Kleebauer to wolfgang kern   
   Re: KESYS may go UEFI (1/6)   
   05 Jan 24 10:14:04   
   
   From: klee@unibwm.de   
      
   On 05.01.2024 07:40, wolfgang kern wrote:   
   > ***   
   > I'm not sure about the PE-file contents (the last part below)   
   > if you can enter what's missing or correct anything please do :)   
   > TIA   
   > ***   
      
   Here the PE header (starting at file position $00a0) of a   
   minimal Win32 program. But the information is more than   
   30 years old.   
      
      
                                            ;;;;;;;;;;;;;;;;;;;;;;;   
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   
                                            ;; DEMO.mac: copy stdin to stdout,   
   convert a-z to A-Z             ;;   
                                            ;;;;;;;;;;;;;;;;;;;;;;;   
   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   
      
                                            UseIdatSection=0 ; 0 if no idat   
   section is used   
                                            UseUdatSection=0 ; 0 if no udat   
   section is used   
      
                                            ;#=====================   
   ============================================#   
                                            ;#                    Start of   
   Headers                              #   
                                            ;#=====================   
   ============================================#   
      
                                            ;       +--------------   
   -----------------------------+   
                                            ;       |         Start of DOS   
   Header                |   
                                            ;       +--------------   
   -----------------------------+   
      
                                                                            ; DOS   
   .EXE header   
   00000000: 00000000: 4d 5a                       dc.b    'MZ'            ;   
   Magic number   
   00000002: 00000002: 0160                        dc.w    dosfilesize\512 ;   
   Bytes on last page of file (0->512)   
   00000004: 00000004: 0001                        dc.w    (dosfilesize-1)/512+1   
                                                                            ;   
   Pages in file (Page=512 byte)   
   00000006: 00000006: 0000                        dc.w    0               ;   
   Relocations (nr of entries)   
   00000008: 00000008: 0004                        dc.w    doshead_end/16  ; Size   
   of header size in paragraphs (16 byte)   
   0000000a: 0000000a: 0000                        dc.w    0               ;   
   Minimum extra paragraphs needed   
   0000000c: 0000000c: ffff                        dc.w    $ffff           ;   
   Maximum extra paragraphs needed   
   0000000e: 0000000e: 0000                        dc.w    0               ;   
   Initial (relative) SS value (ss=load_adr+nr)   
   00000010: 00000010: 0160                        dc.w    dosstack        ;   
   Initial SP value   
   00000012: 00000012: 0000                        dc.w    0               ;   
   Checksum   
   00000014: 00000014: 0000                        dc.w    dosmain         ;   
   Initial IP value   
   00000016: 00000016: 0000                        dc.w    0               ;   
   Initial (relative) CS value (cs=load_adr+nr)   
   00000018: 00000018: 0040                        dc.w    reloc           ; File   
   address of relocation table   
   0000001a: 0000001a: 0000                        dc.w    0               ;   
   Overlay number   
   0000001c: 0000001c: 0000 0000 0000   
   00000022: 00000022: 0000                        dc.w    0,0,0,0         ;   
   Reserved words   
   00000024: 00000024: 0000                        dc.w    0               ; OEM   
   identifier (for e_oeminfo)   
   00000026: 00000026: 0000                        dc.w    0               ; OEM   
   information; e_oemid specific   
   00000028: 00000028: 00000000 00000000   
   00000030: 00000030: 00000000 00000000   
   00000038: 00000038: 00000000                    dc.l    0,0,0,0,0       ;   
   Reserved words   
   0000003c: 0000003c: 000000a0                    dc.l    WinHeader       ; File   
   address of new exe header   
                                            reloc:   
                                            doshead_end:   
      
                                                    @=$0   
   00000040: 00000000: 0e                  dosmain:move.w   s6,-(sp)   
   00000041: 00000001: 1f                          move.w   (sp)+,s0   
   00000042: 00000002: ba 000e                     move.w   #_text,r1   
   00000045: 00000005: b4 09                       move.b   #$09,m0   
   00000047: 00000007: cd 21                       trap     #$21   
   00000049: 00000009: b8 4c01                     move.w   #$4c01,r0   
   0000004c: 0000000c: cd 21                       trap     #$21   
   0000004e: 0000000e: 4e 69 63 65 20 74   
   00000054: 00000014: 6f 20 6d 65 65 74   
   0000005a: 0000001a: 20 73 6f 6d 65 62   
   00000060: 00000020: 6f 64 79 20 77 68   
   00000066: 00000026: 6f 20 69 73 20 73   
   0000006c: 0000002c: 74 69 6c 6c 20 75   
   00000072: 00000032: 73 69 6e 67 20 44   
   00000078: 00000038: 4f 53 2c 0d 0a      _text:  dc.b    'Nice to meet somebody   
   who is still using DOS,',13,10   
   0000007d: 0000003d: 62 75 74 20 74 68   
   00000083: 00000043: 69 73 20 70 72 6f   
   00000089: 00000049: 67 72 61 6d 20 72   
   0000008f: 0000004f: 65 71 75 69 72 65   
   00000095: 00000055: 73 20 57 69 6e 33   
   0000009b: 0000005b: 32 2e 0d 0a 24              dc.b    'but this program   
   requires Win32.',13,10,'$'   
                                                    even 16   
      
                                            dosstack=@+256          ; 256 Byte   
   stack   
                                            dosfilesize=@+256   
      
                                            ;       +--------------   
   -----------------------------+   
                                            ;       |           End of DOS   
   Header                |   
                                            ;       +--------------   
   -----------------------------+   
      
      
                                            ;       +--------------   
   -----------------------------+   
                                            ;       |         Start of Windows   
   Header            |   
                                            ;       +--------------   
   -----------------------------+   
      
                                                    ImageBase==   $00400000   
                                                    SectionAlignment== 4096   
                                                    FileAlignment==     512   
      
                                                    WinHeader=@@   
                                                    @=ImageBase   
      
                                                                                    
    see WINNT.H for information   
   000000a0: 00400000: 50 45 00 00                 dc.b   'PE',0,0                 
    magic word   
                                                                                    
    _IMAGE_FILE_HEADER:   
   000000a4: 00400004: 014c                        dc.w    $014c                   
    Machine ($014c=Intel x86 processor)   
   000000a6: 00400006: 0001                        dc.w    NumberOfSections        
    NumberOfSections   
      
   [continued in next message]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca