Function at 0x407cd0
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 + 0x1cb0]
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 0x407a02
push ebp
push edi
xor ebp, ebp
xor eax, eax
lea ecx, [esp + 0x10]
mov al, byte [esp + ebp + 0x18]
push eax
push 0x41a2d4
push ecx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
cmp ebp, 3
je 0x407a64
mov edi, 0x41a14c
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 0x407a17
lea eax, [esp + 0x44]
xor edi, edi
mov di, word [ebx + 0x1cb4]
push eax
push 0x202
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x407ab8
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 + 0x1a70]
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 + 0x1a80]
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 0x407b56
push eax
call sub.WS2_32.dll_closesocket
mov dword [ebx + 0x1a9c], 6
pop esi
pop ebx
add esp, 0x1c4
ret
mov dword [ebx + 0x1a6c], 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 0x407b9c
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 + 0x1cb6]
push eax
push str.com_d
push edi
call dword [sym.imp.MSVCRT.dll_sprintf]
mov ecx, dword [esi + 0x1cb8]
add esp, 0xc
lea edx, [esi + 0x1e0c]
lea eax, [esi + 0x1e00]
mov dword [esi + 0x1e04], ecx
push edx
push eax
mov ecx, esi
mov dword [eax], edi
mov byte [esi + 0x1e08], 0
mov byte [esi + 0x1e09], 8
mov byte [esi + 0x1e0a], 0
call fcn.00405250
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 [0x41a2ec]
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 [0x41a2e4]
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.00405180
mov edi, eax
cmp edi, 0xffffffff
jne 0x407c79
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [0x41a914]
push 0x10
push str.KHSimulator_Message
push edx
jmp 0x407c9f
lea eax, [esp + 0x28]
mov ecx, esi
push eax
call fcn.00405180
cmp eax, 0xffffffff
jne 0x407cb6
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x41a914]
push 0x10
push str.KHSimulator_Message
push ecx
mov ecx, esi
call sub.MFC42u.DLL_CWnd::MessageBoxW
mov dword [esi + 0x1a9c], 6
pop edi
pop esi
add esp, 0x40
ret
mov dword [esi + 0x1a98], edi
mov dword [esi + 0x1a94], eax
pop edi
pop esi
add esp, 0x40
ret
mov eax, dword [ecx + 0x1cac]
mov dword [ecx + 0x1a68], eax
dec eax
je 0x407cef
dec eax
je 0x407cea
dec eax
jne 0x407cf4
jmp 0x407c00
jmp 0x407b70
jmp 0x4079c0
ret