Function at 0x406440
Capabilities:
Create pipe
Query environment variable
Resolve dns
Set socket configuration

Disassembly:
sub esp, 0x238
mov eax, dword [0x40b100]
xor eax, esp
mov dword [esp + 0x234], eax
push ebx
push ebp
push esi
mov esi, dword [esp + 0x248]
push edi
push 0x3a
mov ebx, 1
push esi
mov dword [esp + 0x18], ebx
call dword [sym.imp.MSVCR90.dll_strchr]
mov edi, eax
add esp, 8
test edi, edi
je 0x4064be
lea eax, [edi + 1]
push eax
call dword [sym.imp.MSVCR90.dll_atoi]
movzx ebp, ax
add esp, 4
test bp, bp
je 0x406760
sub edi, esi
cmp edi, 0x104
jge 0x406760
push edi
lea ecx, [esp + 0x144]
push esi
push ecx
call dword [sym.imp.MSVCR90.dll_strncpy]
add esp, 0xc
mov byte [esp + edi + 0x140], 0
jmp 0x4064fd
mov al, byte [esi]
mov ecx, esi
test al, al
je 0x4064df
cmp al, 0x30
jl 0x406760
cmp al, 0x39
jg 0x406760
mov al, byte [ecx + ebx]
add ecx, ebx
test al, al
jne 0x4064c6
push esi
call dword [sym.imp.MSVCR90.dll_atoi]
movzx ebp, ax
add esp, 4
test bp, bp
je 0x406760
mov byte [esp + 0x140], 0
xor eax, eax
mov edx, 2
mov dword [esp + 0x38], eax
push ebp
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov word [esp + 0x3c], dx
call dword [sym.imp.WS2_32.dll_htons]
cmp byte [esp + 0x140], 0
mov word [esp + 0x3a], ax
je 0x4065cd
push ebx
lea eax, [esp + 0x144]
push 0x4098d4
push eax
call dword [sym.imp.MSVCR90.dll_strncmp]
add esp, 0xc
test eax, eax
je 0x4065cd
lea ecx, [esp + 0x140]
push ecx
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [esp + 0x3c], eax
cmp eax, 0xffffffff
jne 0x4065d9
lea edx, [esp + 0x140]
push edx
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x4065a5
cmp word [eax + 8], 2
jne 0x4065a5
mov eax, dword [eax + 0xc]
cmp dword [eax], 0
je 0x4065a5
cmp dword [eax + 4], 0
je 0x40659b
lea eax, [esp + 0x140]
push eax
push str.Host__s_has_multiple_addresses._You_must_choose_one_explicitly__n
jmp 0x4065b2
mov ecx, dword [eax]
mov edx, dword [ecx]
mov dword [esp + 0x3c], edx
jmp 0x4065d9
lea eax, [esp + 0x140]
push eax
push str.Cannot_resolve_host_name__s__n
call dword [sym.imp.MSVCR90.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR90.dll_fprintf]
add esp, 0xc
or eax, 0xffffffff
jmp 0x4067dc
push 0
call dword [sym.imp.WS2_32.dll_htonl]
mov dword [esp + 0x3c], eax
movzx ecx, word [esp + 0x38]
push 0
push ebx
push ecx
call dword [sym.imp.WS2_32.dll_socket]
mov esi, eax
mov dword [esp + 0x14], esi
test esi, esi
jl 0x406725
push 4
lea edx, [esp + 0x14]
push edx
push 4
push 0xffff
push esi
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jl 0x406725
push 0x10
lea eax, [esp + 0x3c]
push eax
push esi
call dword [sym.imp.WS2_32.dll_bind]
test eax, eax
jl 0x406725
mov ecx, dword [esp + 0x250]
push ecx
push esi
call dword [sym.imp.WS2_32.dll_listen]
test eax, eax
jl 0x406725
push str.FCGI_WEB_SERVER_ADDRS
call dword [sym.imp.MSVCR90.dll_getenv]
add esp, 4
test eax, eax
je 0x406700
push eax
call dword [sym.imp.MSVCR90.dll__strdup]
mov ebx, eax
mov al, byte [ebx]
add esp, 4
xor edx, edx
mov ecx, ebx
test al, al
je 0x40667d
lea esp, [esp]
cmp al, 0x2c
jne 0x406675
inc edx
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x406670
lea edx, [edx*4 + 8]
push edx
call dword [sym.imp.MSVCR90.dll_malloc]
add esp, 4
mov dword [0x40b164], eax
xor ebp, ebp
mov esi, ebx
push 0x2c
push esi
call dword [sym.imp.MSVCR90.dll_strchr]
mov edi, eax
add esp, 8
test edi, edi
je 0x4066ad
mov byte [edi], 0
inc edi
push esi
call dword [sym.imp.WS2_32.dll_inet_addr]
mov ecx, dword [0x40b164]
mov dword [ecx + ebp*4], eax
cmp eax, 0xffffffff
jne 0x4066db
push esi
push str.Wrong_IP_address__s_in_FCGI_WEB_SERVER_ADDRS_n
call dword [sym.imp.MSVCR90.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR90.dll_fprintf]
add esp, 0xc
inc ebp
mov esi, edi
test edi, edi
jne 0x406697
mov edx, dword [0x40b164]
push ebx
mov dword [edx + ebp*4], 0xffffffff
call dword [sym.imp.MSVCR90.dll_free]
mov esi, dword [esp + 0x18]
add esp, 4
lea ebx, [edi + 1]
cmp dword [0x40b158], 0
jne 0x40670e
call fcn.00406310
push 0
push esi
mov dword [0x40b15c], ebx
call dword [sym.imp.MSVCR90.dll__open_osfhandle]
add esp, 8
jmp 0x4067dc
mov esi, dword [sym.imp.MSVCR90.dll__errno]
call esi
mov edi, eax
call esi
mov esi, eax
mov eax, dword [edi]
push eax
call dword [sym.imp.MSVCR90.dll_strerror]
mov ecx, dword [esi]
add esp, 4
push eax
push ecx
push str.Cannot_bind_listen_socket_____d___s._n
call dword [sym.imp.MSVCR90.dll___iob_func]
add eax, 0x40
push eax
call dword [sym.imp.MSVCR90.dll_fprintf]
add esp, 0x10
or eax, 0xffffffff
jmp 0x4067dc
xor eax, eax
lea edx, [esp + 0x24]
push edx
lea ecx, [esp + 0x1c]
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x1c], 0xc
mov dword [esp + 0x24], eax
call fcn.004043e0
add esp, 4
lea eax, [esp + 0x18]
push eax
push 0
push 0x2000
push 0x2000
push 0xff
push 0
push 0x40000003
push esi
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeA]
cmp eax, 0xffffffff
je 0x4065c5
push 0
push eax
call dword [sym.imp.MSVCR90.dll__open_osfhandle]
add esp, 8
cmp dword [0x40b158], 0
mov esi, eax
jne 0x4067d4
call fcn.00406310
mov dword [0x40b15c], ebx
mov eax, esi
mov ecx, dword [esp + 0x244]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00406814
add esp, 0x238
ret