Function at 0x40e172
Capabilities:
Read and send data from client to server
Read file on windows
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
push esi
mov esi, eax
xor ebx, ebx
push edi
cmp esi, ebx
jne 0x40e198
push 0x2cb
push 0x42b04c
push 0x42b084
call fcn.00411f5e
add esp, 0xc
mov dword [esi + 0x34], 1
cmp dword [esi + 0x4518], ebx
je 0x40e1b4
lea eax, [esi + 0x451c]
push eax
call fcn.004107d4
pop ecx
mov eax, dword [esi + 0x48]
imul eax, dword [esi + 0x54]
mov dword [esi + 0x40], ebx
mov dword [esi + 0x3c], ebx
mov dword [esi + 0x44f4], eax
cmp dword [esi + 0x3c], ebx
jbe 0x40e1d2
mov eax, dword [esi + 0x2c]
mov dword [esi + 0x34], eax
cmp dword [esi + 0x2c], ebx
jbe 0x40e2a2
mov eax, dword [esi + 0x2c]
add eax, dword [esi + 0x54]
mov ecx, dword [esi + 0x30]
cmp eax, ecx
jae 0x40e1ea
mov ecx, eax
mov eax, dword [esi + 0x34]
cmp eax, ecx
ja 0x40e2a2
dec eax
imul eax, dword [esi + 0x48]
push ebx
push ebx
push eax
push dword [esi + 0x24]
lea edi, [esi + 0x60]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x40e445
push 0
lea ebx, [esi + 0x38]
push ebx
push dword [esi + 0x48]
lea eax, [edi + 4]
push eax
push dword [esi + 0x24]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40e443
cmp dword [esi + 0x4518], 0
je 0x40e254
cmp dword [esi + 0x40], 0
jne 0x40e254
push dword [ebx]
lea eax, [edi + 4]
push eax
lea eax, [esi + 0x451c]
push eax
call fcn.00410f73
add esp, 0xc
push 3
call dword [sym.imp.WS2_32.dll_htons]
mov word [edi], ax
movzx eax, word [esi + 0x34]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [edi + 2], ax
mov eax, dword [ebx]
push 0
add eax, 4
push eax
push edi
push dword [esi + 0x20]
call dword [sym.imp.WS2_32.dll_send]
test eax, eax
js 0x40e459
mov ecx, dword [ebx]
add ecx, 4
cmp eax, ecx
jne 0x40e459
inc dword [esi + 0x40]
inc dword [esi + 0x34]
xor ebx, ebx
jmp 0x40e1db
call fcn.0040d50a
test eax, eax
je 0x40e429
push ebx
push 0x204
lea edi, [esi + 0x4064]
push edi
push dword [esi + 0x20]
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, ebx
jle 0x40e462
cmp eax, 4
jae 0x40e2e2
push 0x42b0b8
push 1
call fcn.0040764f
pop ecx
pop ecx
jmp 0x40e340
movzx eax, word [edi]
mov ebx, dword [sym.imp.WS2_32.dll_ntohs]
push eax
call ebx
cmp ax, 5
je 0x40e469
movzx eax, word [edi]
push eax
call ebx
cmp ax, 4
jne 0x40e40b
movzx eax, word [edi + 2]
push eax
call ebx
cmp ax, word [esi + 0x2c]
jne 0x40e39a
mov eax, dword [esi + 0x3c]
add dword [esi + 0x44f8], eax
mov eax, dword [esi + 0x2c]
and dword [esi + 0x3c], 0
and dword [esi + 0x40], 0
test eax, eax
je 0x40e33a
mov ecx, dword [esi + 0x38]
add dword [esi + 0x44f4], ecx
inc eax
mov dword [esi + 0x2c], eax
xor ebx, ebx
mov eax, dword [esi + 0x34]
cmp eax, dword [esi + 0x30]
mov eax, dword [0x42bfcc]
jbe 0x40e35a
cmp dword [0x42c31c], ebx
jne 0x40e369
cmp dword [esi + 0x40], ebx
je 0x40e369
cmp dword [esi + 0x40], 0x32
jae 0x40e373
cmp dword [esi + 0x3c], eax
jb 0x40e1c7
cmp dword [esi + 0x40], 0x32
jb 0x40e480
lea eax, [esi + 0x42ea]
push eax
movzx eax, word [esi + 0x2c]
push eax
push str.MAX_RETRIES_while_waiting_for_Ack_block__d._file___s_
push ebx
call fcn.0040764f
push ebx
mov ebx, esi
call fcn.0040d211
add esp, 0x14
jmp 0x40e47c
cmp dword [esi + 0x40], 3
jae 0x40e3d3
cmp dword [esi + 0x2c], 1
je 0x40e3d3
movzx eax, word [edi + 2]
push eax
call ebx
mov cx, word [esi + 0x2c]
dec cx
cmp ax, cx
jne 0x40e3d3
movzx eax, word [esi + 0x2c]
push 0
push eax
push str.Ack_block__d_ignored__received_twice_
push 1
call fcn.0040764f
add esp, 0x10
jmp 0x40e33e
cmp dword [esi + 0x28], 0
jne 0x40e33e
mov eax, dword [esi + 0x2c]
mov dword [ebp - 4], eax
movzx eax, word [edi + 2]
push eax
call ebx
movzx eax, ax
cmp eax, dword [ebp - 4]
jbe 0x40e33e
movzx eax, word [edi + 2]
push dword [ebp - 4]
push eax
call ebx
movzx eax, ax
push eax
push str.Ack_of_block__d_received__last_block_sent__d___
jmp 0x40e3c4
movzx eax, word [edi]
push eax
call ebx
movzx eax, ax
push eax
push str.ignore_unknown_opcode__d_received
push 2
call fcn.0040764f
add esp, 0xc
jmp 0x40e33e
push dword [esi + 0x2c]
push str.timeout_while_waiting_for_ack_blk__d
push 9
call fcn.0040764f
add esp, 0xc
inc dword [esi + 0x3c]
jmp 0x40e340
xor ebx, ebx
push str.ReadFile
push ebx
mov eax, esi
call fcn.0040d4d1
pop ecx
pop ecx
jmp 0x40e4e4
push 0x42b0a8
push 0
jmp 0x40e44b
push 0x42b0b0
jmp 0x40e44a
add edi, 4
push edi
push str.Peer_returns_ERROR___s_____aborting_transfer
push 1
call fcn.0040764f
add esp, 0xc
xor eax, eax
jmp 0x40e4e4
mov ecx, dword [esi + 0x3c]
cmp ecx, eax
jb 0x40e4b3
mov edx, dword [esi + 0x34]
cmp edx, dword [esi + 0x30]
jbe 0x40e4e9
lea eax, [esi + 0x42ea]
push eax
movzx eax, word [esi + 0x2c]
push eax
push str.WARNING_:_Last_block__d_not_acked_for_file___s_
push 1
call fcn.0040764f
mov eax, dword [esi + 0x3c]
add esp, 0x10
add dword [esi + 0x44f8], eax
push dword [esi + 0x34]
push dword [esi + 0x2c]
push str.Count__d__Last_pkt__d
push 0xa
call fcn.0040764f
add esp, 0x10
cmp dword [esi + 0x4518], ebx
je 0x40e4dc
cmp dword [esi + 0x28], ebx
jne 0x40e4dc
mov ecx, esi
call fcn.0040d2fc
call fcn.0040de4f
xor eax, eax
inc eax
pop edi
pop esi
pop ebx
leave
ret
cmp ecx, eax
jb 0x40e4b3
push dword [esi + 0x2c]
push str.TIMEOUT_waiting_for_Ack_block__d
push 1
call fcn.0040764f
push ebx
mov ebx, esi
call fcn.0040d211
add esp, 0x10
jmp 0x40e47c