Function at 0x570898
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push 0xffffffffffffffff
push 0x5cf088
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
push ebx
push ebp
push esi
mov esi, ecx
xor ebp, ebp
push edi
mov eax, dword [esi + 0x3310]
mov ebx, 1
cmp eax, ebp
je 0x5708bd
cmp dword [esi + 0x3308], 0x80090318
jne 0x57098c
cmp dword [esi + 0x3314], ebp
je 0x570986
mov edx, dword [esi + 0x330c]
mov ecx, 0x10000
sub ecx, eax
push ebp
add edx, eax
mov eax, dword [esp + 0x28]
push ecx
push edx
push eax
call sub.WSOCK32.dll_recv
mov edi, eax
cmp edi, 0xffffffff
jne 0x570911
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2733
je 0x570907
mov dword [esi + 0x3308], 0x80090304
jmp 0x570c6d
mov eax, 0x2733
jmp 0x570c6d
cmp edi, ebp
jne 0x570931
push str.Server_unexpectedly_disconnected_n
mov ecx, esi
call fcn.0050ef30
mov eax, 0x80090304
mov dword [esi + 0x3308], eax
jmp 0x570c6d
mov ecx, dword [0x682f9c]
mov dword [esp + 0x10], ecx
push edi
lea edx, [esp + 0x14]
push str._d_bytes_of_handshake_data_received_n
push edx
mov dword [esp + 0x28], ebp
call fcn.0059e618
mov eax, dword [esp + 0x1c]
add esp, 0xc
mov ecx, esi
push eax
call fcn.0050ef30
mov eax, dword [esi + 0x3310]
mov ecx, esi
add eax, edi
mov dword [esi + 0x3310], eax
call fcn.0050fc20
lea ecx, [esp + 0x10]
mov dword [esp + 0x1c], 0xffffffff
call fcn.005a584d
jmp 0x57098c
mov dword [esi + 0x3314], ebx
mov ecx, dword [esi + 0x330c]
mov edx, dword [esi + 0x3310]
mov dword [esi + 0x32e4], ebx
mov dword [esi + 0x32d0], ecx
lea ebx, [esi + 0x3300]
mov ecx, 2
push ebx
lea eax, [esi + 0x32c8]
mov dword [esi + 0x32cc], ecx
mov dword [esi + 0x32c0], ecx
mov dword [esi + 0x32f0], ecx
lea ebx, [esi + 0x32f8]
lea ecx, [esi + 0x32e0]
push ebx
mov dword [eax], edx
mov dword [esi + 0x32c4], eax
mov edx, dword [esi + 0x80]
push ecx
lea eax, [esi + 0x32bc]
push ebp
push ebp
push eax
push 0x10
mov dword [eax], ebp
mov eax, dword [esp + 0x48]
push ebp
mov dword [ecx], ebp
mov ecx, dword [esp + 0x48]
push 0xc11c
lea edi, [esi + 0x32ec]
push ebp
push eax
push ecx
mov dword [esi + 0x32dc], ebp
mov dword [esi + 0x32d4], ebp
mov dword [esi + 0x32d8], ebp
mov dword [esi + 0x32f4], ebp
mov dword [edi], ebp
mov dword [esi + 0x32e8], edi
call dword [edx + 0x364]
cmp eax, ebp
mov dword [esi + 0x3308], eax
je 0x570a54
cmp eax, 0x90312
je 0x570a54
cmp eax, ebp
jge 0x570ade
mov eax, dword [ebx]
test ah, 0x40
je 0x570ade
mov edi, dword [edi]
cmp edi, ebp
je 0x570ade
mov eax, dword [esi + 0x32f4]
cmp eax, ebp
je 0x570ade
mov edx, dword [esp + 0x24]
push ebp
push edi
push eax
push edx
call sub.WSOCK32.dll_send
or ebx, 0xffffffff
cmp eax, ebx
je 0x570af0
cmp eax, ebp
je 0x570af0
mov ecx, dword [0x682f9c]
mov dword [esp + 0x24], ecx
push eax
lea edx, [esp + 0x28]
push str._d_bytes_of_handshake_data_sent_n
push edx
mov dword [esp + 0x28], 2
call fcn.0059e618
mov eax, dword [esp + 0x30]
add esp, 0xc
mov ecx, esi
push eax
call fcn.0050ef30
mov ecx, esi
call fcn.0050fc20
mov edx, dword [esi + 0x32f4]
mov ecx, dword [esi + 0x80]
push edx
call dword [ecx + 0x38c]
lea ecx, [esp + 0x24]
mov dword [esi + 0x32f4], ebp
mov dword [esp + 0x1c], ebx
call fcn.005a584d
mov eax, dword [esi + 0x3308]
cmp eax, 0x80090318
jne 0x570b5f
jmp 0x570c6d
call sub.WSOCK32.dll_WSAGetLastError
mov edi, eax
mov eax, dword [0x682f9c]
mov dword [esp + 0x30], eax
push edi
lea ecx, [esp + 0x34]
push str.Error__d_sending_data_to_server__2__n
push ecx
mov dword [esp + 0x28], 1
call fcn.0059e618
mov edx, dword [esp + 0x3c]
add esp, 0xc
mov ecx, esi
push edx
call fcn.0050ef30
mov ecx, dword [esi + 0x32f4]
mov eax, dword [esi + 0x80]
push ecx
call dword [eax + 0x38c]
mov eax, dword [esp + 0x2c]
mov edx, dword [esi + 0x80]
push eax
call dword [edx + 0x370]
lea ecx, [esp + 0x30]
mov dword [esp + 0x1c], ebx
call fcn.005a584d
mov eax, edi
jmp 0x570c6d
cmp eax, ebp
jne 0x570bfb
push str.Handshake_was_successful_n
mov ecx, esi
call fcn.0050ef30
mov eax, dword [esi + 0x32d8]
mov byte [esi + 0x31e4], 1
cmp eax, 5
jne 0x570beb
mov ecx, dword [esi + 0x32d4]
push ecx
push ebp
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edi, dword [esp + 0x30]
cmp eax, ebp
mov dword [edi + 8], eax
jne 0x570bb4
push str._Out_of_memory__2__n
mov ecx, esi
call fcn.0050ef30
mov eax, 0x80090304
jmp 0x570c6d
mov ecx, dword [esi + 0x32d4]
mov edx, dword [esi + 0x330c]
mov ebp, dword [esi + 0x3310]
sub edx, ecx
add edx, ebp
push ecx
push edx
push eax
call fcn.0058a490
mov eax, dword [esi + 0x32d4]
add esp, 0xc
mov dword [edi], eax
mov dword [edi + 4], 2
xor eax, eax
jmp 0x570c6d
mov eax, dword [esp + 0x30]
mov dword [eax + 8], ebp
mov dword [eax], ebp
mov dword [eax + 4], ebp
xor eax, eax
jmp 0x570c6d
jl 0x570c6d
cmp eax, 0x90320
jne 0x570c28
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x28]
push ecx
push edx
mov ecx, esi
call fcn.0056fa00
mov eax, 0x90312
mov dword [esi + 0x3314], ebp
mov dword [esi + 0x3308], eax
jmp 0x570c6d
cmp dword [esi + 0x32d8], 5
jne 0x570c62
mov ecx, dword [esi + 0x330c]
mov eax, dword [esi + 0x32d4]
mov ebx, dword [esi + 0x3310]
mov edx, ecx
sub edx, eax
push eax
add edx, ebx
push edx
push ecx
call fcn.0058a490
mov eax, dword [esi + 0x32d4]
add esp, 0xc
mov dword [esi + 0x3310], eax
jmp 0x570c68
mov dword [esi + 0x3310], ebp
mov eax, 0x90312
mov ecx, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x10
ret 0x10