Function at 0x4041b0
Capabilities:
Check if file exists
Create service
Create thread
Delete file
Delete service
Get common file path
Get hostname
Initialize winsock library
Resolve dns

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1108
call fcn.00409410
mov eax, dword [0x46a124]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x10ec], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x10e8], eax
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x1100], eax
mov eax, dword [ebp + 0x20]
push ebx
push esi
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x10fc], eax
mov eax, dword [ebp + 0x24]
push edi
mov edi, dword [ebp + 0x14]
mov dword [ebp - 0x10f8], eax
lea eax, [ebp - 0x1108]
push eax
lea eax, [ebp - 0x720]
mov dword [ebp - 0x10e4], esi
push eax
mov dword [ebp - 0x10f0], edi
mov dword [ebp - 0x1108], 0x104
call dword [sym.imp.KERNEL32.dll_GetComputerNameW]
lea eax, [ebp - 0x720]
push esi
push eax
call fcn.00413875
add esp, 8
test eax, eax
jne 0x4042d3
mov bl, 1
push 0x45bd38
mov byte [ebp - 0x1104], bl
call fcn.00404170
add esp, 4
cmp byte [0x46ab75], 0
jne 0x404274
lea eax, [ebp - 0x10d0]
push eax
push 0x202
call sub.WS2_32.dll_WSAStartup
mov byte [0x46ab75], bl
push 0x104
lea eax, [ebp - 0x310]
push eax
call sub.WS2_32.dll_gethostname
lea eax, [ebp - 0x310]
push eax
call sub.WS2_32.dll_gethostbyname
movsx ecx, word [eax + 0xa]
mov eax, dword [eax + 0xc]
push ecx
push dword [eax]
lea eax, [ebp - 0x10dc]
push eax
call fcn.0040a500
add esp, 0xc
lea eax, [ebp - 0x20c]
push 0x104
push eax
push 0xffffffffffffffff
push dword [ebp - 0x10dc]
call sub.WS2_32.dll_inet_ntoa
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
jmp 0x4043dc
xor bl, bl
lea edx, [ebp - 0x20c]
mov byte [ebp - 0x1104], bl
mov ecx, esi
sub edx, esi
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x4042e5
push esi
push 0x45bd74
call fcn.00404170
mov esi, dword [ebp + 0x2c]
add esp, 8
cmp esi, 0xffffffff
je 0x4043d6
push 0x2c
call fcn.004139ef
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0x10ec]
push 0
mov byte [eax], cl
mov ecx, dword [ebp - 0x10e4]
mov dword [eax + 4], ecx
lea ecx, [ebp - 0x20c]
mov dword [eax + 8], ecx
mov ecx, dword [ebp - 0x10e8]
mov dword [eax + 0x10], ecx
mov ecx, dword [ebp - 0x1100]
push 0
push eax
mov dword [eax + 0x1c], ecx
mov ecx, dword [ebp - 0x10fc]
mov dword [eax + 0x20], ecx
mov ecx, dword [ebp - 0x10f8]
push 0x404d30
mov dword [eax + 0x24], ecx
mov ecx, dword [ebp + 0x30]
push 0
push 0
mov byte [eax + 0xc], 0
mov dword [eax + 0x14], edi
mov dword [eax + 0x18], edx
mov byte [eax + 0x28], cl
call fcn.00427106
add esp, 0x1c
imul ecx, esi, 0x3e8
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x4043ce
push dword [ebp - 0x10e4]
push 0x45bd9c
push 2
call fcn.00413ed7
add esp, 4
push eax
call fcn.00402680
add esp, 0xc
push 0x5b4
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
xor al, al
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004093c1
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 0x10e4]
jmp 0x404426
mov esi, dword [ebp - 0x10e4]
mov ecx, dword [ebp + 0x30]
lea eax, [ebp - 0x20c]
mov edx, dword [ebp - 0x10ec]
push ecx
mov ecx, dword [ebp - 0x10f8]
push ecx
mov ecx, dword [ebp - 0x10fc]
push ecx
mov ecx, dword [ebp - 0x1100]
push ecx
mov ecx, dword [ebp - 0x10e8]
push edx
push edi
push ecx
push dword [ebp - 0x1104]
mov ecx, dword [ebp + 8]
push eax
push esi
push ecx
call fcn.00404a30
add esp, 0x2c
test al, al
je 0x404735
call fcn.00403060
test bl, bl
mov eax, 0x45bdcc
cmove eax, esi
push eax
push dword [ebp - 0x10e8]
push 0x45bde8
call fcn.00404170
push dword [ebp - 0x10ec]
lea eax, [ebp - 0x928]
push 0x45be24
push eax
call fcn.004020d0
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 0x18
push 0xf003f
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
je 0x40453f
cmp byte [ebp + 0x28], 0
mov eax, 0x110
mov ecx, 0x10
cmove eax, ecx
mov dword [ebp - 0x10f4], eax
push 0
push 0
push 0
push 0
push 0
lea ecx, [ebp - 0x928]
push ecx
push 0
push 3
push eax
push 0xf01ff
push dword [ebp - 0x10e8]
push dword [ebp - 0x10f0]
push edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
test eax, eax
jne 0x4044f1
call ebx
xor ecx, ecx
cmp eax, 0x431
sete cl
test ecx, ecx
jne 0x4044f8
call ebx
mov esi, eax
cmp esi, 0x34
je 0x4044f8
cmp esi, 0x431
je 0x4044f8
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x40452d
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push dword [ebp - 0x10f0]
push edi
call fcn.00404dc0
add esp, 8
test al, al
jne 0x40452b
call ebx
mov esi, eax
mov eax, dword [ebp - 0x10f4]
cmp esi, 0x20
je 0x404495
cmp esi, 0x3e5
jne 0x40452d
jmp 0x404495
xor esi, esi
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
test esi, esi
je 0x4045ac
call ebx
mov esi, eax
call fcn.00403060
cmp esi, 2
jne 0x4045bf
push dword [ebp + 0x30]
mov esi, dword [ebp - 0x10e4]
lea eax, [ebp - 0x20c]
push dword [ebp - 0x10f8]
push dword [ebp - 0x10fc]
push dword [ebp - 0x1100]
push dword [ebp - 0x10ec]
push dword [ebp - 0x10f0]
push dword [ebp - 0x10e8]
push dword [ebp - 0x1104]
push eax
push esi
push dword [ebp + 8]
call fcn.00404a30
add esp, 0x2c
test al, al
jne 0x404466
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004093c1
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov al, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004093c1
mov esp, ebp
pop ebp
ret
cmp byte [ebp + 0x30], 0
mov ebx, dword [ebp - 0x10e4]
je 0x4045f0
push ebx
push dword [ebp - 0x10e8]
push 0x45be48
push 2
call fcn.00413ed7
add esp, 4
push eax
call fcn.00402680
push esi
call fcn.004040a0
add esp, 0x14
xor esi, esi
cmp byte [ebp + 8], 0
je 0x404702
push 0xf003f
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, dword [ebp - 0x10f0]
mov ebx, eax
push edi
push ebx
call fcn.00404ee0
add esp, 8
push 0xf01ff
push edi
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov edi, eax
test edi, edi
je 0x40463c
push edi
call dword [sym.imp.ADVAPI32.dll_DeleteService]
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea eax, [ebp - 0x10f4]
mov dword [ebp - 0x10f4], 0x104
push eax
lea eax, [ebp - 0xb30]
push eax
call dword [sym.imp.KERNEL32.dll_GetComputerNameW]
mov ebx, dword [ebp - 0x10e4]
lea eax, [ebp - 0xb30]
push ebx
push eax
call fcn.00413875
add esp, 8
test eax, eax
jne 0x4046b0
push 0x104
lea eax, [ebp - 0x518]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea eax, [ebp - 0x518]
push 0x5c
push eax
call fcn.0040ab3b
add esp, 8
xor ecx, ecx
mov word [eax], cx
mov eax, 0x45b7b8
lea ecx, [ebp - 0x518]
jmp 0x4046b7
mov eax, 0x45bac8
mov ecx, ebx
mov edx, dword [ebp - 0x10ec]
push edx
push ecx
push eax
lea eax, [ebp - 0xd38]
push eax
call fcn.004020d0
mov ebx, dword [sym.imp.KERNEL32.dll_DeleteFileW]
add esp, 0x10
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
nop dword [eax + eax]
lea eax, [ebp - 0xd38]
push eax
call ebx
test eax, eax
jne 0x404702
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
jne 0x404702
push 0x64
call edi
inc esi
cmp esi, 0xa
jb 0x4046e0
cmp byte [0x46ab74], 0
je 0x404735
push dword [ebp - 0x10e4]
lea eax, [ebp - 0xf40]
push 0x45bab4
push eax
call fcn.004020d0
add esp, 0xc
lea eax, [ebp - 0xf40]
push 1
push 0
push eax
call sub.MPR.dll_WNetCancelConnection2W
mov ecx, dword [ebp - 4]
xor al, al
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004093c1
mov esp, ebp
pop ebp
ret