Function at 0x186ce630
Capabilities:
Query environment variable
Query or enumerate registry key

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x186c0f26
mov eax, dword fs:[0]
push eax
mov eax, 0x10240
call fcn.18615d60
mov eax, dword [0x1870626c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
cmp dword [ebp + 0x10], 0x14
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
ja 0x186ceb5f
mov edi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
lea edx, [ebp - 0x10214]
push edx
push 0xf013f
push 0
push ecx
push eax
call edi
test eax, eax
jne 0x186ceb5f
push eax
push eax
push eax
push eax
lea eax, [ebp - 0x10224]
mov dword [ebp - 0x10224], 0xff
push eax
lea eax, [ebp - 0x210]
mov dword [ebp - 0x10218], 1
push eax
push 0
push dword [ebp - 0x10214]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
jne 0x186ceb57
nop word [eax + eax]
lea eax, [ebp - 0x210]
push 0x18869018
push eax
call fcn.18645aab
add esp, 8
test eax, eax
jne 0x186ce7ee
lea eax, [ebp - 0x1021c]
push eax
push 0xf013f
push 0
lea eax, [ebp - 0x210]
push eax
push dword [ebp - 0x10214]
call edi
test eax, eax
jne 0x186ce7ee
mov dword [ebp - 0x10240], eax
mov dword [ebp - 0x10244], 1
mov dword [ebp - 0x10230], 0x18868524
mov dword [ebp - 0x1022c], eax
mov dword [ebp - 0x10228], eax
mov dword [ebp - 4], eax
lea ecx, [ebx + 4]
lea eax, [ebp - 0x10240]
push eax
lea eax, [ebp - 0x10230]
push eax
lea eax, [ebp - 0x10244]
push eax
mov eax, dword [ebx + 4]
push 0
push dword [ebp - 0x1021c]
mov eax, dword [eax + 8]
add ecx, eax
call fcn.186cce66
test eax, eax
je 0x186cea3a
push dword [ebp - 0x1021c]
call esi
lea eax, [ebp - 0x10220]
push eax
push 0xf013f
push 0
push 0x18869024
push dword [ebp - 0x10214]
call edi
test eax, eax
je 0x186ce86a
push dword [ebp - 0x1021c]
call esi
mov edi, dword [ebp - 0x10228]
mov dword [ebp - 4], 0xffffffff
mov dword [ebp - 0x10230], 0x18868524
test edi, edi
je 0x186ce7ee
or eax, 0xffffffff
lock xadd dword [edi + 4], eax
jne 0x186ce7ee
mov eax, dword [edi]
mov ecx, edi
call dword [eax]
or eax, 0xffffffff
lock xadd dword [edi + 8], eax
jne 0x186ce7ee
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 4]
mov eax, dword [ebp + 0x10]
mov ecx, ebx
inc eax
push eax
lea eax, [ebp - 0x210]
push eax
push dword [ebp - 0x10214]
call fcn.186ce630
mov edi, eax
cmp edi, 2
je 0x186ceb4b
cmp edi, 1
je 0x186ceb4b
mov edi, dword [ebp - 0x10218]
lea ecx, [ebp - 0x10224]
push 0
push 0
push 0
push 0
push ecx
lea ecx, [ebp - 0x210]
mov dword [ebp - 0x10224], 0xff
mov eax, edi
inc edi
push ecx
push eax
push dword [ebp - 0x10214]
mov dword [ebp - 0x10218], edi
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
jne 0x186ceb57
mov edi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
jmp 0x186ce6e0
mov dword [ebp - 0x10248], 0
mov dword [ebp - 0x1024c], 1
mov dword [ebp - 0x1023c], 0x18868524
mov dword [ebp - 0x10238], 0
mov dword [ebp - 0x10234], 0
lea eax, [ebp - 0x10248]
mov byte [ebp - 4], 1
push eax
lea eax, [ebp - 0x1023c]
push eax
lea eax, [ebp - 0x1024c]
push eax
mov eax, dword [ebx + 4]
lea ecx, [ebx + 4]
push 0
push dword [ebp - 0x10220]
mov eax, dword [eax + 8]
add ecx, eax
call fcn.186cce66
test eax, eax
jne 0x186cea08
push 1
lea eax, [ebp - 0x1023c]
push eax
mov eax, dword [ebx + 4]
lea ecx, [ebx + 4]
mov eax, dword [eax + 8]
add ecx, eax
call fcn.186cc2a4
test al, al
je 0x186ce939
mov eax, dword [ebx]
mov ecx, ebx
push dword [ebp - 0x10238]
call dword [eax + 0x10]
push dword [ebp - 0x10214]
test eax, eax
jne 0x186cea0e
call esi
push dword [ebp - 0x10220]
call esi
lea ecx, [ebp - 0x1023c]
mov esi, 1
call fcn.186cbd49
lea ecx, [ebp - 0x10230]
call fcn.186cbd49
mov eax, esi
jmp 0x186ceb61
push 0x8000
lea eax, [ebp - 0x10210]
push eax
push dword [ebp - 0x10238]
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea eax, [ebp - 0x10210]
push eax
lea ecx, [ebp - 0x10218]
call fcn.185b0640
mov eax, dword [ebp - 0x10218]
cmp dword [eax - 0xc], 0
jl 0x186ce9cb
push 0x18861a3c
push eax
call fcn.1863dbff
add esp, 8
test eax, eax
je 0x186ce9cb
sub eax, dword [ebp - 0x10218]
sar eax, 1
cmp eax, 0xffffffff
je 0x186ce9cb
push dword [ebp - 0x10214]
call esi
push dword [ebp - 0x10220]
call esi
lea ecx, [ebp - 0x10218]
mov esi, 1
call fcn.185ae0b7
lea ecx, [ebp - 0x1023c]
call fcn.186cbd49
lea ecx, [ebp - 0x10230]
call fcn.186cbd49
mov eax, esi
jmp 0x186ceb61
push dword [ebp - 0x10214]
call esi
push dword [ebp - 0x10220]
call esi
lea ecx, [ebp - 0x10218]
mov esi, 2
call fcn.185ae0b7
lea ecx, [ebp - 0x1023c]
call fcn.186cbd49
lea ecx, [ebp - 0x10230]
call fcn.186cbd49
mov eax, esi
jmp 0x186ceb61
push dword [ebp - 0x10214]
call esi
push dword [ebp - 0x10220]
call esi
lea ecx, [ebp - 0x1023c]
mov esi, 2
call fcn.186cbd49
lea ecx, [ebp - 0x10230]
call fcn.186cbd49
mov eax, esi
jmp 0x186ceb61
push 1
lea eax, [ebp - 0x10230]
push eax
mov eax, dword [ebx + 4]
lea ecx, [ebx + 4]
mov eax, dword [eax + 8]
add ecx, eax
call fcn.186cc2a4
test al, al
je 0x186ceab0
mov eax, dword [ebx]
mov ecx, ebx
push dword [ebp - 0x1022c]
call dword [eax + 0x10]
push dword [ebp - 0x10214]
test eax, eax
je 0x186cea8f
call esi
push dword [ebp - 0x1021c]
call esi
lea ecx, [ebp - 0x10230]
mov esi, 2
call fcn.186cbd49
mov eax, esi
jmp 0x186ceb61
call esi
push dword [ebp - 0x1021c]
call esi
lea ecx, [ebp - 0x10230]
mov esi, 1
call fcn.186cbd49
mov eax, esi
jmp 0x186ceb61
push 0x8000
lea eax, [ebp - 0x10210]
push eax
push dword [ebp - 0x1022c]
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea eax, [ebp - 0x10210]
push eax
lea ecx, [ebp - 0x10218]
call fcn.185b0640
mov eax, dword [ebp - 0x10218]
cmp dword [eax - 0xc], 0
jl 0x186ceb1c
push 0x18861a3c
push eax
call fcn.1863dbff
add esp, 8
test eax, eax
je 0x186ceb1c
sub eax, dword [ebp - 0x10218]
sar eax, 1
cmp eax, 0xffffffff
je 0x186ceb1c
push dword [ebp - 0x10214]
call esi
push dword [ebp - 0x1021c]
call esi
mov esi, 1
jmp 0x186ceb31
push dword [ebp - 0x10214]
call esi
push dword [ebp - 0x1021c]
call esi
mov esi, 2
lea ecx, [ebp - 0x10218]
call fcn.185ae0b7
lea ecx, [ebp - 0x10230]
call fcn.186cbd49
mov eax, esi
jmp 0x186ceb61
push dword [ebp - 0x10214]
call esi
mov eax, edi
jmp 0x186ceb61
push dword [ebp - 0x10214]
call esi
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.18615399
mov esp, ebp
pop ebp
ret 0xc