Function at 0x41fe3e
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 0x41fe67
test ebx, ebx
je 0x41fe67
mov eax, dword [ebp + 0xc]
and eax, 0xffff8100
mov dword [ebp - 0x88], eax
je 0x41fe7b
call dword [sym.imp.msvcrt.dll__errno]
mov dword [eax], 0x16
or eax, 0xffffffff
jmp 0x42077a
mov eax, dword [ebp + 8]
cmp byte [eax], 0
je 0x41fe9c
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov edi, dword [ebp + 8]
cmp byte [edi + eax - 1], 0x2f
jne 0x41fe9c
or dword [ebp + 0xc], 0x2000
bt dword [ebp + 0xc], 0xa
jae 0x42006e
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 0x42006e
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.004212d8
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.0041f87c
mov edx, eax
test eax, eax
jne 0x41ff3c
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.0041fe3e
mov dword [ebp - 0x88], eax
jmp 0x420066
lea edi, [eax + 1]
cmp byte [eax], 0x7d
mov dword [ebp - 0x7c], edi
je 0x41ff5f
mov eax, dword [ebp - 0x7c]
mov dword [ebp - 0x8c], edx
call fcn.0041f87c
mov edx, dword [ebp - 0x8c]
test eax, eax
jmp 0x41ff0f
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 0x41ff8f
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.0041fe3e
mov edx, dword [ebp - 0xa0]
test eax, eax
mov esi, eax
je 0x420012
cmp eax, 3
je 0x420012
cmp dword [ebp - 0x8c], 0
jne 0x42000a
mov dword [esp], ebx
call fcn.0041fa0c
mov dword [ebp - 0x88], esi
jmp 0x420066
cmp byte [edx], 0x7d
je 0x420044
lea esi, [edx + 1]
mov eax, esi
call fcn.0041f87c
mov edx, eax
test eax, eax
jne 0x41ffa8
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 0x420066
test dword [ebp + 0xc], 0x810
je 0x42005c
mov esp, dword [ebp - 0x80]
jmp 0x42006e
mov dword [ebp - 0x88], 3
mov esp, dword [ebp - 0x80]
jmp 0x42037f
mov dword [esp + 4], 0x2f
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strrchr
mov edx, eax
test eax, eax
jne 0x4200d4
mov dword [esp + 4], 0x3a
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strchr
mov edx, eax
test eax, eax
jne 0x4200d4
test dword [ebp + 0xc], 0x5000
je 0x420200
mov eax, dword [ebp + 8]
cmp byte [eax], 0x7e
jne 0x420200
mov dword [esp], eax
call sub.msvcrt.dll_strlen
xor edx, edx
mov dword [ebp - 0x80], eax
mov eax, dword [ebp + 8]
mov dword [ebp + 8], edx
mov dword [ebp - 0x7c], eax
jmp 0x42020c
cmp dword [ebp + 8], edx
jne 0x4200ef
inc dword [ebp + 8]
mov dword [ebp - 0x80], 1
mov dword [ebp - 0x7c], 0x42f926
jmp 0x42020c
mov eax, edx
sub eax, dword [ebp + 8]
cmp byte [edx], 0x3a
mov dword [ebp - 0x80], eax
je 0x42010a
mov eax, dword [ebp + 8]
inc eax
cmp eax, edx
jae 0x42016e
cmp byte [edx - 1], 0x3a
jne 0x42016e
mov eax, dword [ebp - 0x80]
mov dword [ebp - 0x84], edx
inc eax
mov dword [ebp - 0x7c], eax
mov eax, dword [ebp - 0x80]
add eax, 0x1d
shr eax, 4
shl eax, 4
call fcn.004212d8
mov esi, dword [ebp + 8]
mov ecx, dword [ebp - 0x7c]
sub esp, eax
lea eax, [esp + 0x1f]
and eax, 0xfffffff0
mov edi, eax
rep movsb byte es:[edi], byte [esi]
xor ecx, ecx
test byte [ebp + 0xc], 0x40
sete cl
mov byte [edi], 0
mov dword [esp + 4], ecx
mov dword [esp], eax
call fcn.0041fa4d
mov ecx, eax
mov eax, 3
test ecx, ecx
jne 0x42077a
mov eax, dword [ebp - 0x7c]
mov edx, dword [ebp - 0x84]
mov dword [ebp - 0x80], eax
mov eax, dword [ebp - 0x80]
add eax, 0x1c
shr eax, 4
shl eax, 4
call fcn.004212d8
mov esi, dword [ebp + 8]
mov ecx, dword [ebp - 0x80]
sub esp, eax
lea eax, [esp + 0x1f]
and eax, 0xfffffff0
cmp byte [edx + 1], 0
mov edi, eax
mov dword [ebp - 0x7c], eax
rep movsb byte es:[edi], byte [esi]
mov byte [edi], 0
lea edi, [edx + 1]
mov dword [ebp + 8], edi
jne 0x42020c
mov edi, dword [ebp - 0x80]
mov dl, byte [eax + edi - 1]
cmp dl, 0x3a
je 0x42020c
cmp edi, 2
jbe 0x4201c3
cmp byte [eax + edi - 2], 0x3a
jne 0x4201c5
cmp dl, 0x2f
jne 0x4201c5
jmp 0x42020c
jne 0x42020c
mov dword [esp + 0xc], ebx
mov edi, dword [ebp + 0x10]
mov dword [esp + 8], edi
mov edx, dword [ebp + 0xc]
mov dword [esp], eax
or edx, 2
mov dword [esp + 4], edx
call fcn.0041fe3e
test eax, eax
jne 0x42077a
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 0x42077a
xor eax, eax
mov dword [ebp - 0x7c], 0x42f924
mov dword [ebp - 0x80], eax
test byte [ebp + 0xc], 0x20
jne 0x420219
xor eax, eax
mov dword [ebx], eax
mov dword [ebx + 4], eax
mov eax, dword [ebx]
mov dword [ebp - 0x84], eax
test dword [ebp + 0xc], 0x5000
je 0x42029c
mov eax, dword [ebp - 0x7c]
cmp byte [eax], 0x7e
jne 0x42029c
mov al, byte [eax + 1]
test al, al
je 0x42023d
cmp al, 0x2f
jne 0x42029c
mov dword [esp], str.HOME
call sub.msvcrt.dll_getenv
mov esi, eax
test eax, eax
je 0x420254
cmp byte [eax], 0
jne 0x420259
mov esi, str.c:_users_default
mov eax, dword [ebp - 0x7c]
cmp byte [eax + 1], 0
je 0x420299
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.004212d8
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 0x42029c
mov dword [ebp - 0x7c], esi
cmp dword [ebp + 8], 0
jne 0x42038a
test byte [ebp + 0xc], 0x10
je 0x4202ba
mov esi, dword [ebp + 0xc]
mov edx, dword [ebx]
and esi, 8
jne 0x4202fc
xor eax, eax
jmp 0x4202ff
lea eax, [ebp - 0x48]
bt dword [ebp + 0xc], 9
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x7c]
mov dword [esp], eax
jae 0x4202f4
call dword [ebx + 0x20]
test eax, eax
je 0x4202e4
mov dword [ebp - 0x88], 3
jmp 0x42037f
mov ax, word [ebp - 0x42]
and ax, 0xf000
cmp ax, 0x4000
je 0x4202ac
jmp 0x4202d5
call dword [sym.imp.msvcrt.dll__stati64]
jmp 0x4202d1
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 0x420362
test esi, esi
jne 0x42034d
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 0x42036e
mov dword [esp], edi
call fcn.004254f4
jmp 0x420362
mov edx, dword [ebx + 8]
mov eax, dword [ebx]
lea ecx, [edi + eax*4]
cmp eax, edx
jae 0x420322
inc eax
mov dword [ebx], eax
xor eax, eax
mov dword [ecx], eax
jmp 0x420350
mov dword [ebp - 0x88], 1
jmp 0x42037f
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
mov eax, dword [ebp - 0x88]
jmp 0x42077a
xor eax, eax
test byte [ebp + 0xc], 0x40
sete al
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x7c]
mov dword [esp], eax
call fcn.0041fa4d
test eax, eax
je 0x4205f0
lea eax, [ebp - 0x6c]
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.0041fe3e
test eax, eax
jne 0x42077a
xor eax, eax
mov dword [ebp - 0x7c], eax
mov edi, dword [ebp - 0x6c]
mov esi, dword [ebx]
cmp dword [ebp - 0x7c], edi
jae 0x420463
mov eax, dword [ebp - 0x7c]
mov edx, dword [ebp - 0x7c]
mov ecx, dword [ebp + 0xc]
lea edi, [eax*4]
mov eax, dword [ebp - 0x68]
and ecx, 0xffffffce
mov edx, dword [eax + edx*4]
mov dword [esp + 4], ebx
or ecx, 0x20
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
mov eax, dword [ebp + 8]
call fcn.0041faa2
cmp eax, 3
je 0x42045b
test eax, eax
je 0x42043e
lea edx, [ebp - 0x6c]
mov dword [ebp - 0x7c], eax
mov dword [esp], edx
call fcn.0041fa0c
mov dword [esp], ebx
call fcn.0041fa0c
mov eax, dword [ebp - 0x7c]
jmp 0x42077a
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]
call fcn.0041f8dc
test eax, eax
jne 0x4204fb
inc dword [ebp - 0x7c]
jmp 0x4203df
mov eax, dword [ebp + 0xc]
or ah, 1
mov dword [ebp - 0x7c], eax
cmp dword [ebp - 0x84], esi
jne 0x4205e3
mov eax, 3
test byte [ebp + 0xc], 0x10
je 0x42077a
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
xor edx, edx
mov dword [ebp - 0x88], eax
inc eax
mov dword [ebp - 0x90], eax
mov eax, dword [ebp + 0xc]
and eax, 8
mov dword [ebp - 0x80], eax
je 0x4204af
mov edx, dword [ebx + 8]
lea eax, [edi + 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 0x4204d9
lea eax, [ebp - 0x6c]
mov dword [esp], eax
jmp 0x420666
cmp dword [ebp - 0x80], 0
jne 0x4204e6
xor edi, edi
mov dword [ebp - 0x80], edi
jmp 0x42053d
mov ecx, dword [ebx + 8]
mov edx, dword [ebx]
cmp edx, ecx
jae 0x4204df
lea esi, [edx + 1]
mov dword [ebx], esi
xor esi, esi
mov dword [eax + edx*4], esi
jmp 0x4204e9
lea eax, [ebp - 0x6c]
mov dword [esp], eax
call fcn.0041fa0c
jmp 0x420663
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 - 0x8c], eax
lea eax, [ebp - 0x48]
mov dword [esp + 4], eax
mov dword [esp], esi
jae 0x420557
call dword [ebx + 0x20]
test eax, eax
je 0x420547
inc dword [ebp - 0x80]
mov eax, dword [ebp - 0x80]
cmp eax, dword [ebp - 0x6c]
jb 0x42050b
jmp 0x4205b9
mov ax, word [ebp - 0x42]
and ax, 0xf000
cmp ax, 0x4000
jne 0x42053a
jmp 0x42055f
call dword [sym.imp.msvcrt.dll__stati64]
jmp 0x420536
mov edx, dword [ebx]
mov eax, dword [ebx + 4]
mov ecx, dword [ebp - 0x8c]
lea edi, [eax + edx*4]
mov eax, dword [ebp - 0x88]
mov dword [ebp - 0x94], edx
lea eax, [eax + ecx + 2]
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov edx, dword [ebp - 0x94]
test eax, eax
mov dword [edi], eax
je 0x4204fb
mov edi, eax
mov ecx, dword [ebp - 0x8c]
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp + 8]
mov ecx, dword [ebp - 0x90]
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 0x42053a
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 0x4205e3
mov dword [ebx + 4], eax
lea eax, [ebp - 0x6c]
mov dword [esp], eax
call fcn.0041fa0c
jmp 0x42064e
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.0041faa2
test eax, eax
jne 0x42077a
cmp dword [ebp - 0x80], 0
je 0x420648
mov eax, dword [ebp - 0x84]
test byte [ebp + 0xc], 8
je 0x420632
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.0041f8dc
test eax, eax
jne 0x420663
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x7c], eax
test byte [ebp - 0x7c], 2
je 0x420720
mov eax, dword [ebp - 0x84]
mov dword [ebp - 0x80], eax
jmp 0x4206a8
mov dword [esp], ebx
call fcn.0041fa0c
mov eax, 1
jmp 0x42077a
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 0x4206b1
call dword [ebx + 0x20]
test eax, eax
sete al
test al, al
jne 0x4206b9
inc dword [ebp - 0x80]
mov eax, dword [ebp - 0x80]
cmp eax, dword [ebx]
jb 0x420675
jmp 0x420720
call dword [sym.imp.msvcrt.dll__stati64]
jmp 0x42069c
mov ax, word [ebp - 0x42]
and ax, 0xf000
cmp ax, 0x4000
jne 0x4206a5
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 0x420663
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 0x4206a5
test byte [ebp - 0x7c], 4
je 0x42072a
xor eax, eax
jmp 0x42077a
test byte [ebp - 0x7c], 8
je 0x420746
mov eax, dword [ebx + 8]
cmp dword [ebp - 0x84], eax
cmovae eax, dword [ebp - 0x84]
mov dword [ebp - 0x84], eax
mov dword [esp + 0xc], 0x41f9d7
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 0x420726
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret