我在实现 创建服务 这个功能的时候
写不进服务列表
希望大家帮看看,先谢谢了
以下是 代码(仅仅是写进列表,不要求运行或者别的)
.386
.model flat, stdcall
option casemap :none
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; Include 文件定义
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include windows.inc
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
include AdvApi32.inc
includelib AdvApi32.lib
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; 数据段
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.data?
@dwReturn dd ?
@hService dd ?
hSCM dd ?
.const
szServiceName db 'hihiihhihi',0
szDisplayName db ' l1dsadfa',0
szServiceFile db '"d:\\Shot00009.bmp',0
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
; 代码段
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.code
start:
;local @dwReturn
;local @hService
invoke OpenSCManager,NULL,NULL,SERVICE_ALL_ACCESS
mov hSCM,eax
; 创建服务
invoke CreateService,hSCM,addr szServiceName,addr szDisplayName,\
SERVICE_ALL_ACCESS,SERVICE_WIN32_OWN_PROCESS or SERVICE_INTERACTIVE_PROCESS,\
SERVICE_AUTO_START,SERVICE_ERROR_NORMAL,addr szServiceFile,\
NULL,NULL,NULL,NULL,NULL
.if ! eax ;错误处理
invoke GetLastError
.if eax == ERROR_DUP_NAME || eax == ERROR_SERVICE_EXISTS
mov @dwReturn,TRUE
.else
mov @dwReturn,FALSE
.endif
jmp @F
.endif
mov @hService,eax
mov @dwReturn,TRUE
;****************************************************************
invoke CloseServiceHandle,@hService
@@:
mov eax,@dwReturn
ret
;_InstallService endp
end start
[课程]Android-CTF解题方法汇总!