Function at 0x402953
Capabilities:
Create udp socket
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
mov eax, 0x2fa58
call fcn.00403c50
sub esp, eax
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 0x10]
imul edx, edx, 0xac
add edx, 0x409140
mov dword [edx + 8], eax
mov dword [ebp - 0x74], 0x10
mov dword [ebp - 0x14], 0x10
mov eax, dword [ebp - 0x10]
imul eax, eax, 0xac
add eax, 0x4090a0
mov edx, dword [eax]
mov dword [ebp - 0x70], edx
mov edx, dword [eax + 4]
mov dword [ebp - 0x6c], edx
mov edx, dword [eax + 8]
mov dword [ebp - 0x68], edx
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x64], eax
mov dword [ebp - 0xc], 0
mov eax, dword [ebp - 0x10]
imul eax, eax, 0xac
add eax, 0x409130
mov eax, dword [eax + 0xc]
mov dword [ebp - 0x18], 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 - 0x1c], eax
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x402a0b
mov dword [esp], str.Socket_creation_Failed_
call sym._puts
mov eax, 1
jmp 0x403073
mov word [ebp - 0x50], 2
mov dword [esp], 0
call sym._htonl_4
sub esp, 4
mov dword [ebp - 0x4c], eax
mov word [ebp - 0x4e], 0
mov dword [esp + 8], 0x10
lea eax, [ebp - 0x50]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._bind_12
sub esp, 0xc
cmp eax, 0xffffffff
jne 0x402a6f
mov dword [esp], str.Socket_bind_Failed_
call sym._puts
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov eax, 1
jmp 0x403073
mov eax, dword [ebp - 0x10]
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
je 0x402b45
mov eax, dword [ebp - 0x10]
imul eax, eax, 0xac
add eax, 0x10
add eax, 0x4090a0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x10]
mov dword [esp + 4], eax
mov dword [esp], str.Session__d_:_File__s_is_already_exists_in_the_current_directory._n
call sym._printf
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x70]
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.File_already_exits
mov dword [esp + 4], 6
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._send_error
mov eax, dword [ebp - 0xfe60]
test eax, eax
je 0x402b02
mov eax, dword [ebp - 0xfe60]
mov dword [esp], eax
call sym._fclose
cmp dword [ebp - 0x1c], 0xffffffff
je 0x402b16
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [eax*4 + 0x409020], 0
mov eax, dword [0x40902c]
sub eax, 1
mov dword [0x40902c], eax
mov dword [0x409030], 0
mov eax, 0
jmp 0x403073
mov eax, dword [ebp - 0x10]
imul eax, eax, 0xac
add eax, 0x409120
mov eax, dword [eax]
test eax, eax
je 0x402c25
mov dword [esp + 8], 0xfde8
mov dword [esp + 4], 0
lea eax, [ebp - 0x1fc48]
mov dword [esp], eax
call sym._memset
lea eax, [ebp - 0x1fc48]
mov dword [ebp - 0x20], eax
mov dword [esp], 6
call sym._htons_4
sub esp, 4
mov edx, eax
mov eax, dword [ebp - 0x20]
mov word [eax], dx
mov eax, dword [ebp - 0x10]
imul eax, eax, 0xac
add eax, 0x409130
mov eax, dword [eax + 8]
mov edx, dword [ebp - 0x10]
imul edx, edx, 0xac
add edx, 0x40
add edx, 0x4090a0
lea ecx, [edx + 0xc]
mov edx, dword [ebp - 0x20]
add edx, 2
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], edx
call sym._memcpy
mov eax, dword [ebp - 0x10]
imul eax, eax, 0xac
add eax, 0x409130
mov eax, dword [eax + 8]
add eax, 2
mov edx, eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x70]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], edx
lea eax, [ebp - 0x1fc48]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._sendto_24
sub esp, 0x18
add dword [ebp - 0xc], 1
jmp 0x402c6a
mov dword [esp + 8], 0xfde8
mov dword [esp + 4], 0
lea eax, [ebp - 0x1fc48]
mov dword [esp], eax
call sym._memset
mov eax, dword [ebp - 0xc]
movzx eax, ax
mov edx, dword [ebp - 0x14]
mov dword [esp + 0xc], edx
lea edx, [ebp - 0x70]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._tftp_send_ack
add dword [ebp - 0xc], 1
mov eax, dword [ebp - 0x10]
imul eax, eax, 0xac
add eax, 0x10
add eax, 0x4090a0
mov dword [esp + 8], 0x4074b9
mov dword [esp + 4], eax
lea eax, [ebp - 0xfe60]
mov dword [esp], eax
call sym._fopen_s
mov eax, dword [ebp - 0xfe60]
test eax, eax
jne 0x402cab
mov dword [esp], str.file_opened_failed_
call sym._puts
mov dword [esp + 8], 0xfde8
mov dword [esp + 4], 0
lea eax, [ebp - 0x2fa30]
mov dword [esp], eax
call sym._memset
mov dword [esp + 8], 0xfde8
mov dword [esp + 4], 0
lea eax, [ebp - 0x1fc48]
mov dword [esp], eax
call sym._memset
lea eax, [ebp - 0x74]
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x60]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0xfde8
lea eax, [ebp - 0x1fc48]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._recvfrom_24
sub esp, 0x18
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x1fc48]
movzx eax, word [eax]
movzx eax, ax
mov dword [esp], eax
call sym._ntohs_4
sub esp, 4
mov word [ebp - 0x26], ax
movzx eax, word [ebp - 0x26]
test eax, eax
je 0x402fa2
cmp eax, 3
je 0x402d51
jmp 0x40306e
lea eax, [ebp - 0x1fc48]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x24]
sub eax, 4
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x2c]
movzx eax, word [eax]
movzx eax, ax
mov dword [esp], eax
call sym._ntohs_4
sub esp, 4
mov word [ebp - 0x32], ax
mov eax, dword [ebp - 0x2c]
movzx eax, word [eax + 2]
movzx eax, ax
mov dword [esp], eax
call sym._ntohs_4
sub esp, 4
mov word [ebp - 0x34], ax
mov eax, dword [ebp - 0x30]
mov edx, dword [ebp - 0x2c]
add edx, 4
mov dword [esp + 8], eax
mov dword [esp + 4], edx
lea eax, [ebp - 0x2fa30]
mov dword [esp], eax
call sym._memcpy
mov edx, dword [ebp - 0xfe60]
mov eax, dword [ebp - 0x30]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 1
lea eax, [ebp - 0x2fa30]
mov dword [esp], eax
call sym._fwrite
mov dword [esp + 8], 0xfde8
mov dword [esp + 4], 0
lea eax, [ebp - 0x1fc48]
mov dword [esp], eax
call sym._memset
lea eax, [ebp - 0x1fc48]
mov dword [ebp - 0x38], eax
mov dword [esp], 4
call sym._htons_4
sub esp, 4
mov edx, eax
mov eax, dword [ebp - 0x38]
mov word [eax], dx
movzx eax, word [ebp - 0x34]
cmp eax, dword [ebp - 0xc]
jne 0x402e40
mov eax, dword [ebp - 0xc]
movzx eax, ax
mov dword [esp], eax
call sym._htons_4
sub esp, 4
mov edx, eax
mov eax, dword [ebp - 0x38]
mov word [eax + 2], dx
jmp 0x402ef4
movzx eax, word [ebp - 0x34]
mov edx, dword [ebp - 0xc]
sub edx, 1
cmp eax, edx
jne 0x402e70
mov eax, dword [ebp - 0xc]
sub eax, 1
movzx eax, ax
mov dword [esp], eax
call sym._htons_4
sub esp, 4
mov edx, eax
mov eax, dword [ebp - 0x38]
mov word [eax + 2], dx
jmp 0x402ef4
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x10], eax
lea eax, [ebp - 0x70]
mov dword [esp + 0xc], eax
mov dword [esp + 8], str.Wrong_Data_block_send
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._send_error
mov eax, dword [ebp - 0xfe60]
test eax, eax
je 0x402eb1
mov eax, dword [ebp - 0xfe60]
mov dword [esp], eax
call sym._fclose
cmp dword [ebp - 0x1c], 0xffffffff
je 0x402ec5
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [eax*4 + 0x409020], 0
mov eax, dword [0x40902c]
sub eax, 1
mov dword [0x40902c], eax
mov dword [0x409030], 0
mov eax, 0
jmp 0x403073
mov eax, dword [ebp - 0x14]
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x70]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 4
lea eax, [ebp - 0x1fc48]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._sendto_24
sub esp, 0x18
mov eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x18]
jae 0x402f99
mov dword [esp], str.File_receiving_complete...
call sym._puts
mov eax, dword [ebp - 0xfe60]
test eax, eax
je 0x402f56
mov eax, dword [ebp - 0xfe60]
mov dword [esp], eax
call sym._fclose
cmp dword [ebp - 0x1c], 0xffffffff
je 0x402f6a
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [eax*4 + 0x409020], 0
mov eax, dword [0x40902c]
sub eax, 1
mov dword [0x40902c], eax
mov dword [0x409030], 0
mov eax, 0
jmp 0x403073
add dword [ebp - 0xc], 1
jmp 0x40306e
lea eax, [ebp - 0x1fc48]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x3c]
movzx eax, word [eax + 2]
movzx eax, ax
mov dword [esp], eax
call sym._ntohs_4
sub esp, 4
mov word [ebp - 0x3e], ax
mov eax, dword [ebp - 0x3c]
add eax, 4
mov dword [esp], eax
call sym._strlen
lea edx, [eax + 1]
mov eax, dword [ebp - 0x3c]
add eax, 4
mov dword [esp + 8], edx
mov dword [esp + 4], eax
lea eax, [ebp - 0xfe5c]
mov dword [esp], eax
call sym._memcpy
movzx eax, word [ebp - 0x3e]
lea edx, [ebp - 0xfe5c]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x10]
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 - 0xfe60]
test eax, eax
je 0x40302e
mov eax, dword [ebp - 0xfe60]
mov dword [esp], eax
call sym._fclose
cmp dword [ebp - 0x1c], 0xffffffff
je 0x403042
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._closesocket_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [eax*4 + 0x409020], 0
mov eax, dword [0x40902c]
sub eax, 1
mov dword [0x40902c], eax
mov dword [0x409030], 0
mov eax, 0
jmp 0x403073
jmp 0x402cab
leave
ret 4