Function at 0x40c840
Capabilities:
Resolve dns

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc8
mov eax, dword [0x454004]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov edi, ecx
mov dword [ebp - 0xc0], ebx
mov esi, edx
test edi, edi
je 0x40cd82
test esi, esi
je 0x40cd82
test ebx, ebx
je 0x40cd82
push 0x1000
mov dword [ebx], edi
mov dword [ebx + 8], 0x1000
mov dword [ebx + 0xc], 0
call fcn.00425f1b
mov dword [ebx + 4], eax
add esp, 4
mov eax, dword [ebx + 8]
shl eax, 2
mov dword [ebx + 0x14], 0x100
push eax
mov dword [ebx + 0x18], 0
call fcn.00425f1b
mov dword [ebx + 0x10], eax
add esp, 4
mov eax, dword [edi + 0x270]
push dword [eax + 0x1c]
push str.SERVER_NAME_s
push ebx
call fcn.0040c700
mov eax, dword [edi + 0x270]
add esp, 0xc
push dword [eax + 0x4c]
push str.SERVER_ROOT_s
push ebx
call fcn.0040c700
mov eax, dword [edi + 0x270]
add esp, 0xc
push dword [eax + 0x4c]
push str.DOCUMENT_ROOT_s
push ebx
call fcn.0040c700
add esp, 0xc
push 0x44d1ac
push str.Civetweb
push str.SERVER_SOFTWARE_s__s
push ebx
call fcn.0040c700
push str.GATEWAY_INTERFACECGI_1.1
push 0x44c068
push ebx
call fcn.0040c700
add esp, 0x1c
push str.SERVER_PROTOCOLHTTP_1.1
push 0x44c068
push ebx
call fcn.0040c700
add esp, 0xc
push str.REDIRECT_STATUS200
push 0x44c068
push ebx
call fcn.0040c700
movzx eax, word [edi + 0x282]
add esp, 0xc
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
push eax
push str.SERVER_PORT_d
push ebx
call fcn.0040c700
lea eax, [edi + 0x290]
mov byte [ebp - 0x3c], 0
add esp, 0xc
test eax, eax
je 0x40c997
cmp word [eax], 2
jne 0x40c997
push 2
push 0
push 0
push 0x32
lea ecx, [ebp - 0x3c]
push ecx
push 0x10
push eax
call dword [sym.imp.WS2_32.dll_getnameinfo]
lea eax, [ebp - 0x3c]
push eax
push str.REMOTE_ADDR_s
push ebx
call fcn.0040c700
add esp, 0xc
push dword [edi]
push str.REQUEST_METHOD_s
push ebx
call fcn.0040c700
add esp, 0xc
push dword [edi + 0x58]
push str.REMOTE_PORT_d
push ebx
call fcn.0040c700
add esp, 0xc
push dword [edi + 4]
push str.REQUEST_URI_s
push ebx
call fcn.0040c700
add esp, 0xc
push dword [edi + 8]
push str.LOCAL_URI_s
push ebx
call fcn.0040c700
mov edx, dword [edi + 8]
add esp, 0xc
lea ecx, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x40c9f2
sub edx, ecx
mov ecx, dword [edi + 0x2e4]
test ecx, ecx
je 0x40ca17
lea ebx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40ca08
sub ecx, ebx
mov ebx, dword [ebp - 0xc0]
push dword [edi + 8]
sub edx, ecx
push edx
push str.SCRIPT_NAME_.s
push ebx
call fcn.0040c700
push esi
push str.SCRIPT_FILENAME_s
push ebx
call fcn.0040c700
mov ecx, dword [edi + 0x2e4]
add esp, 0x1c
mov eax, dword [edi + 0x270]
test ecx, ecx
jne 0x40ca5a
push dword [eax + 0x4c]
push str.PATH_TRANSLATED_s
push ebx
call fcn.0040c700
add esp, 0xc
jmp 0x40ca6c
push ecx
push dword [eax + 0x4c]
push str.PATH_TRANSLATED_s_s
push ebx
call fcn.0040c700
add esp, 0x10
cmp dword [edi + 0x274], 0
mov ecx, 0x44e918
mov eax, 0x44e914
cmovne eax, ecx
push eax
push str.HTTPS_s
push ebx
call fcn.0040c700
add esp, 0xc
mov edx, str.Content_Type
mov ecx, edi
call fcn.00406750
test eax, eax
je 0x40caae
push eax
push str.CONTENT_TYPE_s
push ebx
call fcn.0040c700
add esp, 0xc
mov eax, dword [edi + 0x14]
test eax, eax
je 0x40cac4
push eax
push str.QUERY_STRING_s
push ebx
call fcn.0040c700
add esp, 0xc
mov edx, str.Content_Length
mov ecx, edi
call fcn.00406750
test eax, eax
je 0x40cae3
push eax
push str.CONTENT_LENGTH_s
push ebx
call fcn.0040c700
add esp, 0xc
push str.PATH
call fcn.004338d8
add esp, 4
test eax, eax
je 0x40cb03
push eax
push str.PATH_s
push ebx
call fcn.0040c700
add esp, 0xc
mov eax, dword [edi + 0x2e4]
test eax, eax
je 0x40cb1c
push eax
push str.PATH_INFO_s
push ebx
call fcn.0040c700
add esp, 0xc
mov eax, dword [edi + 0x300]
test eax, eax
jle 0x40cb35
push eax
push str.STATUS_d
push ebx
call fcn.0040c700
add esp, 0xc
push str.COMSPEC
call fcn.004338d8
add esp, 4
test eax, eax
je 0x40cb55
push eax
push str.COMSPEC_s
push ebx
call fcn.0040c700
add esp, 0xc
push str.SYSTEMROOT
call fcn.004338d8
add esp, 4
test eax, eax
je 0x40cb75
push eax
push str.SYSTEMROOT_s
push ebx
call fcn.0040c700
add esp, 0xc
push str.SystemDrive
call fcn.004338d8
add esp, 4
test eax, eax
je 0x40cb95
push eax
push str.SystemDrive_s
push ebx
call fcn.0040c700
add esp, 0xc
push str.ProgramFiles
call fcn.004338d8
add esp, 4
test eax, eax
je 0x40cbb5
push eax
push str.ProgramFiles_s
push ebx
call fcn.0040c700
add esp, 0xc
push str.ProgramFiles_x86_
call fcn.004338d8
add esp, 4
test eax, eax
je 0x40cbd5
push eax
push str.ProgramFiles_x86__s
push ebx
call fcn.0040c700
add esp, 0xc
push str.PERLLIB
call fcn.004338d8
add esp, 4
test eax, eax
je 0x40cbf5
push eax
push str.PERLLIB_s
push ebx
call fcn.0040c700
add esp, 0xc
mov eax, dword [edi + 0x18]
test eax, eax
je 0x40cc1e
push eax
push str.REMOTE_USER_s
push ebx
call fcn.0040c700
add esp, 0xc
push str.AUTH_TYPEDigest
push 0x44c068
push ebx
call fcn.0040c700
add esp, 0xc
xor esi, esi
mov dword [ebp - 0xc4], esi
cmp dword [edi + 0x68], esi
jle 0x40ccd7
lea ebx, [edi + 0x6c]
push dword [ebx]
lea eax, [ebp - 0xbc]
push str.HTTP__s
push 0x80
push eax
lea eax, [ebp - 0xc8]
push eax
push edi
call fcn.00406450
add esp, 0x18
cmp dword [ebp - 0xc8], 0
je 0x40cc72
push dword [ebx]
push str.prepare_cgi_environment
push str._s:_HTTP_header_variable_too_long___s_
push edi
call fcn.004064e0
jmp 0x40ccc1
mov al, byte [ebp - 0xbc]
lea esi, [ebp - 0xbc]
test al, al
je 0x40cca1
cmp al, 0x2d
jne 0x40cc8b
mov byte [esi], 0x5f
mov al, 0x5f
movzx eax, al
push eax
call fcn.0042a76c
mov byte [esi], al
add esp, 4
mov al, byte [esi + 1]
inc esi
test al, al
jne 0x40cc82
push dword [ebx + 4]
lea eax, [ebp - 0xbc]
push eax
push str._s_s
push dword [ebp - 0xc0]
call fcn.0040c700
mov esi, dword [ebp - 0xc4]
inc esi
add esp, 0x10
add ebx, 8
mov dword [ebp - 0xc4], esi
cmp esi, dword [edi + 0x68]
jl 0x40cc32
mov esi, dword [edi + 0x270]
mov esi, dword [esi + 0xc]
test esi, esi
je 0x40cd65
mov al, byte [esi]
test al, al
je 0x40cd65
mov edi, esi
cmp al, 0x20
je 0x40ccfc
cmp al, 9
jne 0x40cd02
mov al, byte [esi + 1]
inc esi
jmp 0x40ccf2
push 0x2c
push esi
mov ebx, esi
call fcn.004248a0
mov esi, eax
add esp, 8
test esi, esi
je 0x40cd1c
mov ecx, esi
sub ecx, edi
inc esi
jmp 0x40cd2d
mov ecx, edi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40cd21
sub ecx, edx
lea esi, [edi + ecx]
add ecx, 0xffffffff
js 0x40cd42
mov al, byte [ebx + ecx]
cmp al, 0x20
je 0x40cd3d
cmp al, 9
jne 0x40cd42
sub ecx, 1
jns 0x40cd32
add ecx, 1
je 0x40cce0
test esi, esi
je 0x40cd65
push ebx
push ecx
push str._.s
push dword [ebp - 0xc0]
call fcn.0040c700
add esp, 0x10
jmp 0x40cce0
mov edx, dword [ebp - 0xc0]
mov ecx, dword [edx + 0x18]
mov eax, dword [edx + 0x10]
mov dword [eax + ecx*4], 0
mov ecx, dword [edx + 0xc]
mov eax, dword [edx + 4]
mov byte [ecx + eax], 0
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00423c62
mov esp, ebp
pop ebp
ret