Function at 0x408a70
Capabilities:
Resolve dns

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
cmp dword [0x45cf18], 0
je 0x408abc
push 0x45ce28
push str.getaddrinfo
mov eax, str.wship6.dll
mov dword [0x45cf18], 0
call fcn.00407b70
mov eax, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0xc]
add esp, 8
push eax
mov eax, dword [ebp + 8]
push ecx
push edx
push eax
call dword [0x45ce28]
mov esp, ebp
pop ebp
ret 0x10
push ebx
push esi
mov dword [ebp - 4], 0x100
push edi
mov esi, dword [ebp - 4]
push esi
call dword [sym.imp.MSVCR100.dll_malloc]
mov edx, dword [ebp + 0x14]
mov edi, eax
mov eax, dword [ebp + 0x10]
lea ecx, [edi + esi]
xor esi, esi
add esp, 4
mov dword [ebp - 8], ecx
mov dword [ebp - 0xc], esi
mov dword [ebp - 0x14], esi
mov dword [edx], edi
cmp eax, esi
je 0x408b13
cmp dword [eax + 0x10], esi
jne 0x40900b
cmp dword [eax + 0x14], esi
jne 0x40900b
cmp dword [eax + 0x18], esi
jne 0x40900b
cmp dword [eax + 0x1c], esi
jne 0x40900b
cmp dword [ebp + 8], esi
jne 0x408b35
cmp dword [ebp + 0xc], esi
jne 0x408b3e
push edi
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
pop edi
pop esi
mov eax, 0x2af9
pop ebx
mov esp, ebp
pop ebp
ret 0x10
cmp dword [ebp + 0xc], esi
je 0x408c80
mov ebx, dword [ebp + 0xc]
push 0x43f02c
push ebx
call dword [sym.imp.WS2_32.dll_getservbyname]
test eax, eax
jne 0x408c00
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2af9
jg 0x408b9e
je 0x408bae
sub eax, 0x2714
je 0x409023
sub eax, 0x20
je 0x409023
sub eax, 0x39
je 0x409140
mov ecx, dword [ebp + 0x14]
mov edx, dword [ecx]
push edx
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
pop edi
pop esi
mov eax, 0x2afb
pop ebx
mov esp, ebp
pop ebp
ret 0x10
sub eax, 0x2afa
je 0x409023
sub eax, 2
jne 0x408b81
movzx eax, byte [ebx]
sub eax, 0x30
cmp eax, 0xa
jae 0x409123
push 0xa
lea ecx, [ebp - 0x1c]
push ecx
push ebx
call dword [sym.imp.MSVCR100.dll_strtol]
mov edx, dword [ebp - 0x1c]
add esp, 0xc
cmp byte [edx], 0
jne 0x409123
cmp eax, 0xffff
ja 0x409123
push ebx
call dword [sym.imp.MSVCR100.dll_atoi]
add esp, 4
push eax
call dword [sym.imp.WS2_32.dll_htons]
movzx eax, ax
mov dword [ebp - 0xc], eax
jmp 0x408c80
movzx ecx, word [eax + 8]
mov ebx, dword [eax + 0xc]
mov dword [ebp - 0xc], ecx
test ebx, ebx
je 0x408c80
mov edx, 0x43f02c
mov ecx, ebx
mov al, byte [ecx]
cmp al, byte [edx]
jne 0x408c35
test al, al
je 0x408c31
mov al, byte [ecx + 1]
cmp al, byte [edx + 1]
jne 0x408c35
add ecx, 2
add edx, 2
test al, al
jne 0x408c15
xor eax, eax
jmp 0x408c3a
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x408c47
mov dword [ebp - 0x14], 1
jmp 0x408c80
mov ecx, 0x43f030
mov eax, ebx
mov edi, edi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x408c70
test dl, dl
je 0x408c6c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x408c70
add eax, 2
add ecx, 2
test dl, dl
jne 0x408c50
xor eax, eax
jmp 0x408c75
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x408c80
mov dword [ebp - 0x14], 2
mov eax, dword [ebp + 8]
test eax, eax
je 0x408f7a
mov ebx, dword [ebp + 0x10]
test ebx, ebx
je 0x408e45
test byte [ebx], 4
je 0x408e45
lea eax, [edi + 0x20]
cmp eax, dword [ebp - 8]
jbe 0x408ccf
mov edx, dword [ebp + 0x14]
mov eax, dword [edx]
push eax
call dword [sym.imp.MSVCR100.dll_free]
mov eax, dword [ebp - 4]
add esp, 4
cmp eax, 0x80000
jge 0x40915d
lea ecx, [eax + eax]
mov dword [ebp - 4], ecx
jmp 0x408ac6
mov edx, dword [ebp - 0x14]
mov esi, edi
mov ebx, eax
xor eax, eax
mov dword [esi + 0xc], eax
mov dword [esi + 0x14], eax
mov dword [esi + 0x1c], eax
mov eax, dword [ebp + 8]
push 0x3a
push eax
mov dword [esi], 4
mov dword [esi + 8], edx
call dword [sym.imp.MSVCR100.dll_strchr]
add esp, 8
test eax, eax
jne 0x4090a3
mov edi, dword [ebp + 8]
push 0x2e
push edi
call dword [sym.imp.MSVCR100.dll_strchr]
add esp, 8
test eax, eax
je 0x4090a3
mov eax, ebx
and eax, 7
mov ecx, edi
mov dword [ebp - 0x18], ecx
je 0x408d2d
mov edx, 8
sub edx, eax
add ebx, edx
lea eax, [ebx + 0x10]
mov dword [ebp - 0x14], eax
cmp eax, dword [ebp - 8]
ja 0x408ddc
mov dx, word [ebp - 0xc]
mov eax, 2
mov word [ebx], ax
mov word [ebx + 2], dx
xor edi, edi
mov edi, edi
mov al, byte [ecx]
movzx edx, al
sub edx, 0x30
cmp edx, 0xa
jae 0x409040
test al, al
je 0x409040
push 0xa
lea eax, [ebp - 0x18]
push eax
push ecx
call dword [sym.imp.MSVCR100.dll_strtol]
add esp, 0xc
cmp eax, 0xff
ja 0x409123
mov ecx, dword [ebp - 0x18]
cmp byte [ecx], 0x2e
je 0x408d95
cmp edi, 3
jne 0x409123
mov byte [ebp + edi - 0x10], al
inc ecx
inc edi
mov dword [ebp - 0x18], ecx
cmp edi, 4
jl 0x408d50
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp + 0x10]
mov dword [ebx + 4], eax
mov dword [esi + 4], 2
mov dword [esi + 0x10], 0x10
mov dword [esi + 0x18], ebx
test byte [ecx], 2
je 0x409000
cmp word [ebp - 0xc], 0
je 0x408e04
mov edx, dword [ebp - 0x14]
add edx, 0x16
cmp edx, dword [ebp - 8]
jbe 0x40905d
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.MSVCR100.dll_free]
mov eax, dword [ebp - 4]
add esp, 4
cmp eax, 0x80000
jge 0x40915d
lea edx, [eax + eax]
mov dword [ebp - 4], edx
jmp 0x408ac6
mov ecx, dword [ebp - 0x14]
add ecx, 0x10
cmp ecx, dword [ebp - 8]
ja 0x408ca7
movzx edx, byte [ebp - 0xd]
mov ecx, dword [ebp - 0x14]
push edx
movzx edx, byte [ebp - 0xe]
push edx
movzx edx, ah
push edx
movzx eax, al
push eax
push str._d._d._d._d
push ecx
mov dword [esi + 0x14], ecx
call dword [sym.imp.MSVCR100.dll_sprintf]
add esp, 0x18
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x10
push eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x4090c0
cmp word [eax + 8], 2
jne 0x409123
cmp word [eax + 0xa], 4
jne 0x409123
mov ecx, dword [eax + 0xc]
test ecx, ecx
je 0x409123
mov edx, dword [ecx]
test edx, edx
je 0x408f0e
nop
mov ecx, edi
and ecx, 7
je 0x408e90
mov ebx, 8
sub ebx, ecx
add edi, ebx
lea ecx, [edi + 0x20]
cmp ecx, dword [ebp - 8]
ja 0x408ddc
test esi, esi
je 0x408ea3
mov dword [esi + 0x1c], edi
mov esi, edi
mov edi, ecx
and edi, 7
je 0x408eb5
mov ebx, 8
sub ebx, edi
add ecx, ebx
lea edi, [ecx + 0x10]
cmp edi, dword [ebp - 8]
ja 0x408ddc
mov ebx, 2
mov word [ecx], bx
mov bx, word [ebp - 0xc]
mov word [ecx + 2], bx
mov edx, dword [edx]
mov dword [ecx + 4], edx
mov edx, dword [ebp - 0x14]
xor ebx, ebx
mov dword [esi], ebx
mov dword [esi + 4], 2
mov dword [esi + 8], edx
mov dword [esi + 0xc], ebx
mov dword [esi + 0x10], 0x10
mov dword [esi + 0x14], ebx
mov dword [esi + 0x18], ecx
mov dword [esi + 0x1c], ebx
add dword [eax + 0xc], 4
mov ecx, dword [eax + 0xc]
mov edx, dword [ecx]
cmp edx, ebx
jne 0x408e80
mov ebx, dword [ebp + 0x10]
test ebx, ebx
je 0x409000
test byte [ebx], 2
je 0x409000
push eax
call fcn.004089c0
add esp, 4
test eax, eax
je 0x409000
mov ecx, eax
lea esi, [ecx + 1]
mov dl, byte [ecx]
inc ecx
test dl, dl
jne 0x408f35
sub ecx, esi
lea ecx, [ecx + edi + 1]
cmp ecx, dword [ebp - 8]
ja 0x408ca7
mov edx, edi
sub edx, eax
nop
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x408f50
mov edx, dword [ebp + 0x14]
mov eax, dword [edx]
test eax, eax
je 0x409000
mov dword [eax + 0x14], edi
mov eax, dword [eax + 0x1c]
test eax, eax
jne 0x408f67
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov esi, dword [ebp + 0x10]
test esi, esi
je 0x408f8a
test byte [esi], 2
jne 0x409140
mov edx, dword [ebp - 8]
lea eax, [edi + 0x20]
cmp eax, edx
ja 0x408ca7
mov ecx, eax
and ecx, 7
je 0x408fa8
mov ebx, 8
sub ebx, ecx
add eax, ebx
lea ecx, [eax + 0x10]
cmp ecx, edx
ja 0x408ca7
mov dx, word [ebp - 0xc]
mov ecx, 2
mov word [eax], cx
xor ecx, ecx
mov word [eax + 2], dx
cmp esi, ecx
je 0x408fd1
test byte [esi], 1
mov dword [ebp + 0x14], ecx
jne 0x408fd8
mov dword [ebp + 0x14], 0x100007f
mov edx, dword [ebp + 0x14]
mov dword [eax + 4], edx
mov edx, dword [ebp - 0x14]
mov dword [edi], ecx
mov dword [edi + 4], 2
mov dword [edi + 8], edx
mov dword [edi + 0xc], ecx
mov dword [edi + 0x10], 0x10
mov dword [edi + 0x14], ecx
mov dword [edi + 0x18], eax
mov dword [edi + 0x1c], ecx
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x10
push edi
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
pop edi
pop esi
mov eax, 0x2726
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov edx, dword [ebp + 0x14]
mov eax, dword [edx]
push eax
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
pop edi
pop esi
mov eax, 0x2afa
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov edx, dword [ebp + 0x14]
mov eax, dword [edx]
push eax
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
pop edi
pop esi
mov eax, 0x2af9
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov edx, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x14]
push edx
mov dword [esi + 0x14], ecx
call dword [sym.imp.WS2_32.dll_ntohs]
movzx ecx, byte [ebp - 0xd]
movzx edx, byte [ebp - 0xe]
movzx eax, ax
push eax
mov eax, dword [ebp - 0x10]
push ecx
push edx
movzx ecx, ah
movzx edx, al
mov eax, dword [esi + 0x14]
push ecx
push edx
push str._d._d._d._d:_d
push eax
call dword [sym.imp.MSVCR100.dll_sprintf]
add esp, 0x1c
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [ebp + 0x14]
mov edx, dword [ecx]
push edx
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
pop edi
pop esi
mov eax, 0x2af9
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2af9
jg 0x409105
je 0x409132
sub eax, 0x2714
je 0x409032
sub eax, 0x20
je 0x409032
sub eax, 0x39
jne 0x409115
pop edi
pop esi
mov eax, 0x2726
pop ebx
mov esp, ebp
pop ebp
ret 0x10
sub eax, 0x2afa
je 0x409032
sub eax, 2
je 0x409132
pop edi
pop esi
mov eax, 0x2afb
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [ebp + 0x14]
mov ecx, dword [eax]
push ecx
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
pop edi
pop esi
mov eax, 0x2af9
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov edx, dword [ebp + 0x14]
mov eax, dword [edx]
push eax
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
pop edi
pop esi
mov eax, 0x2726
pop ebx
mov esp, ebp
pop ebp
ret 0x10
pop edi
pop esi
mov eax, 8
pop ebx
mov esp, ebp
pop ebp
ret 0x10