Function at 0x401eff
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 0x34
mov eax, dword [ebp + 8]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sub.msvcrt.dll_wcslen
mov dword [ebp - 0x10], eax
mov dword [esp + 4], 0x4061dc
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sub.msvcrt.dll_wcsstr
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x402131
mov eax, dword [ebp - 0x14]
add eax, 4
mov dword [esp + 4], 0x4061dc
mov dword [esp], eax
call sub.msvcrt.dll_wcsstr
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
je 0x402134
mov eax, dword [ebp - 0x18]
mov word [eax], 0
mov eax, dword [ebp - 0x14]
add eax, 4
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
call eax
sub esp, 0xc
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
lea edx, [eax - 1]
mov eax, dword [ebp - 0x18]
add eax, 4
mov ecx, eax
mov eax, dword [ebp - 0x14]
sub ecx, eax
mov eax, ecx
sar eax, 1
sub edx, eax
mov eax, edx
mov dword [ebp - 0x24], eax
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x10]
add eax, edx
cmp eax, dword [ebp + 0xc]
jb 0x40208f
mov edx, dword [ebp + 0xc]
mov eax, edx
add eax, eax
add eax, edx
add eax, 0x30
shr eax, 1
mov dword [ebp + 0xc], eax
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x10]
add eax, edx
cmp eax, dword [ebp + 0xc]
jb 0x401fe6
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x10]
add eax, edx
add eax, 1
mov dword [ebp + 0xc], eax
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 8]
je 0x402007
mov eax, dword [ebp + 0xc]
add eax, eax
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sub.msvcrt.dll_realloc
mov dword [ebp - 0x1c], eax
jmp 0x40203b
mov eax, dword [ebp + 0xc]
add eax, eax
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
je 0x40203b
mov eax, dword [ebp - 0x10]
add eax, 1
add eax, eax
mov dword [esp + 8], eax
mov eax, dword [ebp - 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
cmp dword [ebp - 0x1c], 0
jne 0x40206f
mov eax, dword [ebp - 0x14]
lea edx, [eax + 4]
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp + 8], edx
mov dword [esp + 4], str.Substituting__s_results_in_too_large_a_command_line_n
mov dword [esp], eax
call sub.msvcrt.dll_fwprintf
mov dword [esp], 1
call sub.msvcrt.dll_exit
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0xc]
sub edx, eax
mov eax, edx
add dword [ebp - 0x14], eax
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0xc]
sub edx, eax
mov eax, edx
add dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0x24], 0
je 0x4020d7
mov eax, dword [ebp - 0x18]
add eax, 4
mov edx, eax
mov eax, dword [ebp - 0xc]
sub edx, eax
mov eax, edx
sar eax, 1
mov edx, eax
mov eax, dword [ebp - 0x10]
sub eax, edx
add eax, 1
lea ecx, [eax + eax]
mov eax, dword [ebp - 0x18]
lea edx, [eax + 4]
mov eax, dword [ebp - 0x24]
add eax, 2
lea ebx, [eax + eax]
mov eax, dword [ebp - 0x18]
add eax, ebx
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_memmove
mov eax, dword [ebp - 0x24]
add dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x20]
add eax, 0x7fffffff
lea edx, [eax + eax]
mov eax, dword [ebp - 0x14]
add eax, edx
movzx eax, word [eax]
mov word [ebp - 0x26], ax
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 0x14]
add edx, 4
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 4], eax
mov dword [esp], edx
mov eax, dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
call eax
sub esp, 0xc
mov eax, dword [ebp - 0x20]
add eax, 0x7fffffff
lea edx, [eax + eax]
mov eax, dword [ebp - 0x14]
add edx, eax
movzx eax, word [ebp - 0x26]
mov word [edx], ax
jmp 0x401f1a
nop
jmp 0x402135
nop
mov eax, dword [ebp - 0xc]
mov ebx, dword [ebp - 4]
leave
ret