Function at 0x403740
Capabilities:
Delete service

Disassembly:
push 0xffffffffffffffff
push 0x4d4c30
mov eax, dword fs:[0]
push eax
push ecx
push ebx
push esi
push edi
mov eax, dword [0x54d158]
xor eax, esp
push eax
lea eax, [esp + 0x14]
mov dword fs:[0], eax
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
test ebx, ebx
jne 0x403824
call fcn.004a08e6
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x403797
push 0x80004005
call fcn.004103e0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x14]
push str.Unregist_Service::OpenSCManager_failed___d__n
push ecx
call fcn.00410070
mov esi, dword [esp + 0x1c]
add esi, 0xfffffff0
push esi
call fcn.0040ff10
add esp, 0x10
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4037ee
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x1c], 0xffffffff
lea ecx, [esi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40380f
mov ecx, dword [esi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push esi
call edx
xor eax, eax
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
add esp, 0x10
ret
push 0x10000
push 0x51b9b8
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov edi, eax
test edi, edi
jne 0x4038b8
call fcn.004a08e6
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x403855
push 0x80004005
call fcn.004103e0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x14]
push str.Unregist_Service::OpenService_failed___d__n
push ecx
call fcn.00410070
mov esi, dword [esp + 0x1c]
add esi, 0xfffffff0
push esi
call fcn.0040ff10
add esp, 0x10
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4038ac
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x4037ee
push edi
call dword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x40391d
call fcn.004a08e6
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x4038dd
push 0x80004005
call fcn.004103e0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x10], eax
mov dword [esp + 0x1c], 2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x14]
push str.Unregist_Service::DeleteService_failed___d__n
push ecx
call fcn.00410070
mov esi, dword [esp + 0x1c]
add esi, 0xfffffff0
push esi
call fcn.0040ff10
add esp, 0x10
jmp 0x40396e
call fcn.004a08e6
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x403937
push 0x80004005
call fcn.004103e0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x10], eax
lea ecx, [esp + 0x10]
push str.Unregist_Service::Service_deleted_successfully_n
push ecx
mov dword [esp + 0x24], 3
call fcn.00410070
mov esi, dword [esp + 0x18]
add esi, 0xfffffff0
push esi
call fcn.0040ff10
add esp, 0xc
or ecx, 0xffffffff
lea edx, [eax + 0xc]
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x403987
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
or edx, 0xffffffff
lea ecx, [esi + 0xc]
mov dword [esp + 0x1c], edx
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4039a4
mov ecx, dword [esi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push esi
call edx
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
push ebx
call esi
mov eax, 1
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
add esp, 0x10
ret