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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x45c
mov eax, dword [0x1004058]
push ebx
mov ebx, dword [ebp + 0x14]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [ebp - 0x43c], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x438], eax
xor eax, eax
push 7
pop ecx
lea edi, [ebp - 0x458]
mov dword [ebp - 0x45c], 0x20
rep stosd dword es:[edi], eax
xor edi, edi
lea eax, [ebp - 0x41c]
mov dword [ebp - 0x42c], eax
mov dword [ebx], edi
mov eax, dword [esi + 4]
cmp eax, edi
mov dword [ebp - 0x424], edi
mov dword [ebp - 0x428], edi
mov dword [ebp - 0x420], edi
mov word [ebp - 0x41c], di
mov word [ebp - 0x210], di
jne 0x10014ac
lea eax, [ebp - 0x428]
push eax
push dword [esi]
call fcn.01001145
cmp eax, edi
jne 0x1002bc7
push 0x20a
push edi
call fcn.010018b0
mov edi, eax
test edi, edi
mov dword [ebp - 0x420], edi
je 0x1002d3a
and word [edi], 0
lea eax, [ebp - 0x434]
push eax
push edi
lea eax, [ebp - 0x430]
push eax
push 0
push 0x100157c
push dword [ebp - 0x428]
mov dword [ebp - 0x434], 0x20a
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x1002bc0
push 2
pop eax
cmp dword [ebp - 0x430], eax
jne 0x1002bc0
cmp word [edi], 0
je 0x1002bc0
push 0x104
lea eax, [ebp - 0x41c]
push eax
push edi
mov edi, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
call edi
lea eax, [ebp - 0x41c]
push eax
call fcn.010016b1
lea eax, [ebp - 0x434]
push eax
push dword [ebp - 0x420]
lea eax, [ebp - 0x430]
push eax
push 0
push 0x100155c
push dword [ebp - 0x428]
mov dword [ebp - 0x434], 0x20a
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x1002bce
cmp eax, 1
jle 0x1002bc0
cmp eax, 3
jg 0x1002bc0
push dword [ebp - 0x420]
and word [ebp - 0x210], 0
call fcn.01001628
and dword [ebp - 0x420], 0
push esi
push dword [ebp - 0x42c]
lea eax, [ebp - 0x210]
push eax
call fcn.01001647
test eax, eax
jne 0x100148a
cmp word [ebp - 0x210], ax
jne 0x1002b93
push ebx
push esi
push dword [ebp - 0x42c]
lea eax, [ebp - 0x210]
push eax
call fcn.01001805
test eax, eax
je 0x10014de
mov ecx, dword [ebp - 0x424]
and dword [ebp - 0x424], 0
mov dword [eax + 0x14], ecx
mov dword [esi + 4], eax
lea eax, [esi + 8]
push eax
push 1
push 0x1001544
push dword [ebp - 0x428]
call fcn.01001761
mov eax, dword [esi + 4]
xor edi, edi
cmp eax, edi
je 0x10014de
mov ecx, dword [esi + 8]
cmp ecx, edi
jne 0x10014b8
mov ecx, 0x1001538
push ebx
push ecx
push eax
call fcn.01001597
mov ecx, dword [ebp - 0x43c]
push edi
push 0x100151c
mov dword [ecx], eax
push dword [esi + 4]
call fcn.01001597
mov ecx, dword [ebp - 0x438]
mov dword [ecx], eax
xor esi, esi
cmp dword [ebp - 0x428], esi
je 0x10014f4
push dword [ebp - 0x428]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x420], esi
jne 0x1002d62
cmp dword [ebp - 0x424], esi
pop edi
pop esi
pop ebx
jne 0x1002d72
mov ecx, dword [ebp - 4]
call fcn.0100160a
leave
ret 0x10
lea eax, [ebp - 0x210]
mov dword [ebp - 0x454], eax
lea eax, [ebp - 0x45c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateActCtxW]
cmp eax, 0xffffffff
mov dword [ebp - 0x424], eax
jne 0x1001462
jmp 0x1002d57
mov dword [ebx], eax
jmp 0x10014de
mov dword [ebx], eax
jmp 0x10014a3
push 2
pop eax
cmp dword [ebp - 0x430], eax
jne 0x1002bc0
mov ecx, dword [ebp - 0x420]
cmp word [ecx], 0
je 0x1002bc0
push 0x104
lea eax, [ebp - 0x210]
push eax
push ecx
call edi
push dword [ebp - 0x420]
call fcn.01001628
and dword [ebp - 0x420], 0
lea eax, [ebp - 0x210]
push eax
call fcn.010016b1
lea eax, [ebp - 0x41c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
je 0x100143e
mov cx, word [ebp + eax*2 - 0x41e]
dec eax
cmp cx, 0x5c
je 0x1002d45
cmp cx, 0x2f
jne 0x1002c1f
jmp 0x1002d45
mov dword [ebx], 8
jmp 0x10014de
lea eax, [ebp + eax*2 - 0x41a]
mov dword [ebp - 0x42c], eax
jmp 0x100143e
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x1002bc0
push dword [ebp - 0x420]
call fcn.01001628
jmp 0x1001500
cmp dword [ebp - 0x424], 0xffffffff
je 0x100150f
push dword [ebp - 0x424]
call dword [sym.imp.KERNEL32.dll_ReleaseActCtx]
jmp 0x100150f