Function at 0x40ad81
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 ebx
push ebp
push esi
mov esi, dword [esp + 0x10]
xor ebp, ebp
push edi
cmp esi, ebp
jne 0x40ada6
push 0x2b7
push str.._services_tftpd_thread.c
push str.pTftp_NULL
call fcn.0040f6b6
add esp, 0xc
mov dword [esi + 0x34], 1
cmp dword [esi + 0x44a0], ebp
je 0x40adc2
lea eax, [esi + 0x44a4]
push eax
call fcn.0040d689
pop ecx
mov dword [esi + 0x40], ebp
mov dword [esi + 0x3c], ebp
cmp dword [esi + 0x3c], ebp
jbe 0x40add3
mov eax, dword [esi + 0x2c]
mov dword [esi + 0x34], eax
cmp dword [esi + 0x2c], ebp
jbe 0x40aeb6
mov ecx, dword [esi + 0x2c]
mov eax, dword [esi + 0x54]
add eax, ecx
mov ecx, dword [esi + 0x30]
cmp eax, ecx
jae 0x40aded
mov ecx, eax
mov eax, dword [esi + 0x34]
cmp eax, ecx
ja 0x40aeb6
dec eax
imul eax, dword [esi + 0x48]
push ebp
push ebp
push eax
push dword [esi + 0x24]
lea edi, [esi + 0x60]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x40b03f
push 0
lea ebx, [esi + 0x38]
push ebx
push dword [esi + 0x48]
lea ebp, [edi + 4]
push ebp
push dword [esi + 0x24]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40b03d
cmp dword [esi + 0x44a0], 0
je 0x40ae54
cmp dword [esi + 0x40], 0
jne 0x40ae54
push dword [ebx]
lea eax, [esi + 0x44a4]
push ebp
push eax
call fcn.0040de0c
add esp, 0xc
mov ebp, dword [sym.imp.WS2_32.dll_htons]
push 3
call ebp
mov word [edi], ax
movzx eax, word [esi + 0x34]
push eax
call ebp
push esi
mov word [edi + 2], ax
call fcn.004098b2
xor ebp, ebp
pop ecx
cmp dword [esi + 0x28], ebp
je 0x40ae83
push esi
call fcn.0040a344
pop ecx
jmp 0x40ae94
mov eax, dword [ebx]
push ebp
add eax, 4
push eax
push edi
push dword [esi + 0x20]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, ebp
jl 0x40b04d
mov ecx, dword [ebx]
add ecx, 4
cmp eax, ecx
jne 0x40b04d
inc dword [esi + 0x40]
inc dword [esi + 0x34]
xor ebp, ebp
jmp 0x40addc
mov eax, esi
call fcn.0040a3ef
test eax, eax
je 0x40b026
push ebp
push 0x204
lea edi, [esi + 0x4064]
push edi
push dword [esi + 0x20]
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, ebp
jle 0x40b054
cmp eax, 4
jae 0x40aefb
push str.rcvd_packet_too_short
push 1
call fcn.004010eb
pop ecx
pop ecx
jmp 0x40afc2
movzx eax, word [edi]
mov ebx, dword [sym.imp.WS2_32.dll_ntohs]
push eax
call ebx
cmp ax, 5
je 0x40b05b
movzx eax, word [edi]
push eax
call ebx
cmp ax, 4
jne 0x40b00b
push esi
call fcn.004098b2
movzx eax, word [edi + 2]
pop ecx
push eax
call ebx
cmp ax, word [esi + 0x2c]
jne 0x40af5a
mov eax, dword [esi + 0x3c]
add dword [esi + 0x4488], eax
mov eax, dword [esi + 0x2c]
mov dword [esi + 0x3c], ebp
mov dword [esi + 0x40], ebp
cmp eax, ebp
je 0x40af54
mov ecx, dword [esi + 0x38]
add dword [esi + 0x4484], ecx
inc eax
mov dword [esi + 0x2c], eax
jmp 0x40afc2
cmp dword [esi + 0x40], 3
jae 0x40af8f
cmp dword [esi + 0x2c], 1
je 0x40af8f
movzx eax, word [edi + 2]
push eax
call ebx
mov cx, word [esi + 0x2c]
dec cx
cmp ax, cx
jne 0x40af8f
movzx eax, word [esi + 0x2c]
push ebp
push eax
push str.Ack_block__d_ignored__received_twice_
push 1
call fcn.004010eb
add esp, 0x10
jmp 0x40afc2
cmp dword [esi + 0x28], ebp
jne 0x40afc2
movzx eax, word [edi + 2]
mov ebp, dword [esi + 0x2c]
push eax
call ebx
movzx eax, ax
cmp eax, ebp
jbe 0x40afc0
movzx eax, word [edi + 2]
push ebp
push eax
call ebx
movzx eax, ax
push eax
push str.Ack_of_block__d_received__last_block_sent__d___
push 1
call fcn.004010eb
add esp, 0x10
xor ebp, ebp
mov eax, dword [esi + 0x34]
cmp eax, dword [esi + 0x30]
mov eax, dword [0x429bec]
ja 0x40afde
cmp dword [esi + 0x40], 0x32
jae 0x40afe8
cmp dword [esi + 0x3c], eax
jb 0x40adc8
cmp dword [esi + 0x40], 0x32
jb 0x40b072
lea eax, [esi + 0x427a]
push eax
movzx eax, word [esi + 0x2c]
push eax
push str.MAX_RETRIES_while_waiting_for_Ack_block__d._file___s_
push ebp
call fcn.004010eb
push ebp
push esi
call fcn.0040a0ad
add esp, 0x18
jmp 0x40b06e
movzx eax, word [edi]
push eax
call ebx
movzx eax, ax
push eax
push str.ignore_unknown_opcode__d_received
push 2
call fcn.004010eb
add esp, 0xc
jmp 0x40afc2
push dword [esi + 0x2c]
push str.timeout_while_waiting_for_ack_blk__d
push 9
call fcn.004010eb
add esp, 0xc
inc dword [esi + 0x3c]
jmp 0x40afc2
xor ebp, ebp
push 0x424f40
push ebp
call fcn.0040a3bb
pop ecx
jmp 0x40b0c4
push str.send
jmp 0x40b044
push str.recv
jmp 0x40b044
add edi, 4
push edi
push str.Peer_returns_ERROR___s_____aborting_transfer
push 1
call fcn.004010eb
add esp, 0xc
xor eax, eax
jmp 0x40b0c5
cmp dword [esi + 0x3c], eax
jb 0x40b092
push dword [esi + 0x2c]
push str.TIMEOUT_waiting_for_Ack_block__d
push 1
call fcn.004010eb
push ebp
push esi
call fcn.0040a0ad
add esp, 0x14
jmp 0x40b06e
push dword [esi + 0x34]
push dword [esi + 0x2c]
push str.Count__d__Last_pkt__d
push 0xa
call fcn.004010eb
add esp, 0x10
cmp dword [esi + 0x44a0], ebp
je 0x40b0bb
cmp dword [esi + 0x28], ebp
jne 0x40b0bb
mov ecx, esi
call fcn.0040a1d6
push esi
call fcn.0040abd0
xor eax, eax
inc eax
pop ecx
pop edi
pop esi
pop ebp
pop ebx
ret