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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push esi
mov eax, dword [ebp + 8]
add eax, 4
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x18c]
add edx, 0x28
mov dword [ebp - 0xc], edx
mov eax, dword [ebp + 0x10]
mov dword [eax + 0x2108], 0
mov ecx, dword [ebp + 0x10]
mov dword [ecx + 0x2104], 0
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x14]
mov dword [edx], eax
push str.SERVER_NAME
call dword [sym.imp.MSVCRT.dll_getenv]
add esp, 4
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x412568
mov ecx, dword [ebp - 8]
push ecx
push 0x431318
mov edx, dword [ebp + 0x10]
push edx
call fcn.00412a88
add esp, 0xc
jmp 0x412580
mov eax, dword [ebp - 0x14]
add eax, 0x40
push eax
push str.SERVER_NAME_s
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00412a88
add esp, 0xc
mov edx, dword [ebp - 0xc]
mov eax, dword [edx + 0x1c]
push eax
push str.SERVER_ROOT_s
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00412a88
add esp, 0xc
mov edx, dword [ebp - 0xc]
mov eax, dword [edx + 0x1c]
push eax
push str.DOCUMENT_ROOT_s
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00412a88
add esp, 0xc
push 0x43135c
push 0x431360
push str.SERVER_SOFTWARE_s__s
mov edx, dword [ebp + 0x10]
push edx
call fcn.00412a88
add esp, 0x10
push str.GATEWAY_INTERFACECGI_1.1
push 0x4313a0
mov eax, dword [ebp + 0x10]
push eax
call fcn.00412a88
add esp, 0xc
push str.SERVER_PROTOCOLHTTP_1.1
push 0x4313c0
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00412a88
add esp, 0xc
push str.REDIRECT_STATUS200
push 0x4313d8
mov edx, dword [ebp + 0x10]
push edx
call fcn.00412a88
add esp, 0xc
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax]
push ecx
push str.REQUEST_METHOD_s
mov edx, dword [ebp + 0x10]
push edx
call fcn.00412a88
add esp, 0xc
mov eax, dword [ebp - 0x14]
add eax, 0x10
push eax
push str.REMOTE_ADDR_s
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00412a88
add esp, 0xc
mov edx, dword [ebp - 0x14]
xor eax, eax
mov ax, word [edx + 0x70]
push eax
push str.REMOTE_PORT_d
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00412a88
add esp, 0xc
mov edx, dword [ebp - 0x14]
cmp dword [edx + 0xc], 0
jne 0x412669
mov dword [ebp - 0x1c], 0x4335bc
jmp 0x412672
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 0xc]
mov dword [ebp - 0x1c], ecx
mov edx, dword [ebp - 0x14]
cmp dword [edx + 0xc], 0
jne 0x412684
mov dword [ebp - 0x20], 0x4335c0
jmp 0x41268b
mov dword [ebp - 0x20], 0x431410
mov eax, dword [ebp - 0x1c]
push eax
mov ecx, dword [ebp - 0x20]
push ecx
mov edx, dword [ebp - 0x14]
mov eax, dword [edx + 4]
push eax
push str.REQUEST_URI_s_s_s
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00412a88
add esp, 0x14
mov edx, dword [ebp + 8]
cmp dword [edx + 0x198], 0
je 0x412712
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 4]
push ecx
mov edx, dword [ebp - 0x14]
mov eax, dword [edx + 4]
push eax
call sub.MSVCRT.dll_strlen
add esp, 4
mov esi, eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x198]
push edx
call sub.MSVCRT.dll_strlen
add esp, 4
sub esi, eax
push esi
push str.SCRIPT_NAME_.s
mov eax, dword [ebp + 0x10]
push eax
call fcn.00412a88
add esp, 0x10
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x198]
push edx
push str.PATH_INFO_s
mov eax, dword [ebp + 0x10]
push eax
call fcn.00412a88
add esp, 0xc
jmp 0x412788
push 0x2f
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.MSVCRT.dll_strrchr]
add esp, 8
mov dword [ebp - 8], eax
push 0x2f
mov edx, dword [ebp - 0x14]
mov eax, dword [edx + 4]
push eax
call dword [sym.imp.MSVCRT.dll_strrchr]
add esp, 8
mov dword [ebp - 0x10], eax
cmp dword [ebp - 8], 0
jne 0x412747
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x24], ecx
jmp 0x41274d
mov edx, dword [ebp - 8]
mov dword [ebp - 0x24], edx
cmp dword [ebp - 0x10], 0
jne 0x41275c
mov dword [ebp - 0x28], 0
jmp 0x412768
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x10]
sub ecx, dword [eax + 4]
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x24]
push edx
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax + 4]
push ecx
mov edx, dword [ebp - 0x28]
push edx
push str.SCRIPT_NAME_.s_s
mov eax, dword [ebp + 0x10]
push eax
call fcn.00412a88
add esp, 0x14
mov ecx, dword [ebp + 0xc]
push ecx
push str.SCRIPT_FILENAME_s
mov edx, dword [ebp + 0x10]
push edx
call fcn.00412a88
add esp, 0xc
mov eax, dword [ebp + 0xc]
push eax
push str.PATH_TRANSLATED_s
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00412a88
add esp, 0xc
mov edx, dword [ebp + 8]
mov eax, dword [edx]
cmp dword [eax + 0x40], 0
je 0x4127c6
mov dword [ebp - 0x2c], 0x431488
jmp 0x4127cd
mov dword [ebp - 0x2c], 0x43148c
mov ecx, dword [ebp - 0x2c]
push ecx
push str.HTTPS_s
mov edx, dword [ebp + 0x10]
push edx
call fcn.00412a88
add esp, 0xc
push 0x43149c
mov eax, dword [ebp - 0x14]
push eax
call fcn.0040e602
add esp, 8
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x412811
mov ecx, dword [ebp - 8]
push ecx
push str.CONTENT_TYPE_s
mov edx, dword [ebp + 0x10]
push edx
call fcn.00412a88
add esp, 0xc
mov eax, dword [ebp - 0x14]
cmp dword [eax + 0xc], 0
je 0x412832
mov ecx, dword [ebp - 0x14]
mov edx, dword [ecx + 0xc]
push edx
push str.QUERY_STRING_s
mov eax, dword [ebp + 0x10]
push eax
call fcn.00412a88
add esp, 0xc
push 0x4314cc
mov ecx, dword [ebp - 0x14]
push ecx
call fcn.0040e602
add esp, 8
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x412861
mov edx, dword [ebp - 8]
push edx
push str.CONTENT_LENGTH_s
mov eax, dword [ebp + 0x10]
push eax
call fcn.00412a88
add esp, 0xc
push str.PATH
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00412b63
add esp, 8
push 0x4314f8
mov edx, dword [ebp + 0x10]
push edx
call fcn.00412b63
add esp, 8
push str.TEMP
mov eax, dword [ebp + 0x10]
push eax
call fcn.00412b63
add esp, 8
push str.TMPDIR
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00412b63
add esp, 8
push str.PERLLIB
mov edx, dword [ebp + 0x10]
push edx
call fcn.00412b63
add esp, 8
push str.MONGOOSE_CGI
mov eax, dword [ebp + 0x10]
push eax
call fcn.00412b63
add esp, 8
push str.COMSPEC
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00412b63
add esp, 8
push str.SYSTEMROOT
mov edx, dword [ebp + 0x10]
push edx
call fcn.00412b63
add esp, 8
push str.SystemDrive
mov eax, dword [ebp + 0x10]
push eax
call fcn.00412b63
add esp, 8
push str.ProgramFiles
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00412b63
add esp, 8
push str.ProgramFiles_x86_
mov edx, dword [ebp + 0x10]
push edx
call fcn.00412b63
add esp, 8
push str.CommonProgramFiles_x86_
mov eax, dword [ebp + 0x10]
push eax
call fcn.00412b63
add esp, 8
mov dword [ebp - 0x18], 0
jmp 0x41293f
mov ecx, dword [ebp - 0x18]
add ecx, 1
mov dword [ebp - 0x18], ecx
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x18]
cmp eax, dword [edx + 0x74]
jge 0x4129c2
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x14]
mov eax, dword [edx + ecx*8 + 0x7c]
push eax
mov ecx, dword [ebp - 0x18]
mov edx, dword [ebp - 0x14]
mov eax, dword [edx + ecx*8 + 0x78]
push eax
push str.HTTP__s_s
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.00412a88
add esp, 0x10
mov dword [ebp - 4], eax
jmp 0x41297f
mov edx, dword [ebp - 4]
add edx, 1
mov dword [ebp - 4], edx
mov eax, dword [ebp - 4]
movsx ecx, byte [eax]
cmp ecx, 0x3d
je 0x4129bd
mov edx, dword [ebp - 4]
movsx eax, byte [edx]
test eax, eax
je 0x4129bd
mov ecx, dword [ebp - 4]
movsx edx, byte [ecx]
cmp edx, 0x2d
jne 0x4129a5
mov eax, dword [ebp - 4]
mov byte [eax], 0x5f
mov ecx, dword [ebp - 4]
xor edx, edx
mov dl, byte [ecx]
push edx
call dword [sym.imp.MSVCRT.dll_toupper]
add esp, 4
mov ecx, dword [ebp - 4]
mov byte [ecx], al
jmp 0x412976
jmp 0x412936
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 0x2108]
mov ecx, dword [ebp + 0x10]
mov dword [ecx + eax*4 + 0x2004], 0
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 0x2108]
add eax, 1
mov ecx, dword [ebp + 0x10]
mov dword [ecx + 0x2108], eax
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 0x2104]
mov ecx, dword [ebp + 0x10]
mov byte [ecx + eax + 4], 0
mov edx, dword [ebp + 0x10]
mov eax, dword [edx + 0x2104]
add eax, 1
mov ecx, dword [ebp + 0x10]
mov dword [ecx + 0x2104], eax
mov edx, dword [ebp + 0x10]
cmp dword [edx + 0x2108], 0x40
jl 0x412a38
push 0x8f6
push 0x43158c
push str.blk__nvars____int__ARRAY_SIZE_blk__vars_
call dword [sym.imp.MSVCRT.dll__assert]
add esp, 0xc
mov ecx, dword [ebp + 0x10]
cmp dword [ecx + 0x2104], 0
jg 0x412a5c
push 0x8f7
push 0x4315d0
push str.blk__len___0
call dword [sym.imp.MSVCRT.dll__assert]
add esp, 0xc
mov eax, dword [ebp + 0x10]
cmp dword [eax + 0x2104], 0x2000
jl 0x412a83
push 0x8f8
push 0x4315f8
push str.blk__len____int__sizeof_blk__buf_
call dword [sym.imp.MSVCRT.dll__assert]
add esp, 0xc
pop esi
mov esp, ebp
pop ebp
ret