Function at 0x100124ef
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, ecx
push edi
mov edi, edx
test esi, esi
jne 0x10012513
push 0x372
push str._services_tftpd_thread.c
push str.pTftp_NULL
call dword [sym.imp.MSVCR120.dll__wassert]
add esp, 0xc
xor ebp, ebp
lea ebx, [esi + 0x4064]
test edi, edi
jne 0x10012556
push 4
call dword [sym.imp.WS2_32.dll_htons]
push ebp
mov word [ebx], ax
xor eax, eax
push 4
push ebx
mov word [ebx + 2], ax
push dword [esi + 0x20]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 4
je 0x10012556
push str.send
xor edx, edx
mov ecx, esi
call fcn.10011651
pop ecx
jmp 0x10012788
mov dword [esi + 0x40], ebp
mov dword [esi + 0x3c], ebp
cmp dword [esi + 0x44a0], ebp
je 0x10012571
lea eax, [esi + 0x44a4]
push eax
call fcn.10015129
pop ecx
mov ecx, esi
call fcn.1001168c
test eax, eax
je 0x10012672
push ebp
push 0x4004
lea edi, [esi + 0x60]
push edi
push dword [esi + 0x20]
call dword [sym.imp.WS2_32.dll_recv]
mov ebp, eax
test ebp, ebp
jle 0x10012743
cmp ebp, 4
jb 0x10012727
movzx eax, word [edi]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
push 3
pop ecx
cmp ax, cx
jne 0x10012708
movzx eax, word [edi + 2]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
test ax, ax
jne 0x10012600
cmp dword [esi + 0x2c], 0
jne 0x10012600
cmp dword [esi + 0x4484], 0
lea eax, [ebp - 4]
mov dword [esi + 0x38], eax
jne 0x100126b2
cmp dword [esi + 0x40], 0
jne 0x100126b2
push str.WARNING:_First_block_sent_by_client_is_0__should_be_1__fixed_by_Tftpd32
push 1
call fcn.10001113
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 0x10012689
mov eax, dword [esi + 0x3c]
xor ecx, ecx
add dword [esi + 0x4488], eax
add edi, 4
inc dword [esi + 0x2c]
lea eax, [ebp - 4]
push ecx
lea ebp, [esi + 0x38]
mov dword [esi + 0x3c], ecx
push ebp
push eax
push edi
push dword [esi + 0x24]
mov dword [esi + 0x40], ecx
mov dword [ebp], eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x100126f9
cmp dword [esi + 0x44a0], 0
je 0x10012667
push dword [ebp]
lea eax, [esi + 0x44a4]
push edi
push eax
call fcn.10015850
add esp, 0xc
mov eax, dword [ebp]
add dword [esi + 0x4484], eax
jmp 0x10012689
mov eax, dword [esi + 0x2c]
inc eax
push eax
push str.timeout_while_waiting_for_data_blk__d
push 9
call fcn.10001113
add esp, 0xc
inc dword [esi + 0x3c]
mov ebp, dword [sym.imp.WS2_32.dll_htons]
push 4
call ebp
mov word [ebx], ax
movzx eax, word [esi + 0x2c]
push eax
call ebp
xor ebp, ebp
mov word [ebx + 2], ax
push ebp
push 4
push ebx
push dword [esi + 0x20]
call dword [sym.imp.WS2_32.dll_send]
jmp 0x100126b4
xor ebp, ebp
mov eax, dword [esi + 0x38]
cmp eax, dword [esi + 0x48]
mov eax, dword [0x1001fd04]
jne 0x100126d0
cmp dword [esi + 0x40], 0x32
jae 0x100126d6
cmp dword [esi + 0x3c], eax
jb 0x10012571
cmp dword [esi + 0x40], 0x32
jb 0x1001274d
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_
push ebp
call fcn.10001113
add esp, 0x10
xor edx, edx
jmp 0x10012738
push str.write
push 3
pop eax
mov edx, eax
jmp 0x10012549
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.10001113
add esp, 0xc
jmp 0x10012735
push str.rcvd_packet_too_short
push 1
call fcn.10001113
pop ecx
pop ecx
push 4
pop edx
mov ecx, esi
call fcn.1001131c
xor eax, eax
jmp 0x10012788
push str.recv
jmp 0x10012547
cmp dword [esi + 0x3c], eax
jb 0x1001276a
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_
jmp 0x100126ec
cmp dword [esi + 0x44a0], ebp
je 0x1001277e
cmp dword [esi + 0x28], ebp
jne 0x1001277e
mov ecx, esi
call fcn.1001142f
mov ecx, esi
call fcn.10011f15
xor eax, eax
inc eax
pop edi
pop esi
pop ebp
pop ebx
ret