Function at 0x40b8d6
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 ebx
push ebp
push edi
mov ebx, eax
xor edi, edi
cmp ebx, edi
jne 0x40b8f8
push 0x360
push str.._services_tftpd_thread.c
push str.pTftp_NULL
call fcn.0040fbb1
add esp, 0xc
lea ebp, [ebx + 0x4064]
cmp dword [esp + 0x10], edi
jne 0x40b93c
push 4
call dword [sym.imp.WS2_32.dll_htons]
push edi
mov word [ebp], ax
push 4
xor eax, eax
push ebp
mov word [ebp + 2], ax
push dword [ebx + 0x20]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 4
je 0x40b93c
push str.send
push edi
mov eax, ebx
call fcn.0040ab4f
pop ecx
pop ecx
jmp 0x40bb77
mov dword [ebx + 0x40], edi
mov dword [ebx + 0x3c], edi
cmp dword [ebx + 0x44a8], edi
je 0x40b957
lea eax, [ebx + 0x44ac]
push eax
call fcn.0040dfbc
pop ecx
push esi
mov esi, ebx
call fcn.0040ab86
test eax, eax
je 0x40ba7c
push edi
push 0x4004
lea esi, [ebx + 0x60]
push esi
push dword [ebx + 0x20]
call dword [sym.imp.WS2_32.dll_recv]
mov edi, eax
test edi, edi
jle 0x40bad1
cmp edi, 4
jb 0x40bada
movzx eax, word [esi]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
cmp ax, 3
jne 0x40baf2
movzx eax, word [esi + 2]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
test ax, ax
jne 0x40b9e4
xor eax, eax
cmp dword [ebx + 0x2c], eax
jne 0x40b9e4
lea ecx, [edi - 4]
mov dword [ebx + 0x38], ecx
cmp dword [ebx + 0x4484], eax
jne 0x40ba95
cmp dword [ebx + 0x40], eax
jne 0x40ba95
push str.WARNING:_First_block_sent_by_client_is_0__should_be_1__fixed_by_Tftpd32
push 1
call fcn.004010eb
dec dword [ebx + 0x2c]
pop ecx
pop ecx
movzx eax, word [esi + 2]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
mov cx, word [ebx + 0x2c]
inc cx
cmp ax, cx
jne 0x40ba52
mov eax, dword [ebx + 0x3c]
add dword [ebx + 0x4488], eax
inc dword [ebx + 0x2c]
and dword [ebx + 0x3c], 0
and dword [ebx + 0x40], 0
lea eax, [edi - 4]
push 0
lea edi, [ebx + 0x38]
push edi
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 0x40bb18
cmp dword [ebx + 0x44a8], 0
je 0x40ba4a
push dword [edi]
lea eax, [ebx + 0x44ac]
push esi
push eax
call fcn.0040e73f
add esp, 0xc
mov eax, dword [edi]
add dword [ebx + 0x4484], eax
xor edi, edi
mov esi, dword [sym.imp.WS2_32.dll_htons]
push 4
call esi
mov word [ebp], ax
movzx eax, word [ebx + 0x2c]
push eax
call esi
push edi
push 4
push ebp
mov word [ebp + 2], ax
push dword [ebx + 0x20]
call dword [sym.imp.WS2_32.dll_send]
jmp 0x40ba97
mov eax, dword [ebx + 0x2c]
inc eax
push eax
push str.timeout_while_waiting_for_data_blk__d
push 9
call fcn.004010eb
add esp, 0xc
inc dword [ebx + 0x3c]
jmp 0x40ba54
xor edi, edi
mov eax, dword [ebx + 0x38]
cmp eax, dword [ebx + 0x48]
mov eax, dword [0x42b5ac]
jne 0x40bab3
cmp dword [ebx + 0x40], 0x32
jae 0x40bab9
cmp dword [ebx + 0x3c], eax
jb 0x40b958
cmp dword [ebx + 0x40], 0x32
jb 0x40bb2a
lea eax, [ebx + 0x427a]
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_
jmp 0x40bb45
push str.recv
push 0
jmp 0x40bb1f
push str.rcvd_packet_too_short
push 1
call fcn.004010eb
push 4
call fcn.0040a85c
add esp, 0xc
jmp 0x40bb54
movzx eax, word [esi]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
push eax
push str.Peer_sent_unexpected_message__d
push 1
call fcn.004010eb
push 4
call fcn.0040a85c
add esp, 0x10
jmp 0x40bb54
push str.write
push 3
mov eax, ebx
call fcn.0040ab4f
pop ecx
pop ecx
jmp 0x40bb76
cmp dword [ebx + 0x3c], eax
jb 0x40bb58
lea eax, [ebx + 0x427a]
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_
push edi
call fcn.004010eb
push edi
call fcn.0040a85c
add esp, 0x14
xor eax, eax
jmp 0x40bb76
cmp dword [ebx + 0x44a8], edi
je 0x40bb6c
cmp dword [ebx + 0x28], edi
jne 0x40bb6c
mov ecx, ebx
call fcn.0040a945
mov esi, ebx
call fcn.0040b37d
xor eax, eax
inc eax
pop esi
pop edi
pop ebp
pop ebx
ret