Function at 0x408485
Capabilities:
Create udp socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x42a2e4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push esi
push 0
push dword [ebp + 0xc]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp + 0x18]
push 2
mov esi, ecx
mov dword [ebp - 0x20], eax
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
jne 0x4084db
call fcn.0040cc32
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error_:_Cant_create_socket_nError__d___s_
call fcn.004011e3
add esp, 0xc
or eax, 0xffffffff
jmp 0x40864c
cmp dword [0x42b848], 0
je 0x40852d
push str.tftp
push esi
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
jne 0x40852d
push 4
lea eax, [ebp - 0x24]
push eax
push 4
push 0xffff
push dword [ebp - 0x18]
mov dword [ebp - 0x24], 1
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
mov eax, str.Port__d_may_be_reused
je 0x40851f
mov eax, 0x426974
push dword [0x42b5b8]
push eax
call fcn.0040cc99
pop ecx
pop ecx
push edi
xor eax, eax
lea edi, [ebp - 0x14]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov edi, dword [sym.imp.WS2_32.dll_htons]
push 2
pop eax
mov word [ebp - 0x14], ax
mov eax, dword [ebp + 0x10]
cmp eax, dword [ebp + 0x14]
je 0x40854f
push eax
jmp 0x408574
cmp dword [ebp + 0xc], 2
mov eax, 0x425704
je 0x40855f
mov eax, 0x426988
push eax
push esi
call dword [sym.imp.WS2_32.dll_getservbyname]
test eax, eax
je 0x408571
mov ax, word [eax + 8]
jmp 0x408576
push dword [ebp + 0x14]
call edi
mov word [ebp - 0x12], ax
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x408592
cmp byte [eax], 0
je 0x408592
push eax
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [ebp - 0x10], eax
jmp 0x408596
and dword [ebp - 0x10], 0
push 0x10
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x18]
call dword [sym.imp.WS2_32.dll_bind]
cmp eax, 0xffffffff
jne 0x408648
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
sub eax, 0x2726
je 0x408601
sub eax, 0x1a
je 0x408601
dec eax
je 0x4085dd
call fcn.0040cc32
push eax
call esi
push eax
push str.Bind_error__d_n_s
call fcn.004011e3
add esp, 0xc
jmp 0x40861a
push dword [ebp - 0x20]
push dword [ebp - 0x1c]
push dword [ebp - 0x20]
push dword [ebp - 0x1c]
call fcn.0040cc32
push eax
call esi
push eax
push str.Error__d_n_s_n_nTftpd32_tried_to_bind_the__s_port_nto_the_interface__s_nwhich_is_not_available_for_this_host_nEither_remove_the__s_service_or_suppress__s_interface_assignation
call fcn.004011e3
add esp, 0x1c
jmp 0x40861a
push dword [ebp - 0x1c]
call fcn.0040cc32
push eax
call esi
push eax
push str.Error__d_n_s_n_nTftpd32_can_not_bind_the__s_port_nan_application_is_already_listening_on_this_port
call fcn.004011e3
add esp, 0x10
push dword [ebp - 0x18]
call dword [sym.imp.WS2_32.dll_closesocket]
push dword [ebp - 0x12]
call edi
movzx eax, ax
push eax
push dword [ebp - 0x10]
call dword [sym.imp.WS2_32.dll_inet_ntoa]
push eax
push str.bind_port_to__s_port__d_failed_n
call fcn.0040cc99
add esp, 0xc
or eax, 0xffffffff
jmp 0x40864b
mov eax, dword [ebp - 0x18]
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop esi
call fcn.0040e92f
leave
ret