Function at 0x41f340
Capabilities:
Query environment variable
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x22c
mov eax, dword [0x4ae480]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
mov edx, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
push eax
push edx
push str._s_shell_scommand
lea eax, [ebp - 0x20c]
mov dword [ebp - 0x22c], ebx
mov edi, ecx
mov dword [ebp - 0x218], 0
push 0x104
push eax
mov dword [ebp - 0x228], edi
mov dword [ebp - 0x21c], 0
call fcn.00401670
add esp, 0x14
lea eax, [ebp - 0x220]
push eax
push 1
push 0
lea eax, [ebp - 0x20c]
push eax
push 0x80000000
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x41f6f9
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
lea eax, [ebp - 0x21c]
push eax
push 0
push 0
push 0
push 0
push dword [ebp - 0x220]
call esi
mov eax, dword [ebp - 0x21c]
test eax, eax
je 0x41f411
push eax
call fcn.0047c4da
add esp, 4
mov dword [ebp - 0x218], eax
lea ecx, [ebp - 0x21c]
push ecx
push eax
push 0
push 0
push 0
push dword [ebp - 0x220]
call esi
mov esi, eax
jmp 0x41f416
mov esi, 2
push dword [ebp - 0x220]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0x218]
test eax, eax
je 0x41f6f9
test esi, esi
jne 0x41f6f9
push esi
push esi
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov esi, eax
test esi, esi
je 0x41f6f9
mov ecx, 2
mul ecx
mov ecx, 0xffffffff
cmovb eax, ecx
push eax
call fcn.0047c4da
add esp, 4
mov dword [ebp - 0x214], eax
push esi
push eax
push dword [ebp - 0x218]
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov eax, dword [ebp - 0x214]
cmp word [eax], 0
je 0x41f6fb
mov ecx, eax
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x41f490
sub ecx, edx
mov edx, ebx
sar ecx, 1
lea esi, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x41f4a4
sub edx, esi
sar edx, 1
lea edi, [edx + ecx]
mov ecx, 2
lea eax, [edi + 1]
mul ecx
mov ecx, 0xffffffff
cmovb eax, ecx
push eax
call fcn.0047c4da
mov edx, eax
mov dword [ebp - 0x224], 0
mov eax, dword [ebp - 0x228]
add esp, 4
mov dword [ebp - 0x210], edx
lea edi, [edx + edi*2]
mov dword [eax + 4], edx
mov eax, dword [ebp - 0x214]
mov esi, eax
movzx ecx, word [eax]
mov eax, ecx
cmp word [ebp - 0x224], cx
jae 0x41f519
cmp ax, 0x20
ja 0x41f519
movzx eax, word [esi + 2]
add esi, 2
xor ecx, ecx
cmp cx, ax
jb 0x41f505
cmp word [esi], 0
je 0x41f65c
cmp edx, edi
jae 0x41f65c
movzx eax, word [esi]
mov ecx, eax
cmp eax, 0x22
jne 0x41f5c5
cmp word [esi + 2], 0x25
jne 0x41f643
cmp word [esi + 4], 0x4c
jne 0x41f580
cmp word [esi + 6], ax
jne 0x41f580
push ebx
push 0x4a5e70
push 0
push 0
lea eax, [ebp - 0x210]
push eax
mov eax, edi
sub eax, edx
sar eax, 1
push eax
push edx
call fcn.00401bf0
mov edx, dword [ebp - 0x210]
add esp, 0x1c
add esi, 8
jmp 0x41f652
cmp word [esi + 4], 0x31
jne 0x41f643
cmp word [esi + 6], 0x22
jne 0x41f643
push ebx
push 0x4a5e70
push 0
push 0
lea eax, [ebp - 0x210]
push eax
mov eax, edi
sub eax, edx
sar eax, 1
push eax
push edx
call fcn.00401bf0
mov edx, dword [ebp - 0x210]
add esp, 0x1c
add esi, 8
jmp 0x41f652
cmp ecx, 0x25
jne 0x41f643
movzx eax, word [esi + 2]
mov ebx, eax
mov dword [ebp - 0x224], ebx
mov ebx, dword [ebp - 0x22c]
cmp eax, 0x4c
jne 0x41f60d
push ebx
push 0x4a5e70
push 0
push 0
lea eax, [ebp - 0x210]
push eax
mov eax, edi
sub eax, edx
sar eax, 1
push eax
push edx
call fcn.00401bf0
mov edx, dword [ebp - 0x210]
add esp, 0x1c
add esi, 4
jmp 0x41f652
cmp word [ebp - 0x224], 0x31
jne 0x41f643
push ebx
push 0x4a5e70
push 0
push 0
lea eax, [ebp - 0x210]
push eax
mov eax, edi
sub eax, edx
sar eax, 1
push eax
push edx
call fcn.00401bf0
mov edx, dword [ebp - 0x210]
add esp, 0x1c
add esi, 4
jmp 0x41f652
mov word [edx], cx
add edx, 2
mov dword [ebp - 0x210], edx
add esi, 2
cmp word [esi], 0
jne 0x41f523
mov edi, dword [ebp - 0x228]
xor eax, eax
mov word [edx], ax
mov esi, dword [edi + 4]
cmp word [esi], 0x22
jne 0x41f6a9
add esi, 2
mov ecx, esi
movzx eax, word [ecx]
mov edx, eax
test ax, ax
je 0x41f692
nop
cmp ax, 0x22
je 0x41f692
movzx eax, word [ecx + 2]
add ecx, 2
test ax, ax
jne 0x41f680
xor eax, eax
cmp ecx, esi
jbe 0x41f69f
push ecx
push esi
call fcn.0047bf80
mov dword [edi], eax
mov eax, dword [ebp - 0x214]
jmp 0x41f6fb
push str..exe
push esi
call fcn.0047d9be
add esp, 8
test eax, eax
je 0x41f6c0
lea ecx, [eax + 8]
jmp 0x41f692
movzx eax, word [esi + 2]
mov ecx, esi
add esi, 2
mov edx, eax
test ax, ax
je 0x41f6e2
cmp ax, 0x20
je 0x41f6e2
movzx eax, word [esi + 2]
add esi, 2
test ax, ax
jne 0x41f6d0
xor eax, eax
cmp esi, ecx
jbe 0x41f69f
push esi
push ecx
call fcn.0047bf80
mov dword [edi], eax
mov eax, dword [ebp - 0x214]
jmp 0x41f6fb
xor eax, eax
push eax
call fcn.004568b0
push dword [ebp - 0x218]
call fcn.004568b0
add esp, 8
cmp dword [edi], 0
je 0x41f735
cmp dword [edi + 4], 0
je 0x41f735
cmp dword [edi + 0xc], 0
je 0x41f735
pop edi
pop esi
mov al, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0047c26b
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [ebp - 4]
xor al, al
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0047c26b
mov esp, ebp
pop ebp
ret 0xc