Function at 0x4036a6
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x848
mov eax, dword [0x406014]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
and dword [ebp - 0x82c], 0
mov dword [ebp - 0x828], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x848], eax
mov eax, dword [ebp + 0x1c]
push ebx
mov ebx, dword [ebp + 8]
push esi
mov dword [ebp - 0x824], eax
xor esi, esi
mov eax, dword [ebp + 0x10]
inc esi
push edi
push ebx
push 0x401098
mov eax, dword [eax]
mov dword [ebp - 0x814], eax
lea eax, [ebp - 0x20c]
push eax
mov dword [ebp - 0x81c], esi
call fcn.0040358f
add esp, 0xc
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0x400
push 0x4069b8
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov edi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcstok_s]
dec eax
cmp eax, 0x3fe
ja 0x403789
lea eax, [ebp - 0x82c]
push eax
push 0x4010a0
push 0x4069b8
jmp 0x40376f
mov ecx, 0x100
cmp esi, ecx
je 0x40377a
mov dword [ebp + esi*4 - 0x814], eax
lea eax, [ebp - 0x82c]
push eax
inc esi
push 0x4010a0
mov dword [ebp - 0x81c], esi
push 0
call edi
add esp, 0xc
test eax, eax
jne 0x40374a
jmp 0x4037a5
push ecx
push ebx
push 0x4a
push ebx
call fcn.00403551
jmp 0x40387d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xcb
je 0x4037a5
lea eax, [ebp - 0x20c]
push eax
push 0x48
push ebx
call fcn.00403517
cmp dword [ebp + 0xc], 1
jle 0x4037d8
mov edx, dword [ebp + 0x10]
xor ecx, ecx
inc ecx
add edx, 4
mov eax, 0x100
cmp esi, eax
je 0x403827
mov eax, dword [edx]
mov dword [ebp + esi*4 - 0x814], eax
inc esi
push 4
pop eax
add edx, eax
mov dword [ebp - 0x81c], esi
inc ecx
cmp ecx, dword [ebp + 0xc]
jl 0x4037b4
push ebx
lea eax, [ebp - 0x414]
push 0x4010a4
push eax
call fcn.0040358f
add esp, 0xc
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0x400
push 0x4071b8
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
dec eax
cmp eax, 0x3fe
ja 0x403861
lea eax, [ebp - 0x82c]
push eax
push 0x4010a0
push 0x4071b8
jmp 0x403856
push eax
jmp 0x40377b
mov ecx, 0x100
cmp esi, ecx
je 0x40377a
mov dword [ebp + esi*4 - 0x814], eax
lea eax, [ebp - 0x82c]
push eax
inc esi
push 0x4010a0
mov dword [ebp - 0x81c], esi
push 0
call edi
add esp, 0xc
test eax, eax
jne 0x40382d
jmp 0x40387d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xcb
je 0x40387d
lea eax, [ebp - 0x414]
push eax
push 0x48
push ebx
call fcn.00403517
mov ecx, dword [ebp - 0x828]
mov eax, ecx
push 0x14
pop edi
cmp dword [ecx], 5
je 0x403894
add eax, edi
cmp dword [eax], 5
jne 0x40388d
sub eax, ecx
cdq
idiv edi
push eax
mov dword [ebp - 0x830], eax
call fcn.00404fe7
mov edi, eax
xor ecx, ecx
push 4
pop edx
mov eax, esi
mov dword [ebp - 0x834], edi
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00404fe7
mov dword [ebp - 0x83c], eax
pop ecx
pop ecx
test edi, edi
je 0x4038d3
test eax, eax
jne 0x4038e4
push 0xbf
push 0x4010b0
push 2
call fcn.00404eae
mov ecx, dword [ebp - 0x824]
xor eax, eax
and dword [ecx], 0
cmp dword [ebp - 0x830], eax
jbe 0x403927
mov ecx, dword [ebp - 0x828]
mov esi, dword [ebp - 0x830]
add ecx, 0x10
mov byte [eax + edi], 0
mov edx, dword [ecx]
test edx, edx
je 0x403913
mov byte [edx], 0
inc eax
add ecx, 0x14
cmp eax, esi
jb 0x403906
mov esi, dword [ebp - 0x81c]
mov ecx, dword [ebp - 0x824]
xor edi, edi
mov byte [ebp - 0x815], 1
inc edi
mov byte [ebp - 0x816], 0
cmp esi, edi
jle 0x403b55
mov dword [ebp - 0x840], 0x2d
mov dword [ebp - 0x844], 0x2f
mov edx, dword [ebp + edi*4 - 0x814]
mov dword [ebp - 0x838], edx
movzx eax, word [edx]
cmp ax, word [ebp - 0x840]
je 0x40398e
cmp ax, word [ebp - 0x844]
je 0x40398e
mov eax, dword [ecx]
mov ecx, dword [ebp - 0x83c]
mov dword [ecx + eax*4], edx
mov ecx, dword [ebp - 0x824]
inc dword [ecx]
jmp 0x403b39
mov ecx, 0x401060
mov eax, edx
mov si, word [eax]
cmp si, word [ecx]
mov esi, dword [ebp - 0x81c]
jne 0x4039d4
cmp word [eax], 0
je 0x4039d0
mov si, word [eax + 2]
cmp si, word [ecx + 2]
mov word [ebp - 0x81e], si
mov esi, dword [ebp - 0x81c]
jne 0x4039d4
add eax, 4
add ecx, 4
cmp word [ebp - 0x81e], 0
jne 0x403995
xor eax, eax
jmp 0x4039d9
sbb eax, eax
or eax, 1
test eax, eax
je 0x403b33
mov ecx, 0x401070
mov eax, edx
mov si, word [eax]
cmp si, word [ecx]
mov esi, dword [ebp - 0x81c]
jne 0x403a27
cmp word [eax], 0
je 0x403a23
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
mov word [ebp - 0x81e], dx
mov edx, dword [ebp - 0x838]
jne 0x403a27
add eax, 4
add ecx, 4
cmp word [ebp - 0x81e], 0
jne 0x4039e8
xor eax, eax
jmp 0x403a2c
sbb eax, eax
or eax, 1
test eax, eax
je 0x403b33
lea eax, [edx + 2]
push eax
push dword [ebp - 0x828]
call fcn.00403bd7
mov esi, eax
inc edi
test esi, esi
jne 0x403a65
push dword [ebp - 0x838]
push 0x3f
push ebx
call fcn.004032ea
xor al, al
mov byte [ebp - 0x815], al
jmp 0x403b25
mov eax, esi
sub eax, dword [ebp - 0x828]
push 0x14
pop ecx
cdq
idiv ecx
mov ecx, dword [ebp - 0x834]
mov dword [ebp - 0x838], eax
cmp byte [eax + ecx], 0
je 0x403a94
push dword [ebp + edi*4 - 0x818]
push 0x43
push ebx
call fcn.00403517
mov eax, dword [esi + 0x10]
test eax, eax
je 0x403a9e
mov byte [eax], 1
cmp dword [esi], 0
je 0x403ac8
cmp dword [esi], 1
jne 0x403ab1
mov byte [ebp - 0x816], 1
jmp 0x403ac8
mov eax, dword [0x4069b0]
test eax, eax
je 0x403ac3
push eax
push esi
call fcn.00403655
jmp 0x403afa
cmp dword [esi], 3
jne 0x403ad0
mov eax, dword [esi + 0xc]
mov byte [eax], 1
jmp 0x403afa
cmp edi, dword [ebp - 0x81c]
je 0x403b02
mov ecx, dword [ebp + edi*4 - 0x814]
push 0x2d
pop edx
movzx eax, word [ecx]
cmp ax, dx
je 0x403b02
push 0x2f
pop edx
cmp ax, dx
je 0x403b02
push ecx
push esi
call fcn.00403655
inc edi
mov al, byte [ebp - 0x815]
jmp 0x403b15
push dword [esi + 4]
push 0x3d
push ebx
call fcn.004032ea
xor al, al
mov byte [ebp - 0x815], al
mov ecx, dword [ebp - 0x838]
mov edx, dword [ebp - 0x834]
mov byte [ecx + edx], 1
mov esi, dword [ebp - 0x81c]
mov ecx, dword [ebp - 0x824]
jmp 0x403b40
mov ecx, dword [ebp - 0x824]
mov al, byte [ebp - 0x815]
inc edi
cmp edi, esi
jl 0x403954
cmp byte [ebp - 0x816], 0
jne 0x403ba6
test al, al
je 0x403ba6
mov ecx, dword [ebp - 0x830]
xor edi, edi
test ecx, ecx
je 0x403ba6
mov esi, dword [ebp - 0x828]
push 0x14
add esi, 4
pop eax
cmp dword [esi - 4], 0
je 0x403b9f
cmp byte [esi + 4], 0
je 0x403b9f
mov eax, dword [ebp - 0x834]
cmp byte [edi + eax], 0
jne 0x403b9c
push dword [esi]
push 0x3e
push ebx
call fcn.004032ea
mov ecx, dword [ebp - 0x830]
mov byte [ebp - 0x815], 0
push 0x14
pop eax
inc edi
add esi, eax
cmp edi, ecx
jb 0x403b6d
push dword [ebp - 0x834]
call fcn.00404ff0
mov eax, dword [ebp - 0x83c]
pop ecx
mov ecx, dword [ebp - 0x848]
pop edi
pop esi
pop ebx
mov dword [ecx], eax
mov ecx, dword [ebp - 4]
mov al, byte [ebp - 0x815]
xor ecx, ebp
call fcn.00402813
leave
ret 0x18