Function at 0x40b553
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 ecx
push ebx
push ebp
push esi
mov esi, eax
xor ebp, ebp
push edi
cmp esi, ebp
jne 0x40b577
push 0x2b8
push str.._services_tftpd_thread.c
push str.pTftp_NULL
call fcn.0040fbb1
add esp, 0xc
mov dword [esi + 0x34], 1
cmp dword [esi + 0x44a8], ebp
je 0x40b593
lea eax, [esi + 0x44ac]
push eax
call fcn.0040dfbc
pop ecx
mov dword [esi + 0x40], ebp
mov dword [esi + 0x3c], ebp
cmp dword [esi + 0x3c], ebp
jbe 0x40b5a4
mov eax, dword [esi + 0x2c]
mov dword [esi + 0x34], eax
cmp dword [esi + 0x2c], ebp
jbe 0x40b67e
mov ecx, dword [esi + 0x2c]
mov eax, dword [esi + 0x54]
add eax, ecx
mov ecx, dword [esi + 0x30]
cmp eax, ecx
jae 0x40b5be
mov ecx, eax
mov eax, dword [esi + 0x34]
cmp eax, ecx
ja 0x40b67e
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 0x40b80f
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 0x40b80d
cmp dword [esi + 0x44a8], 0
je 0x40b625
cmp dword [esi + 0x40], 0
jne 0x40b625
push dword [ebx]
lea eax, [esi + 0x44ac]
push ebp
push eax
call fcn.0040e73f
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
xor ebp, ebp
mov word [edi + 2], ax
cmp dword [esi + 0x28], ebp
je 0x40b64b
call fcn.0040aadd
jmp 0x40b65c
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 0x40b823
mov ecx, dword [ebx]
add ecx, 4
cmp eax, ecx
jne 0x40b823
inc dword [esi + 0x40]
inc dword [esi + 0x34]
xor ebp, ebp
jmp 0x40b5ad
call fcn.0040ab86
test eax, eax
je 0x40b7f3
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 0x40b82a
cmp eax, 4
jae 0x40b6c1
push str.rcvd_packet_too_short
push 1
call fcn.004010eb
pop ecx
pop ecx
jmp 0x40b781
movzx eax, word [edi]
mov ebx, dword [sym.imp.WS2_32.dll_ntohs]
push eax
call ebx
cmp ax, 5
je 0x40b831
movzx eax, word [edi]
push eax
call ebx
cmp ax, 4
jne 0x40b7d8
movzx eax, word [edi + 2]
push eax
call ebx
cmp ax, word [esi + 0x2c]
jne 0x40b719
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 0x40b713
mov ecx, dword [esi + 0x38]
add dword [esi + 0x4484], ecx
inc eax
mov dword [esi + 0x2c], eax
jmp 0x40b781
cmp dword [esi + 0x40], 3
jae 0x40b74e
cmp dword [esi + 0x2c], 1
je 0x40b74e
movzx eax, word [edi + 2]
push eax
call ebx
mov cx, word [esi + 0x2c]
dec cx
cmp ax, cx
jne 0x40b74e
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 0x40b781
cmp dword [esi + 0x28], ebp
jne 0x40b781
movzx eax, word [edi + 2]
mov ebp, dword [esi + 0x2c]
push eax
call ebx
movzx eax, ax
cmp eax, ebp
jbe 0x40b77f
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 [0x42b5ac]
jbe 0x40b79b
cmp dword [0x42b850], ebp
jne 0x40b7aa
cmp dword [esi + 0x40], ebp
je 0x40b7aa
cmp dword [esi + 0x40], 0x32
jae 0x40b7b4
cmp dword [esi + 0x3c], eax
jb 0x40b599
cmp dword [esi + 0x40], 0x32
jb 0x40b848
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
mov ebx, esi
call fcn.0040a85c
add esp, 0x14
jmp 0x40b844
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 0x40b781
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 0x40b781
xor ebp, ebp
push 0x427664
push ebp
mov eax, esi
call fcn.0040ab4f
pop ecx
pop ecx
jmp 0x40b8ac
push str.send
jmp 0x40b814
push str.recv
jmp 0x40b814
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 0x40b8ac
mov ecx, dword [esi + 0x3c]
cmp ecx, eax
jb 0x40b87b
mov edx, dword [esi + 0x34]
cmp edx, dword [esi + 0x30]
jbe 0x40b8b2
lea eax, [esi + 0x427a]
push eax
movzx eax, word [esi + 0x2c]
push eax
push str.WARNING_:_Last_block__d_not_acked_for_file___s_
push 1
call fcn.004010eb
mov eax, dword [esi + 0x3c]
add esp, 0x10
add dword [esi + 0x4488], eax
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 + 0x44a8], ebp
je 0x40b8a4
cmp dword [esi + 0x28], ebp
jne 0x40b8a4
mov ecx, esi
call fcn.0040a945
call fcn.0040b37d
xor eax, eax
inc eax
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret
cmp ecx, eax
jb 0x40b87b
push dword [esi + 0x2c]
push str.TIMEOUT_waiting_for_Ack_block__d
push 1
call fcn.004010eb
add esp, 0xc
push ebp
mov ebx, esi
call fcn.0040a85c
pop ecx
jmp 0x40b844