Function at 0x4020cb
Capabilities:
Create udp socket
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 ebp
mov ebp, esp
push edi
push esi
push ebx
mov eax, 0x2fa6c
call fcn.00403c50
sub esp, eax
mov eax, esp
mov edi, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x2c]
imul edx, edx, 0xac
add edx, 0x409140
mov dword [edx + 8], eax
mov dword [ebp - 0x98], 0x10
mov dword [ebp - 0x30], 0x10
mov eax, dword [ebp - 0x2c]
imul eax, eax, 0xac
add eax, 0x4090a0
mov edx, dword [eax]
mov dword [ebp - 0x94], edx
mov edx, dword [eax + 4]
mov dword [ebp - 0x90], edx
mov edx, dword [eax + 8]
mov dword [ebp - 0x8c], edx
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x88], eax
mov dword [ebp - 0x20], 1
mov eax, dword [ebp - 0x2c]
imul eax, eax, 0xac
add eax, 0x409130
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x34], eax
mov dword [esp + 8], 0x11
mov dword [esp + 4], 2
mov dword [esp], 2
call sym._socket_12
sub esp, 0xc
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0xffffffff
jne 0x402199
mov dword [esp], str.Socket_creation_Failed_
call sym._puts
mov eax, 1
jmp 0x402947
mov word [ebp - 0x74], 2
mov dword [esp], 0
call sym._htonl_4
sub esp, 4
mov dword [ebp - 0x70], eax
mov word [ebp - 0x72], 0
mov dword [esp + 8], 0x10
lea eax, [ebp - 0x74]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._bind_12
sub esp, 0xc
cmp eax, 0xffffffff
jne 0x4021fd
mov dword [esp], str.Socket_bind_Failed_
call sym._puts
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov eax, 1
jmp 0x402947
mov eax, dword [ebp - 0x2c]
imul eax, eax, 0xac
add eax, 0x10
add eax, 0x4090a0
mov dword [esp + 4], 0
mov dword [esp], eax
call sym.__access
cmp eax, 0xffffffff
jne 0x4022cc
mov eax, dword [ebp - 0x2c]
imul eax, eax, 0xac
add eax, 0x10
add eax, 0x4090a0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], eax
mov dword [esp], str.Session__d_:_File__s_does_not_exist_in_the_current_directory._n
call sym._printf
mov eax, dword [ebp - 0x30]
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x94]
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.File_not_exits
mov dword [esp + 4], 1
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._send_error
mov eax, dword [ebp - 0x2fa54]
test eax, eax
je 0x402293
mov eax, dword [ebp - 0x2fa54]
mov dword [esp], eax
call sym._fclose
cmp dword [ebp - 0x38], 0xffffffff
je 0x4022a7
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov eax, dword [ebp - 0x2c]
mov dword [eax*4 + 0x409020], 0
mov eax, dword [0x40902c]
sub eax, 1
mov dword [0x40902c], eax
mov eax, 0
jmp 0x402947
mov eax, dword [ebp - 0x2c]
imul eax, eax, 0xac
add eax, 0x10
add eax, 0x4090a0
mov dword [esp + 8], 0x4073b6
mov dword [esp + 4], eax
lea eax, [ebp - 0x2fa54]
mov dword [esp], eax
call sym._fopen_s
mov eax, dword [ebp - 0x2fa54]
test eax, eax
jne 0x40230d
mov dword [esp], str.file_opened_failed_
call sym._puts
mov eax, dword [ebp - 0x2c]
imul eax, eax, 0xac
add eax, 0x409120
mov eax, dword [eax]
test eax, eax
je 0x402467
mov dword [esp + 8], 0xfde8
mov dword [esp + 4], 0
lea eax, [ebp - 0x1fc68]
mov dword [esp], eax
call sym._memset
lea eax, [ebp - 0x1fc68]
mov dword [ebp - 0x3c], eax
mov dword [esp], 6
call sym._htons_4
sub esp, 4
mov edx, eax
mov eax, dword [ebp - 0x3c]
mov word [eax], dx
mov eax, dword [ebp - 0x2c]
imul eax, eax, 0xac
add eax, 0x409130
mov eax, dword [eax + 8]
mov edx, dword [ebp - 0x2c]
imul edx, edx, 0xac
add edx, 0x40
add edx, 0x4090a0
lea ecx, [edx + 0xc]
mov edx, dword [ebp - 0x3c]
add edx, 2
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], edx
call sym._memcpy
mov eax, dword [ebp - 0x2c]
imul eax, eax, 0xac
add eax, 0x409130
mov eax, dword [eax + 8]
add eax, 2
mov edx, eax
mov eax, dword [ebp - 0x30]
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x94]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], edx
lea eax, [ebp - 0x1fc68]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._sendto_24
sub esp, 0x18
mov dword [esp + 8], 0xfde8
mov dword [esp + 4], 0
lea eax, [ebp - 0x1fc68]
mov dword [esp], eax
call sym._memset
lea eax, [ebp - 0x98]
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x84]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0xfde8
lea eax, [ebp - 0x1fc68]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._recvfrom_24
sub esp, 0x18
cmp eax, 0xffffffff
jne 0x40245e
call sym._WSAGetLastError_0
mov dword [esp + 4], eax
mov dword [esp], str.recvfrom_failed_with_error:__d_n
call sym._printf
lea eax, [ebp - 0x1fc68]
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x24], 0
mov eax, dword [ebp - 0x34]
lea ebx, [eax + 0x64]
mov eax, ebx
sub eax, 1
mov dword [ebp - 0x44], eax
mov eax, 0x10
sub eax, 1
add eax, ebx
mov ecx, 0x10
mov edx, 0
div ecx
imul eax, eax, 0x10
call fcn.00403c50
sub esp, eax
lea eax, [esp + 0x18]
add eax, 0
mov dword [ebp - 0x48], eax
mov eax, 0xc800
mov edx, 0
div dword [ebp - 0x34]
mov dword [ebp - 0x4c], eax
mov eax, dword [ebp - 0x4c]
imul eax, dword [ebp - 0x34]
mov dword [ebp - 0x4c], eax
mov dword [esp + 8], 0xfde8
mov dword [esp + 4], 0
lea eax, [ebp - 0x1fc68]
mov dword [esp], eax
call sym._memset
cmp dword [ebp - 0x24], 0
jne 0x402535
mov dword [esp + 8], 0xfde8
mov dword [esp + 4], 0
lea eax, [ebp - 0x2fa50]
mov dword [esp], eax
call sym._memset
lea eax, [ebp - 0x2fa50]
mov dword [ebp - 0x28], eax
mov edx, dword [ebp - 0x2fa54]
mov eax, dword [ebp - 0x4c]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 1
lea eax, [ebp - 0x2fa50]
mov dword [esp], eax
call sym._fread
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x34]
jb 0x40254e
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x24]
sub eax, dword [ebp - 0x34]
mov dword [ebp - 0x24], eax
jmp 0x40255b
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x24], 0
mov eax, dword [ebp - 0x48]
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._memset
mov eax, dword [ebp - 0x48]
mov edx, dword [ebp - 0x1c]
mov dword [esp + 8], edx
mov edx, dword [ebp - 0x28]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._memcpy
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 0x20]
movzx eax, ax
mov esi, dword [ebp - 0x30]
mov dword [esp + 0x14], esi
lea esi, [ebp - 0x94]
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._tftp_send_data
mov eax, dword [ebp - 0x1c]
add dword [ebp - 0x28], eax
mov dword [esp + 8], 0xfde8
mov dword [esp + 4], 0
lea eax, [ebp - 0x1fc68]
mov dword [esp], eax
call sym._memset
lea eax, [ebp - 0x98]
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x84]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0xfde8
lea eax, [ebp - 0x1fc68]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._recvfrom_24
sub esp, 0x18
cmp eax, 0xffffffff
jne 0x40268a
call sym._WSAGetLastError_0
mov dword [esp + 4], eax
mov dword [esp], str.recvfrom_failed_with_error:__d_n
call sym._printf
mov eax, dword [ebp - 0x2fa54]
test eax, eax
je 0x402651
mov eax, dword [ebp - 0x2fa54]
mov dword [esp], eax
call sym._fclose
cmp dword [ebp - 0x38], 0xffffffff
je 0x402665
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov eax, dword [ebp - 0x2c]
mov dword [eax*4 + 0x409020], 0
mov eax, dword [0x40902c]
sub eax, 1
mov dword [0x40902c], eax
mov eax, 0
jmp 0x402947
lea eax, [ebp - 0x1fc68]
movzx eax, word [eax]
movzx eax, ax
mov dword [esp], eax
call sym._ntohs_4
sub esp, 4
mov word [ebp - 0x4e], ax
movzx eax, word [ebp - 0x4e]
test eax, eax
je 0x40287f
cmp eax, 4
je 0x4026bb
jmp 0x402942
lea eax, [ebp - 0x1fc68]
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x54]
movzx eax, word [eax + 2]
movzx eax, ax
mov dword [esp], eax
call sym._ntohs_4
sub esp, 4
mov word [ebp - 0x56], ax
movzx eax, word [ebp - 0x56]
cmp eax, dword [ebp - 0x20]
jne 0x4026fb
add dword [ebp - 0x20], 1
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x34]
jae 0x402941
jmp 0x40280d
movzx eax, word [ebp - 0x56]
mov edx, dword [ebp - 0x20]
sub edx, 1
cmp eax, edx
jne 0x402790
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 0x20]
movzx eax, ax
mov esi, dword [ebp - 0x30]
mov dword [esp + 0x14], esi
lea esi, [ebp - 0x94]
mov dword [esp + 0x10], esi
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._tftp_send_data
mov eax, dword [ebp - 0x5c]
movzx eax, word [eax + 2]
movzx eax, ax
mov dword [esp], eax
call sym._ntohs_4
sub esp, 4
movzx esi, ax
mov eax, dword [ebp - 0x5c]
movzx eax, word [eax]
movzx eax, ax
mov dword [esp], eax
call sym._ntohs_4
sub esp, 4
movzx eax, ax
mov dword [esp + 0xc], esi
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], eax
mov dword [esp], str.Session__d_:_Retransmiting_packet_type:__d___data_block_:__d_n
call sym._printf
jmp 0x402942
mov eax, dword [ebp - 0x30]
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x94]
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.Wrong_block_acknoledgement
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._send_error
mov eax, dword [ebp - 0x2fa54]
test eax, eax
je 0x4027d4
mov eax, dword [ebp - 0x2fa54]
mov dword [esp], eax
call sym._fclose
cmp dword [ebp - 0x38], 0xffffffff
je 0x4027e8
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov eax, dword [ebp - 0x2c]
mov dword [eax*4 + 0x409020], 0
mov eax, dword [0x40902c]
sub eax, 1
mov dword [0x40902c], eax
mov eax, 0
jmp 0x402947
mov eax, dword [ebp - 0x2c]
imul eax, eax, 0xac
add eax, 0x10
add eax, 0x4090a0
mov dword [esp + 4], eax
mov dword [esp], str._s_transfer_complete....._n
call sym._printf
mov eax, dword [ebp - 0x2fa54]
test eax, eax
je 0x402846
mov eax, dword [ebp - 0x2fa54]
mov dword [esp], eax
call sym._fclose
cmp dword [ebp - 0x38], 0xffffffff
je 0x40285a
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov eax, dword [ebp - 0x2c]
mov dword [eax*4 + 0x409020], 0
mov eax, dword [0x40902c]
sub eax, 1
mov dword [0x40902c], eax
mov eax, 0
jmp 0x402947
lea eax, [ebp - 0x1fc68]
mov dword [ebp - 0x60], eax
mov eax, dword [ebp - 0x60]
movzx eax, word [eax + 2]
movzx eax, ax
mov dword [esp], eax
call sym._ntohs_4
sub esp, 4
mov word [ebp - 0x62], ax
mov eax, dword [ebp - 0x60]
add eax, 4
mov dword [esp], eax
call sym._strlen
lea edx, [eax + 1]
mov eax, dword [ebp - 0x60]
add eax, 4
mov dword [esp + 8], edx
mov dword [esp + 4], eax
lea eax, [ebp - 0xfe80]
mov dword [esp], eax
call sym._memcpy
movzx eax, word [ebp - 0x62]
lea edx, [ebp - 0xfe80]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 4], eax
mov dword [esp], str.Session__d_:_Error_Code_:__d_and_Error_Message:__s_n
call sym._printf
mov eax, dword [ebp - 0x2fa54]
test eax, eax
je 0x40290b
mov eax, dword [ebp - 0x2fa54]
mov dword [esp], eax
call sym._fclose
cmp dword [ebp - 0x38], 0xffffffff
je 0x40291f
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov eax, dword [ebp - 0x2c]
mov dword [eax*4 + 0x409020], 0
mov eax, dword [0x40902c]
sub eax, 1
mov dword [0x40902c], eax
mov eax, 0
jmp 0x402947
nop
jmp 0x4024c0
mov esp, edi
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 4