Function at 0x402f50
Capabilities:
Check if file exists
Create thread
Get hostname
Initialize winsock library
Resolve dns

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x8dc
mov eax, dword [0x42a130]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x8c4], eax
mov eax, dword [ebp + 0x1c]
push ebx
mov ebx, dword [ebp + 0x14]
mov dword [ebp - 0x8d0], eax
mov eax, dword [ebp + 0x20]
push esi
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x8d4], eax
mov eax, dword [ebp + 0x24]
push edi
mov edi, dword [ebp + 0x10]
mov dword [ebp - 0x8cc], eax
lea eax, [ebp - 0x8dc]
push eax
lea eax, [ebp - 0x720]
mov dword [ebp - 0x8dc], 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetComputerNameW]
lea eax, [ebp - 0x720]
push esi
push eax
call fcn.00406e6e
add esp, 8
test eax, eax
jne 0x403188
push str.Connecting_to_local_system...
mov byte [ebp - 0x8c8], 1
call fcn.00407f6a
add eax, 0x40
push eax
call fcn.004082af
add esp, 8
cmp byte [0x42b349], 0
jne 0x403007
lea eax, [ebp - 0x8b0]
push eax
push 0x202
call sub.WS2_32.dll_WSAStartup
mov byte [0x42b349], 1
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 - 0x8bc]
push eax
call fcn.004077f0
add esp, 0xc
lea eax, [ebp - 0x20c]
push 0x104
push eax
push 0xffffffffffffffff
push dword [ebp - 0x8bc]
call sub.WS2_32.dll_inet_ntoa
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ecx, dword [ebp + 0x30]
lea eax, [ebp - 0x20c]
push ecx
mov ecx, dword [ebp - 0x8cc]
push ecx
mov ecx, dword [ebp - 0x8d4]
push ecx
mov ecx, dword [ebp - 0x8d0]
push ecx
mov ecx, dword [ebp - 0x8c4]
push ecx
mov ecx, dword [ebp + 8]
push ebx
push edi
push dword [ebp - 0x8c8]
push eax
push esi
push ecx
call fcn.00403500
add esp, 0x2c
test al, al
je 0x40326f
call fcn.00402940
cmp byte [ebp - 0x8c8], 0
mov eax, str.local_system
cmove eax, esi
push eax
push edi
push str._rStarting__s_service_on__s...
call fcn.00407f6a
add eax, 0x40
push eax
call fcn.004082af
push dword [ebp - 0x8c4]
lea eax, [ebp - 0x518]
push str.__SystemRoot___s
push eax
call fcn.00407531
push dword [ebp + 0x28]
lea eax, [ebp - 0x518]
push eax
push ebx
push edi
push esi
call fcn.00402dd0
add esp, 0x30
test eax, eax
jne 0x403175
mov edi, edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x8d8], eax
call fcn.00402940
cmp dword [ebp - 0x8d8], 2
jne 0x403282
push dword [ebp + 0x30]
lea eax, [ebp - 0x20c]
push dword [ebp - 0x8cc]
push dword [ebp - 0x8d4]
push dword [ebp - 0x8d0]
push dword [ebp - 0x8c4]
push ebx
push edi
push dword [ebp - 0x8c8]
push eax
push esi
push dword [ebp + 8]
call fcn.00403500
add esp, 0x2c
test al, al
je 0x40326f
push dword [ebp + 0x28]
lea eax, [ebp - 0x518]
push eax
push ebx
push edi
push esi
call fcn.00402dd0
add esp, 0x14
test eax, eax
je 0x403100
pop edi
pop esi
mov al, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004077dc
mov esp, ebp
pop ebp
ret
lea edx, [ebp - 0x20c]
mov byte [ebp - 0x8c8], 0
mov ecx, esi
sub edx, esi
lea esp, [esp]
movzx eax, word [ecx]
lea ecx, [ecx + 2]
mov word [edx + ecx - 2], ax
test ax, ax
jne 0x4031a0
push esi
push str.Connecting_to__s...
call fcn.00407f6a
add eax, 0x40
push eax
call fcn.004082af
add esp, 0xc
cmp dword [ebp + 0x2c], 0xffffffff
je 0x403061
push 0x2c
call fcn.00407316
mov ecx, dword [ebp + 8]
push 0
push 0
mov byte [eax], cl
lea ecx, [ebp - 0x20c]
mov dword [eax + 8], ecx
mov ecx, dword [ebp - 0x8c4]
mov dword [eax + 0x18], ecx
mov ecx, dword [ebp - 0x8d0]
push eax
mov dword [eax + 0x1c], ecx
mov ecx, dword [ebp - 0x8d4]
mov dword [eax + 0x20], ecx
mov ecx, dword [ebp - 0x8cc]
push 0x403730
mov dword [eax + 0x24], ecx
mov ecx, dword [ebp + 0x30]
push 0
push 0
mov dword [eax + 4], esi
mov byte [eax + 0xc], 0
mov dword [eax + 0x10], edi
mov dword [eax + 0x14], ebx
mov byte [eax + 0x28], cl
call fcn.00408fe3
imul ecx, dword [ebp + 0x2c], 0x3e8
add esp, 0x1c
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0x102
jne 0x4030a5
push esi
push str._rTimeout_accessing__s._n
call fcn.00407f6a
add eax, 0x40
push eax
call fcn.004082af
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.004077dc
mov esp, ebp
pop ebp
ret
cmp byte [ebp + 0x30], 0
je 0x4032ab
push esi
push edi
push str._rCould_not_start__s_service_on__s:_n
call fcn.00407f6a
add eax, 0x40
push eax
call fcn.004082af
push dword [ebp - 0x8d8]
call fcn.00402ec0
add esp, 0x14
push dword [ebp - 0x8c4]
push ebx
push esi
push dword [ebp + 8]
call fcn.004032e0
mov ecx, dword [ebp - 4]
add esp, 0x10
xor ecx, ebp
xor al, al
pop edi
pop esi
pop ebx
call fcn.004077dc
mov esp, ebp
pop ebp
ret