Function at 0x41fe62
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0xac
cmp dword [ebp + 8], 0
mov ebx, dword [ebp + 0x14]
je 0x41fe8b
test ebx, ebx
je 0x41fe8b
mov eax, dword [ebp + 0xc]
and eax, 0xffff8100
mov dword [ebp - 0x88], eax
je 0x41fe9f
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], 0x16
or eax, 0xffffffff
jmp 0x4207b9
mov eax, dword [ebp + 8]
cmp byte [eax], 0
je 0x41fec0
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov edi, dword [ebp + 8]
cmp byte [edi + eax - 1], 0x2f
jne 0x41fec0
or dword [ebp + 0xc], 0x2000
bt dword [ebp + 0xc], 0xa
jae 0x420091
mov dword [esp + 4], 0x7b
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strchr
mov dword [ebp - 0x7c], eax
test eax, eax
je 0x420091
mov eax, dword [ebp + 8]
mov dword [ebp - 0x80], esp
mov dword [esp], eax
call sub.msvcrt.dll_strlen
add eax, 0xe
shr eax, 4
shl eax, 4
call fcn.00421314
mov ecx, dword [ebp - 0x7c]
mov esi, dword [ebp + 8]
sub ecx, dword [ebp + 8]
sub esp, eax
lea eax, [esp + 0x10]
mov edi, eax
mov dword [ebp - 0x84], eax
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp - 0x7c]
inc esi
mov eax, esi
mov dword [ebp - 0x98], edi
call fcn.0041f88c
mov edx, eax
test eax, eax
jne 0x41ff60
mov dword [esp + 0xc], ebx
mov eax, dword [ebp + 0x10]
mov dword [esp + 8], eax
mov eax, dword [ebp + 0xc]
and ah, 0xfb
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.0041fe62
mov dword [ebp - 0x88], eax
jmp 0x420089
lea edi, [eax + 1]
cmp byte [eax], 0x7d
mov dword [ebp - 0x7c], edi
je 0x41ff83
mov eax, dword [ebp - 0x7c]
mov dword [ebp - 0x8c], edx
call fcn.0041f88c
mov edx, dword [ebp - 0x8c]
test eax, eax
jmp 0x41ff33
mov dword [ebp - 0x94], edx
mov dword [esp], edi
call sub.msvcrt.dll_strlen
mov edx, dword [ebp - 0x94]
inc eax
mov dword [ebp - 0x90], eax
mov eax, dword [ebp + 0xc]
and eax, 0x20
mov dword [ebp - 0x8c], eax
jne 0x41ffb3
xor ecx, ecx
mov dword [ebx], ecx
mov dword [ebx + 4], ecx
mov eax, dword [ebx]
mov dword [ebp - 0x94], eax
mov eax, dword [ebp + 0xc]
and eax, 0xfffff7cf
or eax, 0x20
mov dword [ebp - 0x9c], eax
mov ecx, edx
mov edi, dword [ebp - 0x98]
mov dword [ebp - 0xa0], edx
sub ecx, esi
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp - 0x7c]
mov ecx, dword [ebp - 0x90]
rep movsb byte es:[edi], byte [esi]
mov dword [esp + 0xc], ebx
mov eax, dword [ebp + 0x10]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x9c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x84]
mov dword [esp], eax
call fcn.0041fe62
mov edx, dword [ebp - 0xa0]
test eax, eax
mov esi, eax
je 0x420036
cmp eax, 3
je 0x420036
cmp dword [ebp - 0x8c], 0
jne 0x42002e
mov dword [esp], ebx
call fcn.0041fa26
mov dword [ebp - 0x88], esi
jmp 0x420089
cmp byte [edx], 0x7d
je 0x420068
lea esi, [edx + 1]
mov eax, esi
call fcn.0041f88c
mov edx, eax
test eax, eax
jne 0x41ffcc
mov dword [esp + 8], 0x192
mov dword [esp + 4], str._make_4.4.1_lib_glob.c
mov dword [esp], str.next___NULL
call dword [sym.imp.msvcrt.dll__assert]
mov eax, dword [ebp - 0x94]
cmp dword [ebx], eax
jne 0x420089
test word [ebp + 0xc], 0x810
je 0x42007f
mov esp, dword [ebp - 0x80]
jmp 0x420091
mov dword [ebp - 0x88], 3
mov esp, dword [ebp - 0x80]
jmp 0x420617
mov dword [esp + 4], 0x2f
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strrchr
mov dword [ebp - 0x84], eax
test eax, eax
jne 0x4200fc
mov dword [esp + 4], 0x3a
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strchr
mov dword [ebp - 0x84], eax
test eax, eax
jne 0x4200fc
test byte [ebp + 0xd], 0x50
je 0x42023f
mov eax, dword [ebp + 8]
cmp byte [eax], 0x7e
jne 0x42023f
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov dword [ebp - 0x80], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x7c], eax
xor eax, eax
mov dword [ebp + 8], eax
jmp 0x42024b
mov eax, dword [ebp - 0x84]
cmp eax, dword [ebp + 8]
jne 0x42011d
inc dword [ebp + 8]
mov dword [ebp - 0x80], 1
mov dword [ebp - 0x7c], 0x42f926
jmp 0x42024b
mov eax, dword [ebp - 0x84]
sub eax, dword [ebp + 8]
mov dword [ebp - 0x80], eax
mov eax, dword [ebp - 0x84]
cmp byte [eax], 0x3a
je 0x420148
mov eax, dword [ebp + 8]
mov edi, dword [ebp - 0x84]
inc eax
cmp eax, edi
jae 0x4201a3
cmp byte [edi - 1], 0x3a
jne 0x4201a3
mov eax, dword [ebp - 0x80]
inc eax
mov dword [ebp - 0x7c], eax
mov eax, dword [ebp - 0x80]
add eax, 0x1d
shr eax, 4
shl eax, 4
call fcn.00421314
mov esi, dword [ebp + 8]
mov ecx, dword [ebp - 0x7c]
mov edx, dword [ebp + 0xc]
shr edx, 6
sub esp, eax
and edx, 1
lea eax, [esp + 0x1f]
xor edx, 1
and eax, 0xfffffff0
mov edi, eax
rep movsb byte es:[edi], byte [esi]
mov byte [edi], 0
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.0041fa67
mov edx, eax
mov eax, 3
test edx, edx
jne 0x4207b9
mov eax, dword [ebp - 0x7c]
mov dword [ebp - 0x80], eax
mov eax, dword [ebp - 0x80]
add eax, 0x1c
shr eax, 4
shl eax, 4
call fcn.00421314
mov esi, dword [ebp + 8]
mov ecx, dword [ebp - 0x80]
sub esp, eax
lea eax, [esp + 0x1f]
and eax, 0xfffffff0
mov edi, eax
mov dword [ebp - 0x7c], eax
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp - 0x84]
inc ecx
mov dword [ebp + 8], ecx
mov byte [edi], 0
mov edi, dword [ebp - 0x84]
cmp byte [edi + 1], 0
jne 0x42024b
mov edi, dword [ebp - 0x80]
mov dl, byte [eax + edi - 1]
cmp dl, 0x3a
je 0x42024b
cmp edi, 2
jbe 0x420202
cmp byte [eax + edi - 2], 0x3a
jne 0x420204
cmp dl, 0x2f
jne 0x420204
jmp 0x42024b
jne 0x42024b
mov dword [esp + 0xc], ebx
mov ecx, dword [ebp + 0x10]
mov dword [esp + 8], ecx
mov edx, dword [ebp + 0xc]
mov dword [esp], eax
or edx, 2
mov dword [esp + 4], edx
call fcn.0041fe62
test eax, eax
jne 0x4207b9
mov edx, dword [ebx + 0xc]
mov ecx, dword [ebp + 0xc]
and edx, 0xfffffffd
and ecx, 2
or edx, ecx
mov dword [ebx + 0xc], edx
jmp 0x4207b9
xor eax, eax
mov dword [ebp - 0x7c], 0x42f924
mov dword [ebp - 0x80], eax
test byte [ebp + 0xc], 0x20
jne 0x420258
xor eax, eax
mov dword [ebx], eax
mov dword [ebx + 4], eax
mov eax, dword [ebx]
mov dword [ebp - 0x84], eax
test byte [ebp + 0xd], 0x50
je 0x4202d8
mov eax, dword [ebp - 0x7c]
cmp byte [eax], 0x7e
jne 0x4202d8
mov al, byte [eax + 1]
test al, al
je 0x420279
cmp al, 0x2f
jne 0x4202d8
mov dword [esp], str.HOME
call sub.msvcrt.dll_getenv
mov esi, eax
test eax, eax
je 0x420290
cmp byte [eax], 0
jne 0x420295
mov esi, str.c:_users_default
mov eax, dword [ebp - 0x7c]
cmp byte [eax + 1], 0
je 0x4202d5
mov dword [esp], esi
call sub.msvcrt.dll_strlen
mov ecx, eax
mov eax, dword [ebp - 0x80]
lea eax, [eax + ecx + 0x1b]
shr eax, 4
shl eax, 4
call fcn.00421314
sub esp, eax
lea eax, [esp + 0x1f]
and eax, 0xfffffff0
mov edi, eax
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp - 0x7c]
mov ecx, dword [ebp - 0x80]
mov dword [ebp - 0x7c], eax
inc esi
rep movsb byte es:[edi], byte [esi]
jmp 0x4202d8
mov dword [ebp - 0x7c], esi
cmp dword [ebp + 8], 0
jne 0x4203c3
test byte [ebp + 0xc], 0x10
je 0x4202f6
mov esi, dword [ebp + 0xc]
mov edx, dword [ebx]
and esi, 8
jne 0x420338
xor eax, eax
jmp 0x42033b
lea eax, [ebp - 0x48]
bt dword [ebp + 0xc], 9
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x7c]
mov dword [esp], eax
jae 0x420330
call dword [ebx + 0x20]
test eax, eax
je 0x420320
mov dword [ebp - 0x88], 3
jmp 0x420617
mov ax, word [ebp - 0x42]
and ax, 0xf000
cmp ax, 0x4000
je 0x4202e8
jmp 0x420311
call dword [sym.imp.msvcrt.dll__stati64]
jmp 0x42030d
mov eax, dword [ebx + 8]
lea eax, [edx + eax + 2]
shl eax, 2
mov dword [esp + 4], eax
mov eax, dword [ebx + 4]
mov dword [esp], eax
call sub.msvcrt.dll_realloc
mov dword [ebx + 4], eax
mov edi, eax
test eax, eax
je 0x42039e
test esi, esi
jne 0x420389
mov esi, dword [ebx]
mov eax, dword [ebp - 0x7c]
lea edx, [esi*4]
mov dword [ebp - 0x80], edx
mov dword [esp], eax
call sub.msvcrt.dll__strdup
mov edx, dword [ebp - 0x80]
test eax, eax
mov dword [edi + esi*4], eax
jne 0x4203ad
mov dword [esp], edi
call fcn.004258bc
jmp 0x42039e
mov edx, dword [ebx + 8]
mov eax, dword [ebx]
lea ecx, [edi + eax*4]
cmp eax, edx
jae 0x42035e
inc eax
mov dword [ebx], eax
xor eax, eax
mov dword [ecx], eax
jmp 0x42038c
mov dword [ebp - 0x88], 1
jmp 0x420617
lea eax, [esi + 1]
mov dword [ebx], eax
xor eax, eax
mov dword [edi + edx + 4], eax
mov eax, dword [ebp + 0xc]
mov dword [ebx + 0xc], eax
jmp 0x420617
mov eax, dword [ebp + 0xc]
shr eax, 6
and eax, 1
xor eax, 1
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x7c]
mov dword [esp], eax
call fcn.0041fa67
mov dword [ebp - 0x88], eax
test eax, eax
je 0x42062f
lea eax, [ebp - 0x6c]
xor edi, edi
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 8], eax
mov eax, dword [ebp + 0xc]
and eax, 0x51
or eax, 0x2004
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x7c]
mov dword [esp], eax
call fcn.0041fe62
test eax, eax
jne 0x4207b9
mov ecx, dword [ebp - 0x6c]
mov esi, dword [ebx]
cmp edi, ecx
jae 0x42048f
mov eax, dword [ebp - 0x68]
mov ecx, dword [ebp + 0xc]
mov edx, dword [eax + edi*4]
mov dword [esp + 4], ebx
and ecx, 0xffffffce
mov eax, dword [ebp + 0x10]
or ecx, 0x20
mov dword [esp], eax
mov eax, dword [ebp + 8]
call fcn.0041fabc
cmp eax, 3
je 0x42048c
test eax, eax
je 0x42046f
lea edx, [ebp - 0x6c]
mov dword [ebp - 0x7c], eax
mov dword [esp], edx
call fcn.0041fa26
mov dword [esp], ebx
call fcn.0041fa26
mov eax, dword [ebp - 0x7c]
jmp 0x4207b9
mov eax, dword [ebx + 4]
mov ecx, dword [ebx]
lea edx, [eax + esi*4]
mov eax, dword [ebp - 0x68]
sub ecx, esi
mov eax, dword [eax + edi*4]
call fcn.0041f8ec
test eax, eax
jne 0x420525
inc edi
jmp 0x42041e
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x80], ecx
or ah, 1
mov dword [ebp - 0x7c], eax
cmp dword [ebp - 0x84], esi
jne 0x420622
mov eax, 3
test byte [ebp + 0xc], 0x10
je 0x4207b9
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov edi, dword [ebp + 0xc]
xor edx, edx
mov ecx, dword [ebp - 0x80]
mov dword [ebp - 0x8c], eax
inc eax
and edi, 8
mov dword [ebp - 0x94], eax
je 0x4204de
mov edx, dword [ebx + 8]
lea eax, [ecx + esi + 1]
add eax, edx
shl eax, 2
mov dword [esp + 4], eax
mov eax, dword [ebx + 4]
mov dword [esp], eax
call sub.msvcrt.dll_realloc
mov dword [ebx + 4], eax
test eax, eax
jne 0x420505
lea eax, [ebp - 0x6c]
mov dword [esp], eax
jmp 0x420533
test edi, edi
jne 0x420510
xor edi, edi
mov dword [ebp - 0x80], edi
jmp 0x42056f
mov ecx, dword [ebx + 8]
mov edx, dword [ebx]
cmp edx, ecx
jae 0x420509
lea esi, [edx + 1]
mov dword [ebx], esi
xor esi, esi
mov dword [eax + edx*4], esi
jmp 0x420513
lea eax, [ebp - 0x6c]
mov dword [esp], eax
call fcn.0041fa26
mov dword [esp], ebx
call fcn.0041fa26
jmp 0x420617
mov eax, dword [ebp - 0x68]
mov esi, dword [ebp - 0x80]
mov esi, dword [eax + esi*4]
mov dword [esp], esi
call sub.msvcrt.dll_strlen
bt dword [ebp + 0xc], 9
mov dword [ebp - 0x90], eax
lea eax, [ebp - 0x48]
mov dword [esp + 4], eax
mov dword [esp], esi
jae 0x420589
call dword [ebx + 0x20]
test eax, eax
je 0x420579
inc dword [ebp - 0x80]
mov eax, dword [ebp - 0x80]
cmp eax, dword [ebp - 0x6c]
jb 0x42053d
jmp 0x4205eb
mov ax, word [ebp - 0x42]
and ax, 0xf000
cmp ax, 0x4000
jne 0x42056c
jmp 0x420591
call dword [sym.imp.msvcrt.dll__stati64]
jmp 0x420568
mov edx, dword [ebx]
mov eax, dword [ebx + 4]
mov ecx, dword [ebp - 0x90]
lea edi, [eax + edx*4]
mov eax, dword [ebp - 0x8c]
mov dword [ebp - 0x98], edx
lea eax, [eax + ecx + 2]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov edx, dword [ebp - 0x98]
test eax, eax
mov dword [edi], eax
je 0x420525
mov edi, eax
mov ecx, dword [ebp - 0x90]
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp + 8]
mov ecx, dword [ebp - 0x94]
lea eax, [edi + 1]
mov byte [edi], 0x2f
mov edi, eax
lea eax, [edx + 1]
rep movsb byte es:[edi], byte [esi]
mov dword [ebx], eax
jmp 0x42056c
mov edx, dword [ebx]
mov eax, dword [ebx + 4]
xor ecx, ecx
mov edi, dword [ebp - 0x7c]
mov dword [eax + edx*4], ecx
lea edx, [edx*4 + 4]
mov dword [ebx + 0xc], edi
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_realloc
test eax, eax
je 0x420622
mov dword [ebx + 4], eax
jmp 0x420622
mov eax, dword [ebp - 0x88]
jmp 0x4207b9
lea eax, [ebp - 0x6c]
mov dword [esp], eax
call fcn.0041fa26
jmp 0x42068d
mov dword [esp + 4], ebx
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp - 0x7c]
mov eax, dword [ebp + 8]
call fcn.0041fabc
test eax, eax
jne 0x4207b9
cmp dword [ebp - 0x80], 0
je 0x420687
mov eax, dword [ebp - 0x84]
test byte [ebp + 0xc], 8
je 0x420671
mov eax, dword [ebx + 8]
cmp dword [ebp - 0x84], eax
cmovae eax, dword [ebp - 0x84]
mov ecx, dword [ebx]
mov edx, dword [ebx + 4]
sub ecx, eax
lea edx, [edx + eax*4]
mov eax, dword [ebp - 0x7c]
call fcn.0041f8ec
test eax, eax
jne 0x4206a2
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x7c], eax
test byte [ebp - 0x7c], 2
je 0x42075f
mov eax, dword [ebp - 0x84]
mov dword [ebp - 0x80], eax
jmp 0x4206e7
mov dword [esp], ebx
call fcn.0041fa26
mov eax, 1
jmp 0x4207b9
mov eax, dword [ebp - 0x80]
mov ecx, dword [ebp - 0x80]
bt dword [ebp - 0x7c], 9
lea edx, [ebp - 0x48]
lea esi, [eax*4]
mov eax, dword [ebx + 4]
mov eax, dword [eax + ecx*4]
mov dword [esp + 4], edx
mov dword [esp], eax
jae 0x4206f0
call dword [ebx + 0x20]
test eax, eax
sete al
test al, al
jne 0x4206f8
inc dword [ebp - 0x80]
mov eax, dword [ebp - 0x80]
cmp eax, dword [ebx]
jb 0x4206b4
jmp 0x42075f
call dword [sym.imp.msvcrt.dll__stati64]
jmp 0x4206db
mov ax, word [ebp - 0x42]
and ax, 0xf000
cmp ax, 0x4000
jne 0x4206e4
mov eax, dword [ebx + 4]
mov edx, dword [eax + esi]
mov dword [esp], edx
mov dword [ebp - 0x88], edx
call sub.msvcrt.dll_strlen
mov edi, eax
lea eax, [eax + 2]
mov dword [esp + 4], eax
mov edx, dword [ebp - 0x88]
mov dword [esp], edx
call sub.msvcrt.dll_realloc
test eax, eax
je 0x4206a2
add edi, eax
mov dword [esp + 4], 0x42f926
mov dword [ebp - 0x88], eax
mov dword [esp], edi
call sub.msvcrt.dll_strcpy
mov eax, dword [ebx + 4]
mov edx, dword [ebp - 0x88]
mov dword [eax + esi], edx
jmp 0x4206e4
test byte [ebp - 0x7c], 4
je 0x420769
xor eax, eax
jmp 0x4207b9
test byte [ebp - 0x7c], 8
je 0x420785
mov eax, dword [ebx + 8]
cmp dword [ebp - 0x84], eax
cmovae eax, dword [ebp - 0x84]
mov dword [ebp - 0x84], eax
mov dword [esp + 0xc], 0x41f9f1
mov dword [esp + 8], 4
mov eax, dword [ebx]
mov ecx, dword [ebp - 0x84]
sub eax, ecx
mov dword [esp + 4], eax
mov eax, dword [ebx + 4]
mov ebx, dword [ebp - 0x84]
lea eax, [eax + ebx*4]
mov dword [esp], eax
call sub.msvcrt.dll_qsort
jmp 0x420765
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret