Function at 0x405510
Capabilities:
Initialize winsock library
Terminate process

Disassembly:
sub esp, 0x1c4
push ebx
mov ebx, ecx
xor eax, eax
xor ecx, ecx
mov dword [esp + 0x25], ecx
push esi
mov dword [esp + 0x2d], ecx
mov esi, dword [ebx + 0x1ad0]
mov dword [esp + 0x31], ecx
mov byte [esp + 0x10], 0
mov dword [esp + 0x35], ecx
mov dword [esp + 0x11], eax
mov word [esp + 0x39], cx
mov byte [esp + 0x28], al
mov byte [esp + 0x3b], cl
mov byte [esp + 8], cl
mov dword [esp + 9], eax
mov edx, esi
sar edx, cl
add ecx, 8
inc eax
cmp ecx, 0x20
mov byte [esp + eax + 0xf], dl
jl 0x405242
push ebp
push edi
xor ebp, ebp
xor eax, eax
lea ecx, [esp + 0x10]
mov al, byte [esp + ebp + 0x18]
push eax
push 0x416158
push ecx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
cmp ebp, 3
je 0x4052a4
mov edi, 0x416154
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x10]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x10]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x30]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
inc ebp
cmp ebp, 4
rep movsb byte es:[edi], byte [esi]
jl 0x405257
lea eax, [esp + 0x44]
xor edi, edi
mov di, word [ebx + 0x1ad4]
push eax
push 0x202
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x4052f8
call sub.WS2_32.dll_WSACleanup
xor esi, esi
lea ecx, [esp + 0x30]
mov dword [esp + 0x20], esi
push ecx
mov dword [esp + 0x28], esi
mov word [esp + 0x24], 2
call sub.WS2_32.dll_inet_addr
push edi
mov ebp, eax
call sub.WS2_32.dll_htons
mov word [esp + 0x22], ax
mov eax, dword [esp + 0x20]
lea edx, [ebx + 0x1890]
mov dword [esp + 0x20], esi
push esi
mov dword [esp + 0x28], esi
mov dword [edx], eax
mov word [esp + 0x24], 2
mov dword [edx + 4], ebp
mov dword [edx + 8], esi
mov dword [edx + 0xc], esi
call sub.WS2_32.dll_htonl
push edi
mov ebp, eax
call sub.WS2_32.dll_htons
mov word [esp + 0x22], ax
mov edx, dword [esp + 0x20]
lea ecx, [ebx + 0x18a0]
push esi
push 2
push 2
mov dword [ecx], edx
mov dword [ecx + 4], ebp
mov dword [ecx + 8], esi
mov dword [ecx + 0xc], esi
call sub.WS2_32.dll_socket
pop edi
cmp eax, 0xffffffff
pop ebp
jne 0x405396
push eax
call sub.WS2_32.dll_closesocket
mov dword [ebx + 0x18bc], 6
pop esi
pop ebx
add esp, 0x1c4
ret
mov dword [ebx + 0x188c], eax
pop esi
pop ebx
add esp, 0x1c4
ret
push esi
push edi
push 1
mov esi, ecx
push 0x104
call dword [sym.imp.MSVCRT.dll_calloc]
mov edi, eax
add esp, 8
test edi, edi
jne 0x4053dc
push eax
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
push 1
call dword [sym.imp.MSVCRT.dll_exit]
xor eax, eax
mov ax, word [esi + 0x1ad6]
push eax
push str.com_d
push edi
call dword [sym.imp.MSVCRT.dll_sprintf]
mov ecx, dword [esi + 0x1ad8]
add esp, 0xc
lea edx, [esi + 0x1c10]
lea eax, [esi + 0x1c04]
mov dword [esi + 0x1c08], ecx
push edx
push eax
mov ecx, esi
mov dword [eax], edi
mov byte [esi + 0x1c0c], 0
mov byte [esi + 0x1c0d], 8
mov byte [esi + 0x1c0e], 0
call fcn.00402c40
push 0
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
pop edi
pop esi
ret
sub esp, 0x40
mov eax, dword [str.PIPE0]
push esi
mov esi, ecx
push edi
mov cx, word [0x416170]
mov dword [esp + 0x28], eax
mov word [esp + 0x2c], cx
mov ecx, 6
xor eax, eax
lea edi, [esp + 0x2e]
rep stosd dword es:[edi], eax
mov edx, dword [str.PIPE1]
mov ecx, 6
stosw word es:[edi], ax
mov ax, word [0x416168]
lea edi, [esp + 0xe]
mov word [esp + 0xc], ax
xor eax, eax
mov dword [esp + 8], edx
rep stosd dword es:[edi], eax
lea ecx, [esp + 8]
push ecx
mov ecx, esi
stosw word es:[edi], ax
call fcn.00402b70
mov edi, eax
cmp edi, 0xffffffff
jne 0x4054b9
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [0x4167cc]
push 0x10
push str.EVSimulator_Message
push edx
jmp 0x4054df
lea eax, [esp + 0x28]
mov ecx, esi
push eax
call fcn.00402b70
cmp eax, 0xffffffff
jne 0x4054f6
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x4167cc]
push 0x10
push str.EVSimulator_Message
push ecx
mov ecx, esi
call sub.MFC42u.DLL_CWnd::MessageBoxW
mov dword [esi + 0x18bc], 6
pop edi
pop esi
add esp, 0x40
ret
mov dword [esi + 0x18b8], edi
mov dword [esi + 0x18b4], eax
pop edi
pop esi
add esp, 0x40
ret
mov eax, dword [ecx + 0x1acc]
mov dword [ecx + 0x1888], eax
dec eax
je 0x40552f
dec eax
je 0x40552a
dec eax
jne 0x405534
jmp 0x405440
jmp 0x4053b0
jmp 0x405200
ret