Function at 0x4344f0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Resolve dns
Set socket configuration

Disassembly:
sub esp, 0x88
mov ax, word [0x7c511c]
push ebx
push ebp
push esi
push edi
push eax
mov word [esp + 0x28], 2
call sub.WSOCK32.dll_htons
mov word [esp + 0x26], ax
mov al, byte [0x73829e]
test al, al
jne 0x43455d
push 0xc7
push str.Looking_up_servers_hostname...
push 0x7c5c74
call fcn.00497920
mov ecx, dword [0x716648]
mov ebx, dword [sym.imp.USER32.dll_PostMessageA]
add esp, 0xc
mov byte [0x7c5d3b], 0
push 0
push 0
push 0x400
push ecx
call ebx
mov ebp, dword [sym.imp.KERNEL32.dll_Sleep]
push 0
call ebp
jmp 0x434569
mov ebx, dword [sym.imp.USER32.dll_PostMessageA]
mov ebp, dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [0x7c5114]
push edx
call sub.WSOCK32.dll_inet_addr
cmp eax, 0xffffffff
jne 0x4345d1
mov eax, dword [0x7c5114]
push eax
call sub.WSOCK32.dll_gethostbyname
test eax, eax
je 0x4345a6
movsx ecx, word [eax + 0xa]
mov edx, dword [eax + 0xc]
mov eax, ecx
lea edi, [esp + 0x28]
mov esi, dword [edx]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x4345d5
push 0xc7
push str.Unable_to_look_up_servers_IP_address_from_hostname._n_nUnknown_hostname_or_may_be_your_nameserver_isnt_set_nup_correctly_
push 0x7c5d3c
call fcn.00497920
add esp, 0xc
mov byte [0x7c5e03], 0
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x88
ret
mov dword [esp + 0x28], eax
mov al, byte [0x73829e]
test al, al
jne 0x434612
push 0xc7
push str.Creating_network_socket...
push 0x7c5c74
call fcn.00497920
mov ecx, dword [0x716648]
add esp, 0xc
mov byte [0x7c5d3b], 0
push 0
push 0
push 0x400
push ecx
call ebx
push 0
call ebp
push 0
push 1
push 2
call sub.WSOCK32.dll_socket
mov dword [0x7c5110], eax
mov eax, dword [0x7c5110]
test eax, eax
jge 0x434656
push 0xc7
push str.Creating_network_socket_failed.
push 0x7c5d3c
call fcn.00497920
add esp, 0xc
mov byte [0x7c5e03], 0
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x88
ret
mov al, byte [0x73829e]
test al, al
jne 0x434693
push 0xc7
push str.Trying_to_connect_to_Snes9X_server...
push 0x7c5c74
call fcn.00497920
mov edx, dword [0x716648]
add esp, 0xc
mov byte [0x7c5d3b], 0
push 0
push 0
push 0x400
push edx
call ebx
push 0
call ebp
lea eax, [esp + 0x24]
push 0x10
push eax
mov ecx, dword [0x7c5110]
push ecx
call sub.WSOCK32.dll_connect
test eax, eax
jge 0x4346fe
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x274d
jne 0x4346e1
push 0xc7
push str.Connection_to_remote_server_socket_refused:_n_nIs_there_actually_a_Snes9X_NetPlay_server_running_non_the_remote_machine_on_this_port_
push 0x7c5d3c
call fcn.00497920
add esp, 0xc
mov byte [0x7c5e03], 0
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x88
ret
call sub.WSOCK32.dll_WSAGetLastError
push eax
lea edx, [esp + 0x38]
push str.Connection_to_server_failed_with_error_number__d
push edx
call fcn.00496365
add esp, 0xc
jmp 0x434bc6
mov byte [0x7c50fa], 1
mov al, byte [0x73829e]
test al, al
jne 0x434742
push 0xc7
push str.Sending_HELLO_message...
push 0x7c5c74
call fcn.00497920
mov ecx, dword [0x716648]
add esp, 0xc
mov byte [0x7c5d3b], 0
push 0
push 0
push 0x400
push ecx
call ebx
push 0
call ebp
mov edi, dword [0x7c5118]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebx, ecx
add ebx, 0xc
push ebx
call fcn.00497380
mov ebp, eax
mov byte [ebp], 0x43
lea eax, [ebp + 1]
mov dl, byte [0x7c50f8]
mov byte [eax], dl
inc eax
mov cl, byte [0x7c50f8]
inc cl
mov byte [0x7c50f8], cl
mov byte [eax], 0
mov edx, ebx
inc eax
sar edx, 0x18
mov byte [eax], dl
mov ecx, ebx
mov edx, ebx
mov byte [eax + 3], bl
sar ecx, 0x10
sar edx, 8
mov byte [eax + 1], cl
mov byte [eax + 2], dl
mov ecx, dword [0x738248]
add eax, 4
push ebx
push ebp
lea ecx, [ecx + ecx*4]
lea ecx, [ecx + ecx*4]
lea ecx, [ecx + ecx*4]
shl ecx, 3
mov edx, ecx
mov byte [eax + 3], cl
shr edx, 0x18
mov byte [eax], dl
mov edx, ecx
shr edx, 0x10
mov byte [eax + 1], dl
mov edx, ecx
shr edx, 8
mov byte [eax + 2], dl
mov edi, dword [0x7c5118]
lea edx, [eax + 4]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [0x7c5110]
push ecx
call fcn.00435c80
add esp, 0x10
test al, al
jne 0x43485d
push 0xc7
push str.Sending_HELLO_message_failed.
push 0x7c5d3c
call fcn.00497920
add esp, 0xc
mov byte [0x7c5e03], 0
mov edx, dword [0x7c5110]
push edx
call sub.WSOCK32.dll_closesocket
mov dword [0x7c5110], 0xffffffff
mov byte [0x7c50fa], 0
push ebp
mov byte [0x73829d], 0
call fcn.00496b6b
add esp, 4
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x88
ret
push ebp
call fcn.00496b6b
mov al, byte [0x73829e]
add esp, 4
test al, al
jne 0x4348ae
push 0xc7
push str.Waiting_for_HELLO_reply_from_server...
push 0x7c5c74
call fcn.00497920
mov eax, dword [0x716648]
mov ebx, dword [sym.imp.USER32.dll_PostMessageA]
add esp, 0xc
mov byte [0x7c5d3b], 0
push 0
push 0
push 0x400
push eax
call ebx
push 0
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x4348b4
mov ebx, dword [sym.imp.USER32.dll_PostMessageA]
lea ecx, [esp + 0x18]
push 7
push ecx
mov edx, dword [0x7c5110]
push edx
call fcn.00435d10
add esp, 0xc
test al, al
je 0x434ba8
cmp byte [esp + 0x18], 0x53
jne 0x434ba8
mov al, byte [esp + 0x19]
test al, al
jne 0x434ba8
test byte [esp + 0x1a], 0x1f
jne 0x434ba8
mov esi, dword [esp + 0x1b]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x1d]
and esi, 0xff
mov edx, dword [esp + 0x1e]
and eax, 0xff
shl esi, 8
or esi, eax
and ecx, 0xff
shl esi, 8
or esi, ecx
and edx, 0xff
shl esi, 8
or esi, edx
cmp esi, 0x100
jg 0x434ba8
push esi
call fcn.00497380
add esi, 0xfffffff9
mov edi, eax
push esi
push edi
mov ecx, dword [0x7c5110]
push ecx
call fcn.00435d10
add esp, 0x10
test al, al
jne 0x434986
push 0xc7
push str.Error_in_HELLO_reply_packet_received_from_server.
push 0x7c5d3c
call fcn.00497920
push edi
mov byte [0x7c5e03], 0
call fcn.00496b6b
add esp, 0x10
mov edx, dword [0x7c5110]
push edx
jmp 0x434bcc
cmp byte [edi], 0xa
je 0x4349b4
push 0xc7
push str.The_Snes9X_NetPlay_server_implements_a_different_nversion_of_the_protocol._Disconnecting.
push 0x7c5d3c
call fcn.00497920
push edi
mov byte [0x7c5e03], 0
call fcn.00496b6b
add esp, 0x10
jmp 0x434bc6
xor ecx, ecx
xor edx, edx
mov ch, byte [edi + 2]
mov dl, byte [edi + 4]
mov cl, byte [edi + 3]
xor eax, eax
mov al, byte [edi + 5]
shl ecx, 8
or ecx, edx
shl ecx, 8
or ecx, eax
mov al, byte [esp + 0x1a]
test al, 0x80
mov dword [0x7c5c68], ecx
jne 0x434a63
mov esi, dword [0x7c5118]
lea ebp, [edi + 6]
mov eax, ebp
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x434a11
test cl, cl
je 0x434a0d
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x434a11
add eax, 2
add esi, 2
test cl, cl
jne 0x4349ed
xor eax, eax
jmp 0x434a16
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x434a63
mov byte [0x7c510b], 0
mov eax, dword [0x7c510c]
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov ecx, dword [0x716648]
push ebp
push ebp
push 0x403
push ecx
call ebx
mov edx, dword [0x7c510c]
push 0xffffffffffffffff
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov al, byte [0x7c510b]
test al, al
jne 0x434a63
push edi
call fcn.00496b6b
add esp, 4
jmp 0x434bc6
mov cl, byte [edi + 1]
mov byte [0x7c50fc], cl
push edi
call fcn.00496b6b
add esp, 4
mov byte [0x7c5108], 1
mov byte [0x73829d], 1
mov dword [0x7c5120], 0
mov dword [0x7c5124], 0x77
mov ecx, 0x258
xor eax, eax
mov edi, 0x7c5128
rep stosd dword es:[edi], eax
mov byte [0x7c50f9], 1
mov al, byte [0x73829e]
test al, al
jne 0x434aed
push 0xc7
push str.Sending_READY_to_the_server...
push 0x7c5c74
call fcn.00497920
mov edx, dword [0x716648]
add esp, 0xc
mov byte [0x7c5d3b], 0
push 0
push 0
push 0x400
push edx
call ebx
push 0
call dword [sym.imp.KERNEL32.dll_Sleep]
mov byte [esp + 0x10], 0x43
mov al, byte [0x7c50f8]
mov byte [esp + 0x11], al
mov cl, byte [0x7c50f8]
inc cl
mov byte [0x7c50f8], cl
mov dl, byte [esp + 0x1a]
and dl, 0x80
lea eax, [esp + 0x10]
neg dl
sbb dl, dl
push 7
and dl, 3
mov byte [esp + 0x17], 0
add dl, 8
mov byte [esp + 0x18], 0
mov byte [esp + 0x16], dl
mov byte [esp + 0x19], 0
mov byte [esp + 0x1a], 7
push eax
mov ecx, dword [0x7c5110]
push ecx
call fcn.00435c80
add esp, 0xc
test al, al
jne 0x434b9b
mov edx, dword [0x7c5110]
push edx
call sub.WSOCK32.dll_closesocket
mov dword [0x7c5110], 0xffffffff
mov byte [0x7c50fa], 0
push 0xc7
push str.Sending_READY_message_failed.
push 0x7c5d3c
mov byte [0x73829d], 0
call fcn.00497920
add esp, 0xc
mov byte [0x7c5e03], 0
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x88
ret
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x88
ret
push 0xc7
push str.Error_in_HELLO_reply_packet_received_from_server.
push 0x7c5d3c
call fcn.00497920
add esp, 0xc
mov byte [0x7c5e03], 0
mov eax, dword [0x7c5110]
push eax
call sub.WSOCK32.dll_closesocket
mov dword [0x7c5110], 0xffffffff
mov byte [0x7c50fa], 0
pop edi
pop esi
pop ebp
mov byte [0x73829d], 0
xor al, al
pop ebx
add esp, 0x88
ret