Function at 0x40ad69
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 0x40ad8e
push 0x2b7
push str.._services_tftpd_thread.c
push str.pTftp_NULL
call fcn.0040f696
add esp, 0xc
mov dword [esi + 0x34], 1
cmp dword [esi + 0x44a0], ebp
je 0x40adaa
lea eax, [esi + 0x44a4]
push eax
call fcn.0040d671
pop ecx
mov dword [esi + 0x40], ebp
mov dword [esi + 0x3c], ebp
cmp dword [esi + 0x3c], ebp
jbe 0x40adbb
mov eax, dword [esi + 0x2c]
mov dword [esi + 0x34], eax
cmp dword [esi + 0x2c], ebp
jbe 0x40ae9e
mov ecx, dword [esi + 0x2c]
mov eax, dword [esi + 0x54]
add eax, ecx
mov ecx, dword [esi + 0x30]
cmp eax, ecx
jae 0x40add5
mov ecx, eax
mov eax, dword [esi + 0x34]
cmp eax, ecx
ja 0x40ae9e
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 0x40b027
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 0x40b025
cmp dword [esi + 0x44a0], 0
je 0x40ae3c
cmp dword [esi + 0x40], 0
jne 0x40ae3c
push dword [ebx]
lea eax, [esi + 0x44a4]
push ebp
push eax
call fcn.0040ddf4
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 0x40ae6b
push esi
call fcn.0040a32c
pop ecx
jmp 0x40ae7c
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 0x40b035
mov ecx, dword [ebx]
add ecx, 4
cmp eax, ecx
jne 0x40b035
inc dword [esi + 0x40]
inc dword [esi + 0x34]
xor ebp, ebp
jmp 0x40adc4
mov eax, esi
call fcn.0040a3d7
test eax, eax
je 0x40b00e
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 0x40b03c
cmp eax, 4
jae 0x40aee3
push str.rcvd_packet_too_short
push 1
call fcn.004010eb
pop ecx
pop ecx
jmp 0x40afaa
movzx eax, word [edi]
mov ebx, dword [sym.imp.WS2_32.dll_ntohs]
push eax
call ebx
cmp ax, 5
je 0x40b043
movzx eax, word [edi]
push eax
call ebx
cmp ax, 4
jne 0x40aff3
push esi
call fcn.004098b2
movzx eax, word [edi + 2]
pop ecx
push eax
call ebx
cmp ax, word [esi + 0x2c]
jne 0x40af42
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 0x40af3c
mov ecx, dword [esi + 0x38]
add dword [esi + 0x4484], ecx
inc eax
mov dword [esi + 0x2c], eax
jmp 0x40afaa
cmp dword [esi + 0x40], 3
jae 0x40af77
cmp dword [esi + 0x2c], 1
je 0x40af77
movzx eax, word [edi + 2]
push eax
call ebx
mov cx, word [esi + 0x2c]
dec cx
cmp ax, cx
jne 0x40af77
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 0x40afaa
cmp dword [esi + 0x28], ebp
jne 0x40afaa
movzx eax, word [edi + 2]
mov ebp, dword [esi + 0x2c]
push eax
call ebx
movzx eax, ax
cmp eax, ebp
jbe 0x40afa8
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 0x40afc6
cmp dword [esi + 0x40], 0x32
jae 0x40afd0
cmp dword [esi + 0x3c], eax
jb 0x40adb0
cmp dword [esi + 0x40], 0x32
jb 0x40b05a
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.0040a095
add esp, 0x18
jmp 0x40b056
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 0x40afaa
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 0x40afaa
xor ebp, ebp
push 0x424f40
push ebp
call fcn.0040a3a3
pop ecx
jmp 0x40b0ac
push str.send
jmp 0x40b02c
push str.recv
jmp 0x40b02c
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 0x40b0ad
cmp dword [esi + 0x3c], eax
jb 0x40b07a
push dword [esi + 0x2c]
push str.TIMEOUT_waiting_for_Ack_block__d
push 1
call fcn.004010eb
push ebp
push esi
call fcn.0040a095
add esp, 0x14
jmp 0x40b056
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 0x40b0a3
cmp dword [esi + 0x28], ebp
jne 0x40b0a3
mov ecx, esi
call fcn.0040a1be
push esi
call fcn.0040abb8
xor eax, eax
inc eax
pop ecx
pop edi
pop esi
pop ebp
pop ebx
ret