Function at 0x40b0ca
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 esi
mov esi, dword [esp + 0x10]
xor ebx, ebx
cmp esi, ebx
jne 0x40b0ee
push 0x358
push str.._services_tftpd_thread.c
push str.pTftp_NULL
call fcn.0040f6b6
add esp, 0xc
lea ebp, [esi + 0x4064]
cmp dword [esp + 0x14], ebx
jne 0x40b130
push 4
call dword [sym.imp.WS2_32.dll_htons]
push ebx
mov word [ebp], ax
push 4
xor eax, eax
push ebp
mov word [ebp + 2], ax
push dword [esi + 0x20]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 4
je 0x40b130
push str.send
push ebx
call fcn.0040a3bb
pop ecx
pop ecx
jmp 0x40b375
mov dword [esi + 0x40], ebx
mov dword [esi + 0x3c], ebx
cmp dword [esi + 0x44a0], ebx
je 0x40b14b
lea eax, [esi + 0x44a4]
push eax
call fcn.0040d689
pop ecx
push edi
mov eax, esi
call fcn.0040a3ef
test eax, eax
je 0x40b277
push ebx
push 0x4004
lea edi, [esi + 0x60]
push edi
push dword [esi + 0x20]
call dword [sym.imp.WS2_32.dll_recv]
mov ebx, eax
test ebx, ebx
jle 0x40b2cc
push esi
call fcn.004098b2
pop ecx
cmp ebx, 4
jb 0x40b2de
movzx eax, word [edi]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
cmp ax, 3
jne 0x40b2f7
movzx eax, word [edi + 2]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
test ax, ax
jne 0x40b1df
xor eax, eax
cmp dword [esi + 0x2c], eax
jne 0x40b1df
lea ecx, [ebx - 4]
mov dword [esi + 0x38], ecx
cmp dword [esi + 0x4484], eax
jne 0x40b290
cmp dword [esi + 0x40], eax
jne 0x40b290
push str.WARNING:_First_block_sent_by_client_is_0__should_be_1__fixed_by_Tftpd32
push 1
call fcn.004010eb
dec dword [esi + 0x2c]
pop ecx
pop ecx
movzx eax, word [edi + 2]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
mov cx, word [esi + 0x2c]
inc cx
cmp ax, cx
jne 0x40b24d
mov eax, dword [esi + 0x3c]
add dword [esi + 0x4488], eax
inc dword [esi + 0x2c]
and dword [esi + 0x3c], 0
and dword [esi + 0x40], 0
lea eax, [ebx - 4]
push 0
lea ebx, [esi + 0x38]
push ebx
push eax
add edi, 4
push edi
push dword [esi + 0x24]
mov dword [ebx], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40b31e
cmp dword [esi + 0x44a0], 0
je 0x40b245
push dword [ebx]
lea eax, [esi + 0x44a4]
push edi
push eax
call fcn.0040de0c
add esp, 0xc
mov eax, dword [ebx]
add dword [esi + 0x4484], eax
xor ebx, ebx
mov edi, dword [sym.imp.WS2_32.dll_htons]
push 4
call edi
mov word [ebp], ax
movzx eax, word [esi + 0x2c]
push eax
call edi
push ebx
push 4
push ebp
mov word [ebp + 2], ax
push dword [esi + 0x20]
call dword [sym.imp.WS2_32.dll_send]
jmp 0x40b292
mov eax, dword [esi + 0x2c]
inc eax
push eax
push str.timeout_while_waiting_for_data_blk__d
push 9
call fcn.004010eb
add esp, 0xc
inc dword [esi + 0x3c]
jmp 0x40b24f
xor ebx, ebx
mov eax, dword [esi + 0x38]
cmp eax, dword [esi + 0x48]
mov eax, dword [0x429bec]
jne 0x40b2ae
cmp dword [esi + 0x40], 0x32
jae 0x40b2b4
cmp dword [esi + 0x3c], eax
jb 0x40b14c
cmp dword [esi + 0x40], 0x32
jb 0x40b327
lea eax, [esi + 0x427a]
push eax
mov ax, word [esi + 0x2c]
inc ax
movzx eax, ax
push eax
push str.MAX_RETRIES_while_waiting_for_Data_block__d._file___s_
jmp 0x40b342
push str.recv
push 0
call fcn.0040a3bb
pop ecx
jmp 0x40b373
push str.rcvd_packet_too_short
push 1
call fcn.004010eb
push 4
push esi
call fcn.0040a0ad
add esp, 0x10
jmp 0x40b352
movzx eax, word [edi]
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
push esi
call fcn.0040a0ad
add esp, 0x14
jmp 0x40b352
push str.write
push 3
jmp 0x40b2d3
cmp dword [esi + 0x3c], eax
jb 0x40b356
lea eax, [esi + 0x427a]
push eax
mov ax, word [esi + 0x2c]
inc ax
movzx eax, ax
push eax
push str.TIMEOUT_while_waiting_for_Data_block__d__file___s_
push ebx
call fcn.004010eb
push ebx
push esi
call fcn.0040a0ad
add esp, 0x18
xor eax, eax
jmp 0x40b374
cmp dword [esi + 0x44a0], ebx
je 0x40b36a
cmp dword [esi + 0x28], ebx
jne 0x40b36a
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