format PE GUI use32 entry WinMain include fasminc win32a inc section d

 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
format PE GUI 4.0
use32
entry WinMain
include '%fasminc%/win32a.inc'
section '.data' data readable writeable
DriverName db 'FirstDriver.sys',0
title db 'Ошибка',0
msg1 db 'Невозможно подключиться к SCM',0
section '.code' code readable executable
SC_MANAGER_ALL_ACCESS equ 0xF003F
proc WinMain apientry
locals
hSCManager dd ?
hService dd ?
acDriverPath db MAX_PATH dup ?
endl
invoke OpenSCManager,NULL,NULL,SC_MANAGER_ALL_ACCESS
cmp eax,NULL
je .er1
mov [hSCManager],eax
push eax
invoke GetFullPathName,DriverName,sizeof.acDriverPath,[acDriverPath],esp
pop eax
invoke ExitProcess,0
.er1:
invoke MessageBox,HWND_DESKTOP,title,message,MB_OK+MB_ICONERROR
invoke ExitProcess,0
endp
data import
library kernel32, 'kernel32.dll', user32, 'user32.dll',advapi32,'advapi32.dll'
include '%fasminc%/api/kernel32.inc'
include '%fasminc%/api/user32.inc'
include '%fasminc%/api/advapi32.inc'
end data