Function at 0x40639a
Capabilities:
Get comspec environment variable
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0x10]
lea eax, [esi + 0x250]
and dword [edi + 0x1108], 0
and dword [edi + 0x1004], 0
push eax
lea eax, [ebp - 0x1c]
push 0x14
push eax
mov dword [edi], esi
call fcn.00401fc7
mov eax, dword [esi + 0x230]
push dword [eax + 0x1c]
push str.SERVER_NAME_s
push edi
call fcn.004066de
mov eax, dword [esi + 0x230]
push dword [eax + 0x50]
push str.SERVER_ROOT_s
push edi
call fcn.004066de
mov eax, dword [esi + 0x230]
push dword [eax + 0x50]
push str.DOCUMENT_ROOT_s
push edi
call fcn.004066de
mov ebx, 0x41f038
push str.GATEWAY_INTERFACECGI_1.1
push ebx
push edi
call fcn.004066de
push str.SERVER_PROTOCOLHTTP_1.1
push ebx
push edi
call fcn.004066de
push str.REDIRECT_STATUS200
push ebx
push edi
call fcn.004066de
mov ax, word [esi + 0x242]
add esp, 0x48
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx eax, ax
push eax
push str.SERVER_PORT_d
push edi
call fcn.004066de
push dword [esi + 4]
push str.REQUEST_METHOD_s
push edi
call fcn.004066de
lea eax, [ebp - 0x1c]
push eax
push str.REMOTE_ADDR_s
push edi
call fcn.004066de
push dword [esi + 0x20]
push str.REMOTE_PORT_d
push edi
call fcn.004066de
push dword [esi + 8]
push str.REQUEST_URI_s
push edi
call fcn.004066de
mov ebx, dword [sym.imp.MSVCRT.dll_strrchr]
push 0x2f
push dword [esi + 8]
call ebx
add esp, 0x44
mov dword [ebp + 0x10], eax
push 0x2f
push dword [ebp + 0xc]
call ebx
pop ecx
test eax, eax
pop ecx
jne 0x4064ac
mov eax, dword [ebp + 0xc]
mov ecx, dword [esi + 8]
push eax
mov eax, dword [ebp + 0x10]
push ecx
sub eax, ecx
push eax
push str.SCRIPT_NAME_.s_s
push edi
call fcn.004066de
push dword [ebp + 0xc]
push str.SCRIPT_FILENAME_s
push edi
call fcn.004066de
push dword [ebp + 0xc]
push str.PATH_TRANSLATED_s
push edi
call fcn.004066de
add esp, 0x2c
cmp dword [esi + 0x234], 0
mov eax, 0x420948
je 0x4064f4
mov eax, 0x420944
push eax
push str.HTTPS_s
push edi
call fcn.004066de
add esp, 0xc
push str.Content_Type
push esi
call fcn.00401bdb
test eax, eax
je 0x406521
push eax
push str.CONTENT_TYPE_s
push edi
call fcn.004066de
add esp, 0xc
mov eax, dword [esi + 0x10]
test eax, eax
je 0x406537
push eax
push str.QUERY_STRING_s
push edi
call fcn.004066de
add esp, 0xc
push str.Content_Length
push esi
call fcn.00401bdb
test eax, eax
je 0x406555
push eax
push str.CONTENT_LENGTH_s
push edi
call fcn.004066de
add esp, 0xc
mov ebx, dword [sym.imp.MSVCRT.dll_getenv]
push str.PATH
call ebx
test eax, eax
pop ecx
je 0x406576
push eax
push str.PATH_s
push edi
call fcn.004066de
add esp, 0xc
mov eax, dword [esi + 0x284]
test eax, eax
je 0x40658f
push eax
push str.PATH_INFO_s
push edi
call fcn.004066de
add esp, 0xc
push str.COMSPEC
call ebx
test eax, eax
pop ecx
je 0x4065aa
push eax
push str.COMSPEC_s
push edi
call fcn.004066de
add esp, 0xc
push str.SYSTEMROOT
call ebx
test eax, eax
pop ecx
je 0x4065c5
push eax
push str.SYSTEMROOT_s
push edi
call fcn.004066de
add esp, 0xc
push str.SystemDrive
call ebx
test eax, eax
pop ecx
je 0x4065e0
push eax
push str.SystemDrive_s
push edi
call fcn.004066de
add esp, 0xc
push str.PERLLIB
call ebx
xor ebx, ebx
pop ecx
cmp eax, ebx
je 0x4065fd
push eax
push str.PERLLIB_s
push edi
call fcn.004066de
add esp, 0xc
mov eax, dword [esi + 0x14]
cmp eax, ebx
je 0x406623
push eax
push str.REMOTE_USER_s
push edi
call fcn.004066de
push str.AUTH_TYPEDigest
push 0x41f038
push edi
call fcn.004066de
add esp, 0x18
cmp dword [esi + 0x2c], ebx
mov dword [ebp + 0x10], ebx
jle 0x40667d
lea eax, [esi + 0x30]
mov dword [ebp + 0xc], eax
jmp 0x406636
mov eax, dword [ebp + 0xc]
push dword [eax + 4]
push dword [eax]
push str.HTTP__s_s
push edi
call fcn.004066de
add esp, 0x10
mov ebx, eax
mov al, byte [ebx]
cmp al, 0x3d
je 0x40666c
test al, al
je 0x40666c
cmp al, 0x2d
jne 0x40665c
mov byte [ebx], 0x5f
movzx eax, byte [ebx]
push eax
call dword [sym.imp.MSVCRT.dll_toupper]
mov byte [ebx], al
pop ecx
inc ebx
jmp 0x40664b
inc dword [ebp + 0x10]
add dword [ebp + 0xc], 8
mov eax, dword [ebp + 0x10]
cmp eax, dword [esi + 0x2c]
jl 0x406633
xor ebx, ebx
mov eax, dword [esi + 0x230]
lea ecx, [ebp - 8]
push ebx
push ecx
mov eax, dword [eax + 0xc]
push eax
call fcn.00403597
mov esi, eax
cmp esi, ebx
je 0x4066b3
push dword [ebp - 8]
push dword [ebp - 4]
push str._.s
push edi
call fcn.004066de
add esp, 0x10
lea eax, [ebp - 8]
push ebx
push eax
push esi
jmp 0x40668c
mov eax, dword [edi + 0x1108]
mov dword [edi + eax*4 + 0x1008], ebx
mov eax, dword [edi + 0x1004]
inc dword [edi + 0x1108]
and byte [eax + edi + 4], 0
inc dword [edi + 0x1004]
pop edi
pop esi
pop ebx
leave
ret 0xc