Function at 0x4044e0
Capabilities:
Create service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 0xc]
push ebx
xor ebx, ebx
push esi
mov esi, dword [sym.imp.OLEAUT32.dll_SysReAllocString]
push edi
mov dword [ebp - 4], ebx
cmp eax, ebx
jne 0x4045b9
mov dword [ebp - 8], ebx
mov eax, dword [ebp + 0x10]
cmp eax, ebx
jne 0x4045d1
mov dword [ebp - 0x14], ebx
mov eax, dword [ebp + 0x14]
cmp eax, ebx
jne 0x4045e9
mov dword [ebp - 0xc], ebx
mov eax, dword [ebp + 0x18]
cmp eax, ebx
jne 0x404601
mov dword [ebp - 0x10], ebx
mov edi, dword [ebp + 8]
mov eax, dword [edi]
mov edx, dword [eax + 0x14]
lea ecx, [ebp - 8]
push ecx
mov ecx, edi
call edx
mov eax, dword [edi]
mov edx, dword [eax + 0x14]
lea ecx, [ebp - 0x14]
push ecx
mov ecx, edi
call edx
mov eax, dword [edi]
mov edx, dword [eax + 0x14]
lea ecx, [ebp - 0xc]
push ecx
mov ecx, edi
call edx
mov eax, dword [edi]
mov edx, dword [eax + 0x14]
lea ecx, [ebp - 0x10]
push ecx
mov ecx, edi
call edx
mov eax, dword [ebp - 8]
mov dword [ebp + 0xc], eax
cmp eax, ebx
je 0x404619
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
inc eax
cmp eax, 0x3fffffff
jg 0x404619
lea ebx, [eax + eax]
mov eax, ebx
call fcn.00411340
mov esi, esp
test esi, esi
je 0x404619
mov eax, dword [ebp + 0xc]
push 0
push 0
push ebx
push esi
push 0xffffffffffffffff
push eax
push 0
push 3
mov byte [esi], 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
neg eax
sbb eax, eax
and eax, esi
jmp 0x40461b
push eax
call esi
mov dword [ebp - 8], eax
cmp eax, ebx
jne 0x404502
push 0x8007000e
call fcn.00401100
push eax
call esi
mov dword [ebp - 0x14], eax
cmp eax, ebx
jne 0x404510
push 0x8007000e
call fcn.00401100
push eax
call esi
mov dword [ebp - 0xc], eax
cmp eax, ebx
jne 0x40451e
push 0x8007000e
call fcn.00401100
push eax
call esi
mov dword [ebp - 0x10], eax
cmp eax, ebx
jne 0x40452c
push 0x8007000e
call fcn.00401100
xor eax, eax
mov edx, dword [edi]
push 0x14
push eax
mov eax, dword [edx + 4]
mov ecx, edi
call eax
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [ebp + 0x18], eax
test eax, eax
jne 0x4047ba
mov eax, dword [ebp - 8]
mov ebx, eax
test eax, eax
jne 0x404651
xor edi, edi
mov dword [ebp + 0xc], edi
jmp 0x404695
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
inc eax
cmp eax, 0x3fffffff
jg 0x40468e
lea edi, [eax + eax]
mov eax, edi
call fcn.00411340
mov esi, esp
test esi, esi
je 0x40468e
push 0
push 0
push edi
push esi
push 0xffffffffffffffff
push ebx
push 0
push 3
mov byte [esi], 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
neg eax
sbb eax, eax
and eax, esi
jmp 0x404690
xor eax, eax
mov edi, eax
mov dword [ebp + 0xc], eax
mov eax, dword [ebp - 4]
mov ecx, dword [0x424d88]
mov edx, str.Service
or eax, 3
shr edx, 0x10
mov dword [ebp - 4], eax
mov dword [ebp + 0x14], ecx
test edx, edx
jne 0x4046c5
mov eax, str.Service
movzx eax, ax
lea ecx, [ebp + 0x14]
call fcn.00401dc0
jmp 0x404713
push str.Service
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov esi, eax
test esi, esi
je 0x404713
lea ecx, [esi + 0xd]
push ecx
call fcn.0040ade5
add esp, 4
test eax, eax
je 0x404713
mov dword [eax], 1
mov byte [eax + esi + 0xc], 0
mov dword [eax + 4], esi
mov dword [eax + 8], esi
add eax, 0xc
lea edx, [esi + 1]
mov dword [ebp + 0x14], eax
cmp edx, esi
jb 0x404713
push esi
push str.Service
push eax
call fcn.0040b610
add esp, 0xc
mov eax, dword [0x424d88]
mov dword [ebp + 0x10], eax
test edi, edi
jne 0x404723
xor ebx, ebx
jmp 0x40472f
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ebx, eax
mov edx, dword [ebp + 0x14]
mov edi, dword [edx - 8]
lea esi, [ebx + edi]
cmp esi, edi
jl 0x40479b
cmp esi, ebx
jl 0x40479b
test esi, esi
je 0x40479b
lea eax, [esi + 0xd]
push eax
call fcn.0040ade5
add esp, 4
test eax, eax
je 0x40479b
mov dword [eax], 1
mov byte [eax + esi + 0xc], 0
mov dword [eax + 4], esi
mov dword [eax + 8], esi
add eax, 0xc
lea ecx, [esi + 1]
mov dword [ebp + 0x10], eax
cmp ecx, edi
jb 0x404780
mov edx, dword [ebp + 0x14]
push edi
push edx
push eax
call fcn.0040b610
add esp, 0xc
mov ecx, dword [ebp + 0x10]
sub esi, edi
inc esi
lea eax, [edi + ecx]
cmp esi, ebx
jb 0x40479b
mov edx, dword [ebp + 0xc]
push ebx
push edx
push eax
call fcn.0040b610
add esp, 0xc
mov esi, dword [ebp + 8]
mov edi, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [edi + 0x1c]
push eax
mov eax, dword [ebp + 0x10]
push eax
mov ecx, esi
call edx
mov byte [ebp + 0xf], 1
test al, al
jne 0x4047be
mov byte [ebp + 0xf], 0
mov ebx, dword [ebp - 4]
test bl, 2
je 0x4047f1
mov eax, dword [ebp + 0x10]
and ebx, 0xfffffffd
lea ecx, [eax - 0xc]
mov dword [ebp - 4], ebx
cmp ecx, 0x424d78
je 0x4047f1
lea esi, [eax - 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x4047f1
push esi
call fcn.0040b07a
add esp, 4
test bl, 1
je 0x404821
mov eax, dword [ebp + 0x14]
and ebx, 0xfffffffe
lea edx, [eax - 0xc]
mov dword [ebp - 4], ebx
cmp edx, 0x424d78
je 0x404821
lea esi, [eax - 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x404821
push esi
call fcn.0040b07a
add esp, 4
cmp byte [ebp + 0xf], 0
jne 0x404627
cmp dword [ebp + 0x18], 0
jne 0x404860
mov eax, dword [ebp - 0x10]
mov esi, dword [sym.imp.OLEAUT32.dll_SysStringLen]
push eax
call esi
mov ecx, dword [ebp - 0xc]
push ecx
call esi
mov edx, dword [ebp - 0x14]
push edx
call esi
mov eax, dword [ebp - 8]
push eax
call esi
mov eax, 0x80004005
lea esp, [ebp - 0x24]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp + 0x1c]
mov eax, dword [ebp - 0x14]
push 0
push 0
push 0
push 0
push 0
push ecx
mov ecx, dword [ebp - 8]
push 1
push edx
mov edx, dword [ebp + 0x18]
push 0x10
push 0xf01ff
push eax
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x404a13
mov eax, dword [ebp - 8]
mov ebx, eax
test eax, eax
jne 0x4048a8
xor edi, edi
mov dword [ebp + 0x14], edi
jmp 0x4048ec
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
inc eax
cmp eax, 0x3fffffff
jg 0x4048e5
lea edi, [eax + eax]
mov eax, edi
call fcn.00411340
mov esi, esp
test esi, esi
je 0x4048e5
push 0
push 0
push edi
push esi
push 0xffffffffffffffff
push ebx
push 0
push 3
mov byte [esi], 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
neg eax
sbb eax, eax
and eax, esi
jmp 0x4048e7
xor eax, eax
mov edi, eax
mov dword [ebp + 0x14], eax
mov eax, dword [ebp - 4]
or eax, 0xc
mov ecx, str.Service
mov dword [ebp - 4], eax
mov eax, dword [0x424d88]
shr ecx, 0x10
mov dword [ebp + 0x10], eax
test ecx, ecx
jne 0x40491b
mov edx, str.Service
movzx eax, dx
lea ecx, [ebp + 0x10]
call fcn.00401dc0
jmp 0x404969
push str.Service
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov esi, eax
test esi, esi
je 0x404969
lea eax, [esi + 0xd]
push eax
call fcn.0040ade5
add esp, 4
test eax, eax
je 0x404969
mov dword [eax], 1
mov byte [eax + esi + 0xc], 0
mov dword [eax + 4], esi
mov dword [eax + 8], esi
add eax, 0xc
lea ecx, [esi + 1]
mov dword [ebp + 0x10], eax
cmp ecx, esi
jb 0x404969
push esi
push str.Service
push eax
call fcn.0040b610
add esp, 0xc
mov edx, dword [0x424d88]
mov dword [ebp + 0xc], edx
test edi, edi
jne 0x40497a
xor ebx, ebx
jmp 0x404986
mov eax, dword [ebp + 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ebx, eax
mov ecx, dword [ebp + 0x10]
mov edi, dword [ecx - 8]
lea esi, [ebx + edi]
cmp esi, edi
jl 0x4049f4
cmp esi, ebx
jl 0x4049f4
test esi, esi
je 0x4049f4
lea edx, [esi + 0xd]
push edx
call fcn.0040ade5
add esp, 4
test eax, eax
je 0x4049f4
mov dword [eax], 1
mov byte [eax + esi + 0xc], 0
mov dword [eax + 4], esi
mov dword [eax + 8], esi
add eax, 0xc
mov dword [ebp + 0xc], eax
lea eax, [esi + 1]
cmp eax, edi
jb 0x4049da
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0xc]
push edi
push ecx
push edx
call fcn.0040b610
add esp, 0xc
mov eax, dword [ebp + 0xc]
sub esi, edi
inc esi
add eax, edi
cmp esi, ebx
jb 0x4049f4
mov ecx, dword [ebp + 0x14]
push ebx
push ecx
push eax
call fcn.0040b610
add esp, 0xc
mov esi, dword [ebp + 8]
mov edi, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [ebp + 0xc]
push eax
mov eax, dword [edi + 0x1c]
push edx
mov ecx, esi
call eax
test al, al
je 0x404a13
mov bl, 1
jmp 0x404a15
xor bl, bl
test byte [ebp - 4], 8
je 0x404a44
mov eax, dword [ebp + 0xc]
and dword [ebp - 4], 0xfffffff7
lea ecx, [eax - 0xc]
cmp ecx, 0x424d78
je 0x404a44
lea esi, [eax - 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x404a44
push esi
call fcn.0040b07a
add esp, 4
test byte [ebp - 4], 4
je 0x404a73
mov eax, dword [ebp + 0x10]
and dword [ebp - 4], 0xfffffffb
lea edx, [eax - 0xc]
cmp edx, 0x424d78
je 0x404a73
lea esi, [eax - 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x404a73
push esi
call fcn.0040b07a
add esp, 4
test bl, bl
jne 0x404860
mov edi, dword [ebp - 0x18]
test edi, edi
jne 0x404abb
mov eax, dword [ebp + 0x18]
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [ebp - 0x10]
mov esi, dword [sym.imp.OLEAUT32.dll_SysStringLen]
push ecx
call esi
mov edx, dword [ebp - 0xc]
push edx
call esi
mov eax, dword [ebp - 0x14]
push eax
call esi
mov ecx, dword [ebp - 8]
push ecx
call esi
mov eax, 0x80004005
lea esp, [ebp - 0x24]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.OLEAUT32.dll_VariantInit]
test eax, eax
je 0x404b00
push str.Advapi32
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x404b00
mov eax, dword [ebp - 0xc]
push str.ChangeServiceConfig2W
push esi
mov dword [ebp + 0xc], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x404af9
lea ecx, [ebp + 0xc]
push ecx
push 1
push edi
call eax
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 8]
mov ebx, eax
test eax, eax
je 0x404b1f
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
inc eax
cmp eax, 0x3fffffff
jle 0x404b23
xor eax, eax
jmp 0x404b3d
lea edi, [eax + eax]
mov eax, edi
call fcn.00411340
mov esi, esp
mov edx, 3
mov ecx, edi
mov eax, ebx
call fcn.00401070
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 8]
push 8
call eax
mov ecx, dword [ebp + 0x18]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov edx, dword [ebp - 0x10]
mov esi, dword [sym.imp.OLEAUT32.dll_SysStringLen]
push edx
call esi
mov eax, dword [ebp - 0xc]
push eax
call esi
mov ecx, dword [ebp - 0x14]
push ecx
call esi
mov edx, dword [ebp - 8]
push edx
call esi
xor eax, eax
lea esp, [ebp - 0x24]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x18