Function at 0x40b8dc
Capabilities:
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa0
mov eax, dword [0x4294a4]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov esi, ecx
mov dword [ebp - 0x7c], eax
push 8
xor eax, eax
pop ecx
lea edi, [ebp - 0xa0]
rep stosd dword es:[edi], eax
mov eax, dword [0x42c320]
xor ecx, ecx
mov ebx, edx
mov dword [ebp - 0x80], ebx
cmp eax, ecx
je 0x40b936
cmp dword [0x42c324], ecx
jne 0x40b93e
cmp dword [ebp + 0xc], 0x17
je 0x40b92a
cmp dword [ebp + 0xc], ecx
jne 0x40b959
mov dword [ebp - 0x9c], 2
jmp 0x40b962
cmp dword [0x42c324], ecx
je 0x40b959
cmp eax, ecx
jne 0x40b959
cmp dword [ebp + 0xc], 2
je 0x40b94d
cmp dword [ebp + 0xc], ecx
jne 0x40b959
mov dword [ebp - 0x9c], 0x17
jmp 0x40b962
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x9c], eax
mov eax, dword [ebp + 0x10]
push dword [ebp + 0x14]
mov dword [ebp - 0x98], eax
xor edi, edi
lea eax, [ebp - 0x70]
push 0x42baa4
inc edi
push eax
mov dword [ebp - 0xa0], edi
call dword [sym.imp.USER32.dll_wsprintfA]
mov eax, dword [ebp + 0x14]
add esp, 0xc
mov ecx, esi
cmp eax, dword [ebp + 0x18]
je 0x40b996
lea ecx, [ebp - 0x70]
test ebx, ebx
je 0x40b9a3
cmp byte [ebx], 0
je 0x40b9a3
mov eax, ebx
jmp 0x40b9a5
xor eax, eax
lea edx, [ebp - 0x78]
push edx
lea edx, [ebp - 0xa0]
push edx
push ecx
push eax
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
je 0x40b9de
call fcn.004104c7
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x42baa8
call fcn.00407736
add esp, 0xc
or eax, 0xffffffff
jmp 0x40bb75
mov eax, dword [ebp - 0x78]
push dword [eax + 0xc]
push dword [eax + 8]
push dword [eax + 4]
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40ba0b
call fcn.004104c7
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error_:_Cant_create_socket_nError__d___s_
jmp 0x40b9ce
cmp dword [ebp + 0x10], 2
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
jne 0x40ba4b
push 4
lea eax, [ebp - 0x74]
push eax
push 4
push 0xffff
push ebx
mov dword [ebp - 0x74], edi
call esi
test eax, eax
mov eax, str.Port__d_may_be_reused_n
je 0x40ba38
mov eax, str.setsockopt_error_n
mov ecx, dword [ebp - 0x78]
mov ecx, dword [ecx + 0x18]
movzx ecx, word [ecx + 2]
push ecx
push eax
call fcn.00410209
pop ecx
pop ecx
cmp dword [ebp + 0xc], 0
jne 0x40ba62
and dword [ebp - 0x74], 0
push 4
lea eax, [ebp - 0x74]
push eax
push 0x1b
push 0x29
push ebx
call esi
mov eax, dword [ebp - 0x78]
push dword [eax + 0x10]
push dword [eax + 0x18]
push ebx
call dword [sym.imp.WS2_32.dll_bind]
mov dword [ebp - 0x74], eax
cmp eax, 0xffffffff
jne 0x40bb62
mov eax, dword [0x42bb2c]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x50], eax
mov eax, dword [0x42bb30]
mov dword [ebp - 0x4c], eax
push 8
xor eax, eax
pop ecx
lea edi, [ebp - 0x48]
rep stosd dword es:[edi], eax
mov eax, dword [0x42bb34]
mov dword [ebp - 0x28], eax
mov eax, dword [0x42bb38]
mov dword [ebp - 0x24], eax
push 6
pop ecx
xor eax, eax
lea edi, [ebp - 0x20]
rep stosd dword es:[edi], eax
call esi
push 0xa
push 0x20
mov edi, eax
lea eax, [ebp - 0x28]
push eax
push 0x28
lea eax, [ebp - 0x50]
push eax
mov eax, dword [ebp - 0x78]
push dword [eax + 0x10]
push dword [eax + 0x18]
call dword [sym.imp.WS2_32.dll_getnameinfo]
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
call esi
sub eax, 0x2726
je 0x40bb2d
sub eax, 0x1a
je 0x40bb2d
dec eax
je 0x40bb09
call fcn.004104c7
push eax
call esi
push eax
push str.Bind_error__d_n_s
call fcn.00407736
add esp, 0xc
jmp 0x40bb46
push dword [ebp - 0x80]
push dword [ebp - 0x7c]
push dword [ebp - 0x80]
push dword [ebp - 0x7c]
call fcn.004104c7
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.00407736
add esp, 0x1c
jmp 0x40bb46
push dword [ebp - 0x7c]
call fcn.004104c7
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.00407736
add esp, 0x10
push ebx
call dword [sym.imp.WS2_32.dll_closesocket]
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x50]
push eax
push str.bind_port_to__s_port__s_failed_n
call fcn.00410209
add esp, 0xc
push dword [ebp - 0x78]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
or eax, 0xffffffff
cmp dword [ebp - 0x74], eax
je 0x40bb75
mov eax, ebx
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00411a98
leave
ret