Function at 0x40a71d
Capabilities:
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa0
mov eax, dword [0x427484]
xor eax, ebp
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov dword [ebp - 0x7c], eax
mov eax, dword [ebp + 0x18]
mov esi, ecx
mov dword [ebp - 0x80], eax
push 8
xor eax, eax
pop ecx
lea edi, [ebp - 0xa0]
rep stosd dword es:[edi], eax
mov eax, dword [0x429e2c]
xor ecx, ecx
mov ebx, edx
mov dword [ebp - 0x74], ebx
cmp eax, ecx
je 0x40a77d
cmp dword [0x429e30], ecx
jne 0x40a785
cmp dword [ebp + 0xc], 0x17
je 0x40a771
cmp dword [ebp + 0xc], ecx
jne 0x40a7a0
mov dword [ebp - 0x9c], 2
jmp 0x40a7a9
cmp dword [0x429e30], ecx
je 0x40a7a0
cmp eax, ecx
jne 0x40a7a0
cmp dword [ebp + 0xc], 2
je 0x40a794
cmp dword [ebp + 0xc], ecx
jne 0x40a7a0
mov dword [ebp - 0x9c], 0x17
jmp 0x40a7a9
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x9c], eax
mov eax, dword [ebp + 0x10]
push esi
mov dword [ebp - 0x98], eax
xor edi, edi
lea eax, [ebp - 0x70]
push 0x4296f0
inc edi
push eax
mov dword [ebp - 0xa0], edi
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
mov eax, ebx
cmp esi, dword [ebp + 0x14]
je 0x40a7d8
lea eax, [ebp - 0x70]
lea ecx, [ebp - 0x78]
push ecx
lea ecx, [ebp - 0xa0]
push ecx
push eax
movsx eax, byte [0x429b74]
neg eax
sbb eax, eax
and eax, 0x429b74
push eax
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
je 0x40a821
call fcn.0040e9cb
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4296f4
call fcn.004070fa
add esp, 0xc
or eax, 0xffffffff
jmp 0x40a9c8
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 0x40a84e
call fcn.0040e9cb
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error_:_Cant_create_socket_nError__d___s_
jmp 0x40a811
cmp dword [0x429e20], 0
mov esi, dword [sym.imp.WS2_32.dll_setsockopt]
je 0x40a89e
push 0x42974c
push dword [ebp - 0x74]
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
jne 0x40a89e
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
je 0x40a890
mov eax, str.setsockopt_error
push dword [0x429b48]
push eax
call fcn.0040e70d
pop ecx
pop ecx
cmp dword [ebp + 0xc], 0
jne 0x40a8b5
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 0x40a9b5
mov eax, dword [0x429780]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x50], eax
mov eax, dword [0x429784]
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 [0x429788]
mov dword [ebp - 0x28], eax
mov eax, dword [0x42978c]
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 0x40a980
sub eax, 0x1a
je 0x40a980
dec eax
je 0x40a95c
call fcn.0040e9cb
push eax
call esi
push eax
push str.Bind_error__d_n_s
call fcn.004070fa
add esp, 0xc
jmp 0x40a999
push dword [ebp - 0x80]
push dword [ebp - 0x7c]
push dword [ebp - 0x80]
push dword [ebp - 0x7c]
call fcn.0040e9cb
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.004070fa
add esp, 0x1c
jmp 0x40a999
push dword [ebp - 0x7c]
call fcn.0040e9cb
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.004070fa
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.0040e70d
add esp, 0xc
push dword [ebp - 0x78]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
or eax, 0xffffffff
cmp dword [ebp - 0x74], eax
je 0x40a9c8
mov eax, ebx
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040ffa3
leave
ret