Function at 0x40e50c
Capabilities:
Download and write a file
Receive and write data from server to client
Receive data
Receive data on socket
Send data
Send data on socket
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push esi
push edi
mov ebx, eax
xor edi, edi
cmp ebx, edi
jne 0x40e531
push 0x372
push str.._services_tftpd_thread.c
push str.pTftp_NULL
call fcn.00411f5e
add esp, 0xc
lea esi, [ebx + 0x4064]
cmp dword [ebp + 8], edi
jne 0x40e573
push 4
call dword [sym.imp.WS2_32.dll_htons]
push edi
mov word [esi], ax
push 4
xor eax, eax
push esi
mov word [esi + 2], ax
push dword [ebx + 0x20]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 4
je 0x40e573
push str.send
push edi
mov eax, ebx
call fcn.0040d4d1
pop ecx
pop ecx
jmp 0x40e7ab
mov dword [ebx + 0x40], edi
mov dword [ebx + 0x3c], edi
cmp dword [ebx + 0x4518], edi
je 0x40e58e
lea eax, [ebx + 0x451c]
push eax
call fcn.004107d4
pop ecx
mov esi, ebx
call fcn.0040d50a
test eax, eax
je 0x40e6ba
push edi
push 0x4004
lea esi, [ebx + 0x60]
push esi
push dword [ebx + 0x20]
call dword [sym.imp.WS2_32.dll_recv]
mov dword [ebp + 8], eax
cmp eax, edi
jle 0x40e71e
cmp eax, 4
jb 0x40e728
movzx eax, word [esi]
mov edi, dword [sym.imp.WS2_32.dll_ntohs]
push eax
call edi
cmp ax, 3
jne 0x40e742
movzx eax, word [esi + 2]
push eax
call edi
test ax, ax
jne 0x40e61c
xor eax, eax
cmp dword [ebx + 0x2c], eax
jne 0x40e61c
mov ecx, dword [ebp + 8]
add ecx, 0xfffffffc
mov dword [ebx + 0x38], ecx
cmp dword [ebx + 0x44f4], eax
jne 0x40e6d3
cmp dword [ebx + 0x40], eax
jne 0x40e6d3
push str.WARNING:_First_block_sent_by_client_is_0__should_be_1__fixed_by_Tftpd32
push 1
call fcn.0040764f
dec dword [ebx + 0x2c]
pop ecx
pop ecx
movzx eax, word [esi + 2]
push eax
call edi
mov cx, word [ebx + 0x2c]
inc cx
cmp ax, cx
jne 0x40e689
mov eax, dword [ebx + 0x3c]
add dword [ebx + 0x44f8], eax
mov eax, dword [ebp + 8]
inc dword [ebx + 0x2c]
and dword [ebx + 0x3c], 0
and dword [ebx + 0x40], 0
push 0
lea edi, [ebx + 0x38]
push edi
add eax, 0xfffffffc
push eax
add esi, 4
push esi
push dword [ebx + 0x24]
mov dword [edi], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40e764
cmp dword [ebx + 0x4518], 0
je 0x40e681
push dword [edi]
lea eax, [ebx + 0x451c]
push esi
push eax
call fcn.00410f73
add esp, 0xc
mov eax, dword [edi]
add dword [ebx + 0x44f4], eax
xor edi, edi
push 4
call dword [sym.imp.WS2_32.dll_htons]
lea esi, [ebx + 0x4064]
mov word [esi], ax
movzx eax, word [ebx + 0x2c]
push eax
call dword [sym.imp.WS2_32.dll_htons]
push edi
push 4
push esi
mov word [esi + 2], ax
push dword [ebx + 0x20]
call dword [sym.imp.WS2_32.dll_send]
jmp 0x40e6d5
mov eax, dword [ebx + 0x2c]
inc eax
push eax
push str.timeout_while_waiting_for_data_blk__d
push 9
call fcn.0040764f
add esp, 0xc
inc dword [ebx + 0x3c]
jmp 0x40e68b
xor edi, edi
mov eax, dword [ebx + 0x38]
cmp eax, dword [ebx + 0x48]
mov eax, dword [0x42bfcc]
jne 0x40e6f1
cmp dword [ebx + 0x40], 0x32
jae 0x40e6f7
cmp dword [ebx + 0x3c], eax
jb 0x40e58e
cmp dword [ebx + 0x40], 0x32
jb 0x40e770
lea eax, [ebx + 0x42ea]
push eax
mov ax, word [ebx + 0x2c]
inc ax
movzx eax, ax
push eax
push str.MAX_RETRIES_while_waiting_for_Data_block__d._file___s_
push edi
call fcn.0040764f
push edi
call fcn.0040d211
add esp, 0x14
jmp 0x40e73e
push str.recv
jmp 0x40e564
push str.rcvd_packet_too_short
push 1
call fcn.0040764f
push 4
call fcn.0040d211
add esp, 0xc
xor eax, eax
jmp 0x40e7ab
movzx eax, word [esi]
push eax
call edi
movzx eax, ax
push eax
push str.Peer_sent_unexpected_message__d
push 1
call fcn.0040764f
push 4
call fcn.0040d211
add esp, 0x10
jmp 0x40e73e
push str.write
push 3
jmp 0x40e565
cmp dword [ebx + 0x3c], eax
jb 0x40e78d
lea eax, [ebx + 0x42ea]
push eax
mov ax, word [ebx + 0x2c]
inc ax
movzx eax, ax
push eax
push str.TIMEOUT_while_waiting_for_Data_block__d__file___s_
jmp 0x40e70d
cmp dword [ebx + 0x4518], edi
je 0x40e7a1
cmp dword [ebx + 0x28], edi
jne 0x40e7a1
mov ecx, ebx
call fcn.0040d2fc
mov esi, ebx
call fcn.0040de4f
xor eax, eax
inc eax
pop edi
pop esi
pop ebx
pop ebp
ret