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

Disassembly:
sub esp, 0xc
push ebx
push ebp
push esi
push edi
push 0x4026a0
push 0
mov esi, ecx
mov byte [0x41af48], 0
call fcn.004087e0
push 0x4026a0
push 2
mov dword [esp + 0x24], eax
call fcn.004087e0
add esp, 0x10
mov ecx, esi
mov dword [esp + 0x18], eax
call fcn.00402f10
lea ebp, [esi + 0x38]
lea ecx, [ecx]
mov eax, dword [esi + 0xc]
mov cl, byte [eax + 0x46]
test cl, cl
je 0x4036b5
mov ecx, dword [esi + 0x10]
push ecx
mov ecx, dword [esi + 0x80]
call fcn.00401540
mov eax, dword [esi + 0x10]
cmp byte [eax], 0x61
jne 0x4036a4
mov byte [eax], 0x30
mov ecx, dword [esi + 0x80]
call fcn.00401510
mov byte [esp + 0x13], al
jmp 0x4036ba
mov byte [esp + 0x13], 1
mov edx, dword [esi + 0xc]
mov eax, dword [edx + 0x1c]
mov ecx, dword [esi + 0x10]
mov edx, dword [esi + 4]
push 0
push eax
push ecx
push edx
call dword [sym.imp.WS2_32.dll_send]
push 0
push ebp
mov edi, eax
call fcn.00406c20
add esp, 8
test edi, edi
jl 0x403744
mov ecx, esi
call fcn.00403050
mov ecx, dword [esi + 0x1c]
mov eax, edi
mov edi, dword [esi + 0x18]
cdq
add edi, eax
adc ecx, edx
mov dword [esi + 0x18], edi
mov dword [esi + 0x1c], ecx
mov al, byte [0x41af48]
test al, al
jne 0x403758
mov bl, byte [esi + 0x20]
test bl, bl
je 0x403724
mov eax, dword [esi + 0x48]
mov ecx, dword [ebp]
cmp ecx, eax
mov edx, dword [esi + 0x4c]
jg 0x403758
jne 0x403720
cmp dword [ebp + 4], edx
jg 0x403758
test bl, bl
jne 0x403736
mov eax, dword [esi + 0x1c]
cmp eax, dword [esi + 0x2c]
jg 0x403758
jl 0x403736
mov ecx, dword [esi + 0x18]
cmp ecx, dword [esi + 0x28]
jae 0x403758
mov al, byte [esp + 0x13]
test al, al
jne 0x403680
jmp 0x403758
push 0x7a
push 0x4158c0
push str.write
call fcn.00406bf0
add esp, 0xc
mov eax, dword [esp + 0x14]
cmp eax, 0x4026a0
je 0x40377a
push eax
push 0
call fcn.004087e0
mov edx, dword [esp + 0x20]
push edx
push 2
call fcn.004087e0
add esp, 0x10
mov eax, dword [esi + 4]
push 1
push eax
call dword [sym.imp.WS2_32.dll_shutdown]
mov ecx, dword [esi + 0xc]
mov edx, dword [ecx + 0x1c]
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 4]
push 0
push edx
push eax
push ecx
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
jne 0x4037b8
push 0x91
push 0x4158c0
push str.read_on_server_close
call fcn.00406bf0
jmp 0x4037d0
test eax, eax
jle 0x4037d3
push 0x92
push 0x4158c0
push str.server_sent_unexpected_data
call fcn.00406bc0
add esp, 0xc
lea edi, [esi + 0x48]
push 0
push edi
call fcn.00406c20
mov edx, dword [0x41af50]
add esp, 8
push 0xffffffffffffffff
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov ecx, dword [esi + 0x44]
mov edx, dword [edi + 4]
mov eax, dword [esi + 0x40]
sub edx, ecx
mov ecx, dword [edi]
mov dword [esp + 0x18], edx
fild dword [esp + 0x18]
mov edx, dword [esi + 0x1c]
sub ecx, eax
mov eax, dword [esi + 0x18]
fmul qword [0x415378]
mov dword [esp + 0x18], ecx
fild dword [esp + 0x18]
sub esp, 8
mov ecx, esi
faddp st(1)
fstp qword [esp]
push 0
push 0
push edx
push eax
call fcn.004023a0
mov ecx, dword [0x41af50]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov edx, dword [esi + 0xc]
mov al, byte [edx + 0x48]
test al, al
je 0x40385b
mov eax, dword [esi + 4]
push eax
call fcn.00408850
add esp, 4
push eax
mov ecx, esi
call fcn.004029c0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret