Function at 0x46cb60
Capabilities:
Create tcp socket
Create udp socket
Read .ini file
Set socket configuration

Disassembly:
push 0xffffffffffffffff
push 0x4a8456
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x58
mov eax, dword [0x4cbba0]
xor eax, esp
mov dword [esp + 8], ecx
push edi
mov ecx, 0x4ccbd0
mov dword [esp + 0x58], eax
call fcn.00487ea0
mov eax, dword [0x4ccb50]
mov cl, byte [eax + 0x701]
test cl, cl
jne 0x46cba9
mov cl, byte [esp + 0x6c]
test cl, cl
je 0x46cc09
mov ecx, dword [0x4ca3ac]
cmp ecx, 0xffffffff
je 0x46cc2a
mov dl, byte [esp + 0x6c]
test dl, dl
jne 0x46cbcc
mov dx, word [0x4ccba8]
cmp dx, word [eax + 0x702]
je 0x46cc0f
push ecx
call fcn.0046ada0
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
add esp, 4
test al, al
jne 0x46cbe7
mov eax, dword [0x4ca3ac]
push eax
call edi
mov ecx, dword [0x4ccb4c]
mov dword [0x4ca3ac], 0xffffffff
call fcn.00463030
mov eax, dword [0x4ccb50]
mov ecx, dword [0x4ca3ac]
jmp 0x46cc15
mov ecx, dword [0x4ca3ac]
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
cmp ecx, 0xffffffff
je 0x46cc30
push 0x21
push ecx
call fcn.0046ae10
add esp, 8
jmp 0x46d187
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
mov ecx, dword [eax + 0x364]
push ebx
push ebp
push esi
push ecx
lea edx, [esp + 0x40]
push 0x4aef28
push edx
call dword [sym.imp.MSVCR71.dll_sprintf]
add esp, 0xc
call fcn.0046c2d0
mov ebp, eax
mov eax, dword [0x4ccb50]
mov cl, byte [eax + 0x701]
test cl, cl
je 0x46cc6f
mov bx, word [eax + 0x702]
jmp 0x46cd13
add eax, 0x18
push str.MachineInfo.cfg
push eax
lea eax, [esp + 0x18]
push eax
call fcn.004010a0
add esp, 0xc
mov ecx, eax
call dword [sym.imp.MFC71.DLL_ATL::CSimpleStringT::operator_char_const_]
mov esi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntA]
push eax
push 0
push str.lastbindtime
lea ecx, [esp + 0x48]
push ecx
call esi
lea ecx, [esp + 0x10]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
push 0
call dword [sym.imp.MSVCR71.dll__time64]
mov edx, dword [0x4ccb50]
push str.MachineInfo.cfg
add edx, 0x18
push edx
lea eax, [esp + 0x1c]
push eax
call fcn.004010a0
add esp, 0x10
mov ecx, eax
call dword [sym.imp.MFC71.DLL_ATL::CSimpleStringT::operator_char_const_]
push eax
push 0
push str.lastbindport
lea ecx, [esp + 0x48]
push ecx
call esi
lea ecx, [esp + 0x10]
mov ebx, eax
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
cmp bx, 0xfa0
jae 0x46cd0e
push 0x4e20
push 0xfa0
call fcn.00484290
add esp, 8
mov ebx, eax
mov eax, dword [0x4ccb50]
test ebp, ebp
je 0x46cd37
cmp bx, 0x1388
jb 0x46cd37
push 0x1387
push 0xdac
call fcn.00484290
mov ebx, eax
mov eax, dword [0x4ccb50]
add esp, 8
test eax, eax
je 0x46cd6a
lea edx, [eax + 0x26c]
mov eax, edx
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x46cd46
sub eax, esi
mov dword [esp + 0x14], eax
je 0x46cd6a
push edx
call fcn.0046be30
add esp, 4
test eax, eax
mov dword [esp + 0x10], 1
jne 0x46cd72
mov dword [esp + 0x10], 0
push 0
push 2
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x46d184
lea esp, [esp]
push 0
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
cmp esi, 0xffffffff
je 0x46cf08
mov eax, dword [0x4ccb50]
test eax, eax
mov word [esp + 0x2c], 2
mov dword [esp + 0x30], 0xffffffff
je 0x46cdfd
lea edx, [eax + 0x26c]
mov eax, edx
lea edi, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x46cdd0
sub eax, edi
mov dword [esp + 0x14], eax
je 0x46cdf7
mov eax, dword [esp + 0x10]
test eax, eax
je 0x46cdf7
push edx
call dword [sym.imp.WS2_32.dll_inet_addr]
cmp eax, 0xffffffff
mov dword [esp + 0x30], eax
jne 0x46ce0b
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
push 0
call dword [sym.imp.WS2_32.dll_htonl]
mov dword [esp + 0x30], eax
jmp 0x46ce11
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
mov al, byte [esp + 0x78]
test al, al
je 0x46ce1f
lea edx, [ebx + 2]
push edx
jmp 0x46ce20
push ebx
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x2e], ax
push 0x10
lea eax, [esp + 0x30]
push eax
push ebp
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
je 0x46cec5
mov eax, dword [0x4ccb50]
test eax, eax
mov word [esp + 0x2c], 2
mov dword [esp + 0x30], 0xffffffff
je 0x46ce92
lea edx, [eax + 0x26c]
mov eax, edx
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x46ce65
sub eax, edi
mov dword [esp + 0x14], eax
je 0x46ce8c
mov eax, dword [esp + 0x10]
test eax, eax
je 0x46ce8c
push edx
call dword [sym.imp.WS2_32.dll_inet_addr]
cmp eax, 0xffffffff
mov dword [esp + 0x30], eax
jne 0x46cea0
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
push 0
call dword [sym.imp.WS2_32.dll_htonl]
mov dword [esp + 0x30], eax
jmp 0x46cea6
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
push ebx
call dword [sym.imp.WS2_32.dll_htons]
push 0x10
lea ecx, [esp + 0x30]
push ecx
push esi
mov word [esp + 0x3a], ax
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
jne 0x46cf1a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2740
push ebp
jne 0x46cf10
call edi
push esi
call edi
push 0x4e20
push 0xfa0
call fcn.00484290
add esp, 8
push 0
push 2
push 2
mov ebx, eax
call dword [sym.imp.WS2_32.dll_socket]
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x46cd90
jmp 0x46d184
push ebp
call edi
jmp 0x46d184
call edi
push esi
call edi
jmp 0x46d184
mov edi, dword [sym.imp.WS2_32.dll_setsockopt]
push 4
lea edx, [esp + 0x28]
push edx
push 4
push 0xffff
push esi
mov dword [esp + 0x38], 1
call edi
mov eax, dword [esp + 0x18]
push eax
push ebp
mov dword [0x4ca3ac], ebp
call fcn.0046b160
push esi
push 4
call fcn.0046b0b0
mov ecx, dword [0x4ccb4c]
add esp, 0x10
push 0xa
lea eax, [esp + 0x54]
mov dword [ecx + 4], esi
mov edx, dword [0x4ccb4c]
push eax
push 0
mov word [edx + 8], bx
call dword [sym.imp.MSVCR71.dll_time]
add esp, 4
push eax
call dword [sym.imp.MSVCR71.dll__ultoa]
mov ecx, dword [0x4ccb50]
push str.MachineInfo.cfg
add ecx, 0x18
push ecx
lea edx, [esp + 0x24]
push edx
call fcn.004010a0
add esp, 0x18
mov ecx, eax
call dword [sym.imp.MFC71.DLL_ATL::CSimpleStringT::operator_char_const_]
mov esi, dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
push eax
lea eax, [esp + 0x54]
push eax
push str.lastbindtime
lea ecx, [esp + 0x48]
push ecx
call esi
lea ecx, [esp + 0x10]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
push 0xa
lea edx, [esp + 0x54]
movzx eax, bx
push edx
push eax
call dword [sym.imp.MSVCR71.dll__itoa]
mov ecx, dword [0x4ccb50]
push str.MachineInfo.cfg
add ecx, 0x18
push ecx
lea edx, [esp + 0x28]
push edx
call fcn.004010a0
add esp, 0x18
mov ecx, eax
call dword [sym.imp.MFC71.DLL_ATL::CSimpleStringT::operator_char_const_]
push eax
lea eax, [esp + 0x54]
push eax
push str.lastbindport
lea ecx, [esp + 0x48]
push ecx
call esi
lea ecx, [esp + 0x14]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
mov ebx, 1
push 4
lea edx, [esp + 0x24]
mov dword [esp + 0x24], 0x3e8000
mov dword [esp + 0x2c], ebx
push edx
mov eax, dword [0x4ca3ac]
push 0x1002
push 0xffff
push eax
call edi
mov edx, dword [0x4ca3ac]
lea ecx, [esp + 0x28]
push ecx
push 0x8004667e
push edx
call dword [sym.imp.WS2_32.dll_ioctlsocket]
mov esi, dword [esp + 0x18]
mov ecx, esi
call fcn.0046c460
mov ecx, esi
call fcn.0046c1d0
mov ecx, dword [0x4ccbac]
test ecx, ecx
je 0x46d092
call fcn.00469d30
mov ecx, dword [0x4ccbac]
test ecx, ecx
je 0x46d08a
mov eax, dword [ecx]
push ebx
call dword [eax + 0x10]
xor ecx, ecx
mov dword [0x4ccbac], ecx
mov al, byte [esp + 0x7c]
test al, al
je 0x46d139
mov edi, dword [0x4ccb50]
mov edx, dword [edi + 0x548]
add edi, 0x544
shr edx, 0xb
and dl, 1
mov byte [esp + 0x1f], dl
je 0x46d139
mov al, byte [edi + 0x200]
test al, al
jne 0x46d139
test ecx, ecx
jne 0x46d111
push 0x58
call sub.MFC71.DLL_operator_new_1
add esp, 4
mov dword [esp + 0x18], eax
test eax, eax
mov dword [esp + 0x70], 0
je 0x46d0ee
push ebx
mov ecx, eax
call fcn.0046a260
jmp 0x46d0f0
xor eax, eax
test esi, esi
mov dword [esp + 0x70], 0xffffffff
mov dword [0x4ccbac], eax
je 0x46d106
lea ecx, [esi + 0xc]
jmp 0x46d108
xor ecx, ecx
mov dword [eax + 0x54], ecx
mov ecx, dword [0x4ccbac]
call fcn.00469d30
mov ecx, dword [0x4ccbac]
xor eax, eax
mov ax, word [0x4ccba8]
add edi, 0x204
push eax
push 0
push edi
call fcn.00469d60
mov ecx, dword [0x4ccbac]
test ecx, ecx
jne 0x46d184
mov eax, dword [0x4ccbb0]
test eax, eax
jne 0x46d184
mov ecx, dword [0x4ca3ac]
push ecx
call fcn.0046ad40
mov eax, dword [0x4cd32c]
add esp, 4
test eax, eax
jne 0x46d184
push 0x70
call sub.MFC71.DLL_operator_new_1
add esp, 4
mov dword [esp + 0x14], eax
test eax, eax
mov dword [esp + 0x70], ebx
je 0x46d17d
mov ecx, eax
call fcn.00483aa0
jmp 0x46d17f
xor eax, eax
mov dword [0x4cd32c], eax
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x5c]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x58]
pop edi
xor ecx, esp
call fcn.004a17d1
add esp, 0x64
ret 8