Function at 0x407d20
Capabilities:
Get session user name
Get socket status
Receive data
Receive data on socket
Resolve function by parsing pe exports
Send data
Send data on socket

Disassembly:
sub esp, 0x8e4
push ebx
push ebp
push esi
lea eax, [esp + 0x48]
push edi
xor ebx, ebx
xor ebp, ebp
push eax
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], ebp
xor esi, esi
call fcn.0040fd30
add esp, 4
test eax, eax
je 0x407d59
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x8e4
ret
push 0x11
push 2
push 2
call fcn.00411570
add esp, 0xc
cmp eax, 0xffffffff
mov dword [0x4217e8], eax
jne 0x407dbf
mov eax, dword [0x422894]
test eax, eax
je 0x407d9b
push str.Server_socket_open_failed_n
push 0
call fcn.004102d0
call fcn.004117c0
push eax
push str.socket:_winsock_error_code_:__ld_n
push 0
call fcn.004102d0
add esp, 0x14
push 0xac
push str.spnsrvnt.c
push 0x3f
call fcn.004130f0
mov ebp, 1
add esp, 0xc
mov dword [esp + 0x20], ebp
mov esi, 0x3f
jmp 0x407ddf
mov eax, dword [0x426498]
push 1
or al, 1
push 0x426478
push 0x431620
mov dword [0x426498], eax
call fcn.00410440
add esp, 0xc
mov eax, dword [0x422894]
test eax, eax
je 0x407dfa
test ebp, ebp
jne 0x407dfa
push str.Opened_Server_socket_n
push ebp
call fcn.004102d0
add esp, 8
push 0x3e8
push 2
push 6
call fcn.00411570
add esp, 0xc
cmp eax, 0xffffffff
mov dword [0x4217e4], eax
jne 0x407e63
mov eax, dword [0x422894]
test eax, eax
je 0x407e3f
push str.Server_IPX_socket_open_failed_n
push 0
call fcn.004102d0
call fcn.004117c0
push eax
push str.IPX_socket:__ld_n
push 0
call fcn.004102d0
add esp, 0x14
push 0xc2
push str.spnsrvnt.c
push 0x3f
call fcn.004130f0
mov ebx, 1
add esp, 0xc
mov dword [esp + 0x1c], ebx
mov esi, 0x3f
jmp 0x407e6f
mov eax, dword [0x426498]
or al, 2
mov dword [0x426498], eax
mov eax, dword [0x422894]
mov edi, dword [esp + 0x8f8]
test eax, eax
je 0x407e93
test ebp, ebp
jne 0x407e93
push str.Opened_Server_IPX_socket_n
push ebp
call fcn.004102d0
add esp, 8
jmp 0x407eb5
cmp ebp, 1
jne 0x407ead
cmp ebx, ebp
jne 0x407fbf
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8e4
ret
test ebp, ebp
jne 0x407fbf
xor ecx, ecx
push edi
mov dword [esp + 0x2c], ecx
mov word [esp + 0x2c], 2
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], ecx
call sub.WSOCK32.dll_htons
mov word [esp + 0x2a], ax
mov eax, dword [0x422894]
test eax, eax
je 0x407efc
mov edx, dword [esp + 0x2a]
and edx, 0xffff
push edx
push str.Server_will_run_on_port__d_n
push 0
call fcn.004102d0
add esp, 0xc
push 0
call fcn.00411640
mov ecx, dword [0x4217e8]
add esp, 4
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x28]
push 0x10
push eax
push ecx
call sub.WSOCK32.dll_bind
test eax, eax
mov eax, dword [0x422894]
jge 0x407fac
test eax, eax
je 0x407f4f
push str.Server_couldnt_bind_to_socket_n
push 0
call fcn.004102d0
call fcn.004117c0
push eax
push str.bind:_winsock_error_code_:__ld_n
push 0
call fcn.004102d0
add esp, 0x14
call fcn.00414320
mov esi, eax
call fcn.004117c0
cmp eax, 0x2740
mov dword [esi], eax
jne 0x407f88
push 0xec
push str.spnsrvnt.c
push 0x74
call fcn.004130f0
add esp, 0xc
mov eax, 0x74
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8e4
ret
push 0xf0
push str.spnsrvnt.c
push 0x6e
call fcn.004130f0
add esp, 0xc
mov eax, 0x6e
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8e4
ret
test eax, eax
je 0x407fbf
push str.Bound_Server_Socket_n
push 0
call fcn.004102d0
add esp, 8
test ebx, ebx
jne 0x4080e9
xor edx, edx
push edi
mov dword [esp + 0x3c], edx
mov word [esp + 0x3c], 6
mov dword [esp + 0x40], edx
mov dword [esp + 0x44], edx
mov word [esp + 0x48], dx
call fcn.00411610
mov word [esp + 0x48], ax
mov eax, dword [0x422894]
add esp, 4
test eax, eax
je 0x408010
mov eax, dword [esp + 0x44]
and eax, 0xffff
push eax
push str.Server_will_run_on_IPX_socket__u_n
push ebx
call fcn.004102d0
add esp, 0xc
mov edx, dword [0x4217e4]
lea ecx, [esp + 0x38]
push 0xe
push ecx
push edx
call fcn.004115a0
add esp, 0xc
cmp eax, 0xffffffff
jne 0x4080c2
mov eax, dword [0x422894]
test eax, eax
je 0x408059
push str.Server_couldnt_bind_to_IPX_socket_n
push 0
call fcn.004102d0
call fcn.004117c0
push eax
push str.IPX_bind:__ld_n
push 0
call fcn.004102d0
add esp, 0x14
call fcn.00414320
mov esi, eax
call fcn.004117c0
cmp eax, 0x2740
mov dword [esi], eax
jne 0x408089
push 0x10e
push str.spnsrvnt.c
push 0x74
call fcn.004130f0
add esp, 0xc
mov esi, 0x74
jmp 0x4080a2
push 0x112
push str.spnsrvnt.c
push 0x6e
call fcn.004130f0
add esp, 0xc
mov esi, 0x6e
test ebp, ebp
jne 0x407ea0
mov eax, dword [0x4217e8]
push eax
call sub.WSOCK32.dll_closesocket
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x8e4
ret
push 0x1e
push 0x426458
call fcn.00410740
mov eax, dword [0x422894]
add esp, 8
test eax, eax
je 0x4080e9
push str.Bound_Server_IPX_Socket_n
push 0
call fcn.004102d0
add esp, 8
cmp ebp, 1
jne 0x408113
mov edi, 0x426458
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, 0x431620
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push 0x426454
call fcn.0040f0f0
push 0
push 0
push 0x40000004
call fcn.00401cc0
add esp, 0x10
lea eax, [esp + 0x14]
lea ecx, [esp + 0x3b0]
mov byte [esp + 0x3b0], 0
push eax
push ecx
mov dword [esp + 0x1c], 0x40
call dword [sym.imp.ADVAPI32.dll_GetUserNameA]
call fcn.0040f750
lea edx, [esp + 0x814]
push edx
push 0
push eax
lea eax, [esp + 0x3bc]
push eax
push 0x431620
push 0
push 0
push 5
call fcn.00411d30
lea ecx, [esp + 0x834]
push ecx
call fcn.00410070
add esp, 0x24
mov ebp, dword [esp + 0x14]
mov eax, dword [0x422894]
test eax, eax
je 0x4081a5
push str.Waiting_for_connections_n
push 0
call fcn.004102d0
add esp, 8
mov ecx, 0x68
xor eax, eax
lea edi, [esp + 0x70]
mov dword [esp + 0x24], 0x10
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x1c]
mov dword [esp + 0x3f0], eax
test edi, edi
jne 0x4081e2
mov edx, dword [0x4217e4]
mov eax, 1
mov dword [esp + 0x3f4], edx
mov dword [esp + 0x3f0], eax
mov esi, dword [esp + 0x20]
mov ecx, dword [0x4217e8]
test esi, esi
jne 0x40820b
cmp eax, 0x40
jae 0x40820b
mov dword [esp + eax*4 + 0x3f4], ecx
mov eax, dword [esp + 0x3f0]
inc eax
mov dword [esp + 0x3f0], eax
mov eax, dword [0x4217ec]
lea edx, [esp + 0x58]
mov dword [esp + 0x58], eax
push edx
push 0
lea eax, [esp + 0x3f8]
push 0
inc ecx
push eax
push ecx
mov dword [esp + 0x70], 0
call sub.WSOCK32.dll_select
cmp eax, 0xffffffff
je 0x408a24
test eax, eax
je 0x4089d3
test esi, esi
jne 0x40826d
test edi, edi
jne 0x408277
mov edx, dword [0x4217e4]
lea ecx, [esp + 0x3f0]
push ecx
push edx
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x408277
mov edx, dword [0x4217e4]
jmp 0x40827d
mov edx, dword [0x4217e4]
test edi, edi
je 0x40827d
mov edx, dword [0x4217e8]
mov ecx, 0x68
xor eax, eax
lea edi, [esp + 0x210]
mov dword [0x431660], edx
rep stosd dword es:[edi], eax
lea eax, [esp + 0x24]
lea ecx, [esp + 0x60]
push eax
push ecx
push 0
lea eax, [esp + 0x21c]
push 0x1a0
push eax
push edx
call sub.WSOCK32.dll_recvfrom
mov ebx, eax
test ebx, ebx
jge 0x4082cd
call fcn.004117c0
cmp eax, 0x2738
jne 0x40841e
mov ebx, 0x1a0
mov eax, dword [0x422894]
test eax, eax
je 0x4082e5
push str.Got_a_message_n
push 0
call fcn.004102d0
add esp, 8
mov ecx, 0x68
xor eax, eax
lea edi, [esp + 0x70]
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x210]
push ecx
call fcn.00411670
mov edx, dword [esp + 0x218]
mov dword [esp + 0x74], eax
push edx
call fcn.00411670
mov dword [esp + 0x7c], eax
mov eax, dword [esp + 0x220]
push eax
call fcn.00411670
mov ecx, dword [esp + 0x228]
mov dword [esp + 0x84], eax
push ecx
call fcn.00411670
mov dword [esp + 0x8c], eax
lea edi, [esp + 0x230]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x10
lea edx, [esp + 0x80]
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
mov eax, dword [0x422894]
and ecx, 3
test eax, eax
rep movsb byte es:[edi], byte [esi]
je 0x4083e3
push str.Message_Received._Contents:__n
push 0
call fcn.004102d0
mov ecx, dword [esp + 0x7c]
push ecx
push str._t_Seq_Num_t_t__d_n
push 0
call fcn.004102d0
mov edx, dword [esp + 0x84]
push edx
push str._t_Msg_Ver_t_t_d_n
push 0
call fcn.004102d0
mov eax, dword [esp + 0x98]
push eax
push str._t_Code_Seq_t_t_d_n
push 0
call fcn.004102d0
mov ecx, dword [esp + 0xa8]
push ecx
push str._t_Client_Pid_t_t_d_n
push 0
call fcn.004102d0
lea edx, [esp + 0xb8]
push edx
push str._t_Info_t_t_t__s_n
push 0
call fcn.004102d0
add esp, 0x44
cmp dword [esp + 0x7c], 0xffffffff
jne 0x4085f4
mov eax, dword [0x431660]
mov ecx, 0x64
lea esi, [esp + 0x80]
lea edi, [esp + 0x4f4]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [0x4217e4]
mov dword [esp + 0x10], 5
cmp eax, ecx
jne 0x408456
push 2
jmp 0x408458
mov eax, dword [0x422894]
test eax, eax
je 0x4081a5
call fcn.004117c0
push eax
push str.recvfrom_failed:__winsock_error_code_:__ld_n
push 0
call fcn.004102d0
push 0x1ba
push str.spnsrvnt.c
push 0x70
call fcn.004130f0
add esp, 0x18
jmp 0x40818d
push 1
call fcn.00406cf0
add esp, 4
lea ecx, [esp + 0x18]
lea edx, [esp + 0x4c]
push ecx
push edx
push str.myServerProcLck
call fcn.0040f2d0
add esp, 0xc
test eax, eax
je 0x408494
push 0x1f6
push str.spnsrvnt.c
push 0x72
call fcn.004130f0
add esp, 0xc
jmp 0x40818d
lea eax, [esp + 0x10]
lea ecx, [esp + 0x684]
push eax
lea edx, [esp + 0x4f8]
push ecx
push edx
call fcn.00402f50
mov eax, dword [esp + 0x1c]
add esp, 0xc
cmp eax, 1
jne 0x4085ca
mov ecx, 0x64
lea esi, [esp + 0x684]
lea edi, [esp + 0x80]
xor eax, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, 0x68
lea edi, [esp + 0x210]
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x70]
push eax
call fcn.00411640
mov ecx, dword [esp + 0x78]
mov dword [esp + 0x214], eax
push ecx
call fcn.00411640
mov edx, dword [esp + 0x80]
mov dword [esp + 0x21c], eax
push edx
call fcn.00411640
mov dword [esp + 0x224], eax
mov eax, dword [esp + 0x88]
push eax
call fcn.00411640
mov dword [esp + 0x22c], eax
lea edi, [esp + 0x90]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x230]
mov eax, ecx
mov esi, edi
mov edi, edx
push 0x10
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [0x431660]
and ecx, 3
lea edx, [esp + 0x224]
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x74]
push ecx
push 0
push ebx
push edx
push eax
call fcn.004115d0
add esp, 0x28
cmp eax, ebx
je 0x4085e2
push 0x209
push str.spnsrvnt.c
push 0x3e
call fcn.004130f0
mov ecx, dword [esp + 0x24]
push ecx
call fcn.0040f330
mov eax, dword [0x422894]
add esp, 0x10
test eax, eax
je 0x4085e2
call fcn.004117c0
push eax
push str.Warning:_Reply_to_broadcast_failed:_winsock_error_code_:__ld_n
push 0
call fcn.004102d0
mov edx, dword [esp + 0x24]
add esp, 0xc
push edx
call fcn.0040f330
add esp, 4
jmp 0x40818d
mov eax, dword [0x422894]
test eax, eax
je 0x4085e2
push str.processMessage_is_asking_us_to_silently_ignore_this_msg__so_am_dropping_it__n
push 0
call fcn.004102d0
add esp, 8
mov edx, dword [esp + 0x18]
push edx
call fcn.0040f330
add esp, 4
jmp 0x40818d
mov eax, dword [0x422894]
mov esi, dword [0x426454]
xor edi, edi
test eax, eax
je 0x408613
push str.Not_a_broadacast__Looking_to_see_if_it_is_an_old_client__n
push edi
call fcn.004102d0
add esp, 8
push esi
call fcn.0040f0c0
add esp, 4
test eax, eax
jne 0x40887c
test edi, edi
jne 0x408680
push esi
call fcn.0040f0d0
mov ecx, dword [esp + 0x80]
mov ebp, eax
add esp, 4
mov eax, dword [ebp + 0x14]
cmp eax, ecx
jne 0x40865a
lea ecx, [esp + 0x60]
push ecx
push ebp
call fcn.004070c0
add esp, 8
test eax, eax
je 0x40865a
mov edi, 1
jmp 0x408665
push esi
call fcn.0040f0e0
add esp, 4
mov esi, eax
push esi
call fcn.0040f0c0
add esp, 4
test eax, eax
je 0x408624
test edi, edi
mov dword [esp + 0x14], ebp
je 0x40887c
jmp 0x408684
mov dword [esp + 0x14], ebp
mov edx, dword [ebp + 0x18]
mov eax, dword [esp + 0x74]
inc edx
and edx, 0x1fff
cmp edx, eax
jne 0x408751
mov ecx, 0x64
lea esi, [esp + 0x80]
lea edi, [esp + 0x4f4]
mov dword [ebp + 0x18], eax
mov dword [ebp + 0x28], 0xffffff9c
mov eax, dword [0x431660]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [0x4217e4]
mov dword [esp + 0x10], 5
cmp eax, ecx
jne 0x4086d4
push 2
jmp 0x4086d6
push 1
call fcn.00406cf0
add esp, 4
lea ecx, [esp + 0x18]
lea edx, [esp + 0x4c]
push ecx
push edx
push str.myServerProcLck
call fcn.0040f2d0
add esp, 0xc
test eax, eax
je 0x408712
push 0x253
push str.spnsrvnt.c
push 0x72
call fcn.004130f0
add esp, 0xc
jmp 0x40818d
lea eax, [esp + 0x10]
lea ecx, [esp + 0x684]
push eax
lea edx, [esp + 0x4f8]
push ecx
push edx
call fcn.00402f50
mov eax, dword [esp + 0x1c]
lea ecx, [esp + 0x690]
push eax
push ecx
push ebp
call fcn.00406d50
mov edx, dword [esp + 0x30]
push edx
call fcn.0040f330
add esp, 0x1c
jmp 0x40818d
mov ecx, dword [0x422894]
test ecx, ecx
je 0x40876e
push str.Got_old_sequence_number_n
push 0
call fcn.004102d0
mov eax, dword [esp + 0x7c]
add esp, 8
cmp dword [ebp + 0x28], 0xffffff9c
je 0x40818d
cmp dword [ebp + 0x18], eax
jne 0x40818d
mov eax, dword [0x422894]
test eax, eax
je 0x408799
push str.Resending_packet_n
push 0
call fcn.004102d0
add esp, 8
mov ecx, 0x68
xor eax, eax
lea edi, [esp + 0x210]
rep stosd dword es:[edi], eax
mov eax, dword [ebp + 0x24]
push eax
call fcn.00411640
mov dword [esp + 0x214], eax
mov ecx, dword [ebp + 0x28]
push ecx
call fcn.00411640
mov dword [esp + 0x21c], eax
mov edx, dword [ebp + 0x2c]
push edx
call fcn.00411640
mov dword [esp + 0x224], eax
mov eax, dword [ebp + 0x30]
push eax
call fcn.00411640
mov dword [esp + 0x22c], eax
lea edi, [ebp + 0x34]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x10
lea edx, [esp + 0x220]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x10
mov eax, ecx
mov esi, edi
mov edi, edx
push ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [0x431660]
and ecx, 3
push 0
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp + 0x20]
lea edx, [esp + 0x21c]
push ecx
push edx
push eax
call sub.WSOCK32.dll_sendto
cmp eax, dword [ebp + 0x20]
je 0x40818d
push 0x276
push str.spnsrvnt.c
push 0x3e
call fcn.004130f0
mov eax, dword [0x422894]
add esp, 0xc
test eax, eax
je 0x4081a5
call fcn.00414320
mov ecx, dword [eax]
mov edx, dword [ecx*4 + 0x423e90]
push edx
push str.sendto_failed:__s_n
push 0
call fcn.004102d0
add esp, 0xc
jmp 0x40818d
push 0x1c4
call fcn.00413ba0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x4088c5
mov eax, dword [0x422894]
test eax, eax
je 0x4088ac
call fcn.004117c0
push eax
push str.malloc_failed:_winsock_error_code_:__ld_n
push ebp
call fcn.004102d0
add esp, 0xc
push 0x28e
push str.spnsrvnt.c
push 0x40
call fcn.004130f0
add esp, 0xc
jmp 0x408189
mov ecx, ebp
xor eax, eax
lea esi, [esp + 0x60]
mov edi, ebp
mov dword [ecx], eax
push ebp
push 0x426454
mov dword [ecx + 4], eax
mov dword [ecx + 8], eax
mov dword [ecx + 0xc], eax
mov ecx, dword [esp + 0x2c]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [esp + 0x78]
mov dword [ebp + 0x10], eax
mov ecx, dword [esp + 0x7c]
mov dword [ebp + 0x18], ecx
mov edx, dword [esp + 0x80]
mov dword [ebp + 0x1c], edx
mov eax, dword [esp + 0x84]
mov dword [ebp + 0x14], eax
mov dword [ebp + 0x28], 0xffffff9c
mov dword [ebp + 0x20], ebx
call fcn.0040f100
mov eax, dword [0x4217e4]
mov ecx, 0x64
lea esi, [esp + 0x88]
lea edi, [esp + 0x4fc]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [0x431660]
add esp, 8
cmp ecx, eax
mov dword [esp + 0x10], 1
jne 0x408956
push 2
jmp 0x408958
push 1
call fcn.00406cf0
add esp, 4
lea edx, [esp + 0x18]
lea eax, [esp + 0x4c]
push edx
push eax
push str.myServerProcLck
call fcn.0040f2d0
add esp, 0xc
test eax, eax
je 0x408994
push 0x2ac
push str.spnsrvnt.c
push 0x72
call fcn.004130f0
add esp, 0xc
jmp 0x408189
lea ecx, [esp + 0x10]
lea edx, [esp + 0x684]
push ecx
lea eax, [esp + 0x4f8]
push edx
push eax
call fcn.00402f50
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x690]
push ecx
push edx
push ebp
call fcn.00406d50
mov eax, dword [esp + 0x30]
push eax
call fcn.0040f330
add esp, 0x1c
jmp 0x408189
mov ecx, 0x64
xor eax, eax
lea edi, [esp + 0x4f4]
push 1
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x4c]
push eax
lea edx, [esp + 0x54]
push ecx
push edx
push str.myServerProcLck
mov dword [esp + 0x24], 5
call fcn.0040f230
add esp, 0x14
test eax, eax
jne 0x40818d
call fcn.00407040
mov eax, dword [esp + 0x48]
push eax
call fcn.0040f330
add esp, 4
jmp 0x40818d
call fcn.00414320
cmp dword [eax], 4
je 0x40818d
mov eax, dword [0x422894]
test eax, eax
je 0x408a59
call fcn.00414320
mov ecx, dword [eax]
mov edx, dword [ecx*4 + 0x423e90]
push edx
push str.select_failed:__s_n
push 0
call fcn.004102d0
add esp, 0xc
push 0x15a
push str.spnsrvnt.c
push 0x6d
call fcn.004130f0
add esp, 0xc
jmp 0x40818d