Function at 0x10122e5
Capabilities:
Check if file exists
Get file attributes
Query environment variable
Query or enumerate registry value

Disassembly:
push 0x224
push 0x1012778
call fcn.010027d1
mov esi, dword [ebp + 8]
xor ebx, ebx
mov dword [ebp - 0x228], ebx
mov dword [ebp - 0x22c], ebx
mov dword [ebp - 0x230], ebx
mov dword [ebp - 4], ebx
cmp esi, ebx
je 0x10125b3
mov edi, dword [ebp + 0xc]
cmp edi, ebx
je 0x10125b3
xor eax, eax
mov word [esi], ax
lea eax, [ebp - 0x22c]
push eax
push 0x20019
push ebx
push 0x1012708
push 0x80000002
call dword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegOpenKeyExW]
cmp eax, ebx
jne 0x1012512
mov dword [ebp - 0x234], 0x208
lea eax, [ebp - 0x234]
push eax
lea eax, [ebp - 0x224]
push eax
lea eax, [ebp - 0x230]
push eax
push ebx
push 0x10126ec
push dword [ebp - 0x22c]
call dword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegQueryValueExW]
cmp eax, ebx
jne 0x1012512
mov eax, dword [ebp - 0x230]
dec eax
je 0x101249a
dec eax
jne 0x101250d
push edi
push esi
lea eax, [ebp - 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, ebx
je 0x1012459
push 0x10126e0
lea eax, [ebp - 0x224]
push eax
call sub.msvcrt.dll_wcsstr
pop ecx
pop ecx
test eax, eax
je 0x1012428
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov dword [ebp - 0x228], ecx
cmp ecx, ebx
jne 0x10125b3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x10150c0]
cmp ecx, 0x10150c0
je 0x101250d
test byte [ecx + 0x1c], 8
je 0x101250d
cmp byte [ecx + 0x19], 2
jb 0x101250d
push eax
push esi
push 0x100ab80
push 0xb
push dword [ecx + 0x14]
push dword [ecx + 0x10]
call fcn.0100abe1
jmp 0x101250d
mov eax, dword [0x10150c0]
cmp eax, 0x10150c0
je 0x101250d
test byte [eax + 0x1c], 8
je 0x101250d
cmp byte [eax + 0x19], 2
jb 0x101250d
push esi
push 0x100ab80
push 0xc
jmp 0x1012502
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x10150c0]
cmp ecx, 0x10150c0
je 0x1012512
test byte [ecx + 0x1c], 8
je 0x1012512
cmp byte [ecx + 0x19], 2
jb 0x1012512
push eax
push 0x100ab80
push 0xd
push dword [ecx + 0x14]
push dword [ecx + 0x10]
call fcn.01002f89
jmp 0x1012512
push 0x10126e0
lea eax, [ebp - 0x224]
push eax
call sub.msvcrt.dll_wcsstr
pop ecx
pop ecx
test eax, eax
je 0x10124dc
lea eax, [ebp - 0x224]
push eax
push edi
push esi
call fcn.01001845
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov dword [ebp - 0x228], ecx
cmp ecx, ebx
jne 0x10125b3
mov eax, dword [0x10150c0]
cmp eax, 0x10150c0
je 0x101250d
test byte [eax + 0x1c], 8
je 0x101250d
cmp byte [eax + 0x19], 2
jb 0x101250d
lea ecx, [ebp - 0x224]
push ecx
push 0x100ab80
push 0xa
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.0100375d
xor eax, eax
mov word [esi], ax
push edi
push esi
push 0x10126a0
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ebx, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, edi
ja 0x101253a
push esi
call ebx
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov dword [ebp - 0x228], ecx
cmp dword [ebp - 0x228], 0
jne 0x10125b1
push edi
push esi
push 0x1012658
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, edi
ja 0x1012565
push esi
call ebx
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov dword [ebp - 0x228], ecx
cmp dword [ebp - 0x228], 0
jne 0x10125b1
push 0x101262c
push edi
push esi
call fcn.01001845
push esi
call ebx
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov dword [ebp - 0x228], ecx
test ecx, ecx
jne 0x10125b1
push edi
push esi
push 0x10125ec
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, edi
ja 0x10125b1
push esi
call ebx
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov dword [ebp - 0x228], ecx
xor ebx, ebx
mov dword [ebp - 4], 0xfffffffe
call fcn.010125d4
mov eax, dword [ebp - 0x228]
call fcn.0100228c
ret 8