-
Notifications
You must be signed in to change notification settings - Fork 8
/
PE_HeaderDOS.asm
46 lines (36 loc) · 899 Bytes
/
PE_HeaderDOS.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
;==============================================================================
;
; PE Library
;
; Copyright (c) 2019 by fearless
;
; http://github.com/mrfearless
;
;==============================================================================
.686
.MMX
.XMM
.model flat,stdcall
option casemap:none
include windows.inc
include user32.inc
include kernel32.inc
includelib user32.lib
includelib kernel32.lib
include PE.inc
.CODE
PE_ALIGN
;------------------------------------------------------------------------------
; PE_HeaderDOS - returns pointer to IMAGE_DOS_HEADER of PE file
;------------------------------------------------------------------------------
PE_HeaderDOS PROC USES EBX hPE:DWORD
.IF hPE == NULL
xor eax, eax
ret
.ENDIF
mov ebx, hPE
mov eax, [ebx].PEINFO.PEDOSHeader
; eax points to IMAGE_DOS_HEADER
ret
PE_HeaderDOS ENDP
PE_LIBEND