-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsource.asm
57 lines (36 loc) · 958 Bytes
/
source.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
.386
.model flat, stdcall
option casemap : none
include \masm32\include\windows.inc
include \masm32\macros\macros.asm
uselib kernel32, user32, masm32, comctl32
.data
hUSER32 dd ?
hMSGBOX dd ?
pszUSER32 db 'user32.dll', 0
pszMSGBOX db 'MessageBoxA', 0
pszSuccessCaption db 'OK', 0
pszSuccessMessage db 'Function successfully imported and called', 0
.code
error:
push EXIT_FAILURE
call ExitProcess
start:
push offset pszUSER32
call LoadLibraryA
cmp eax, NULL
jz error
mov hUSER32, eax
push offset pszMSGBOX
push hUSER32
call GetProcAddress
cmp eax, NULL
jz error
mov hMSGBOX, eax
push MB_OK + MB_ICONINFORMATION
push offset pszSuccessCaption
push offset pszSuccessMessage
push NULL
call hMSGBOX
ret
end start