-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathPE_ExportNamePointerTable.asm
60 lines (47 loc) · 1.23 KB
/
PE_ExportNamePointerTable.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
;==============================================================================
;
; 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_ExportNamePointerTable
;------------------------------------------------------------------------------
PE_ExportNamePointerTable PROC USES EBX hPE:DWORD
LOCAL PEMemMapPtr:DWORD
LOCAL pExportDirectoryTable:DWORD
.IF hPE == NULL
xor eax, eax
ret
.ENDIF
mov ebx, hPE
mov eax, [ebx].PEINFO.PEMemMapPtr
mov PEMemMapPtr, eax
Invoke PE_ExportDirectoryTable, hPE
.IF eax == 0
ret
.ENDIF
mov ebx, eax ; ebx is pExportDirectoryTable
mov eax, [ebx].IMAGE_EXPORT_DIRECTORY.AddressOfNames
Invoke PE_RVAToOffset, hPE, eax
add eax, PEMemMapPtr
; eax has pointer to Export Name Pointer Table RVA
ret
PE_ExportNamePointerTable ENDP
PE_LIBEND