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

Disassembly:
push 0x224
push 0x103abd8
call fcn.010027c0
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 0x103aa0f
mov edi, dword [ebp + 0xc]
cmp edi, ebx
je 0x103aa0f
xor eax, eax
mov word [esi], ax
lea eax, [ebp - 0x22c]
push eax
push 0x20019
push ebx
push 0x103ab68
push 0x80000002
call dword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegOpenKeyExW]
cmp eax, ebx
jne 0x103a96e
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 0x103ab4c
push dword [ebp - 0x22c]
call dword [sym.imp.API_MS_Win_Core_LocalRegistry_L1_1_0.dll_RegQueryValueExW]
cmp eax, ebx
jne 0x103a96e
mov eax, dword [ebp - 0x230]
dec eax
je 0x103a8f6
dec eax
jne 0x103a969
push edi
push esi
lea eax, [ebp - 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, ebx
je 0x103a8b5
push 0x103ab40
lea eax, [ebp - 0x224]
push eax
call sub.msvcrt.dll_wcsstr
pop ecx
pop ecx
test eax, eax
je 0x103a884
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 0x103aa0f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x1040184]
cmp ecx, 0x1040184
je 0x103a969
test byte [ecx + 0x1c], 8
je 0x103a969
cmp byte [ecx + 0x19], 2
jb 0x103a969
push eax
push esi
push 0x1027ae8
push 0xb
push dword [ecx + 0x14]
push dword [ecx + 0x10]
call fcn.0100d355
jmp 0x103a969
mov eax, dword [0x1040184]
cmp eax, 0x1040184
je 0x103a969
test byte [eax + 0x1c], 8
je 0x103a969
cmp byte [eax + 0x19], 2
jb 0x103a969
push esi
push 0x1027ae8
push 0xc
jmp 0x103a95e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x1040184]
cmp ecx, 0x1040184
je 0x103a96e
test byte [ecx + 0x1c], 8
je 0x103a96e
cmp byte [ecx + 0x19], 2
jb 0x103a96e
push eax
push 0x1027ae8
push 0xd
push dword [ecx + 0x14]
push dword [ecx + 0x10]
call fcn.01001f65
jmp 0x103a96e
push 0x103ab40
lea eax, [ebp - 0x224]
push eax
call sub.msvcrt.dll_wcsstr
pop ecx
pop ecx
test eax, eax
je 0x103a938
lea eax, [ebp - 0x224]
push eax
push edi
push esi
call fcn.010056eb
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 0x103aa0f
mov eax, dword [0x1040184]
cmp eax, 0x1040184
je 0x103a969
test byte [eax + 0x1c], 8
je 0x103a969
cmp byte [eax + 0x19], 2
jb 0x103a969
lea ecx, [ebp - 0x224]
push ecx
push 0x1027ae8
push 0xa
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.010020c5
xor eax, eax
mov word [esi], ax
push edi
push esi
push 0x103ab00
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ebx, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, edi
ja 0x103a996
push esi
call ebx
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov dword [ebp - 0x228], ecx
cmp dword [ebp - 0x228], 0
jne 0x103aa0d
push edi
push esi
push 0x103aab8
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, edi
ja 0x103a9c1
push esi
call ebx
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov dword [ebp - 0x228], ecx
cmp dword [ebp - 0x228], 0
jne 0x103aa0d
push 0x103aa88
push edi
push esi
call fcn.010056eb
push esi
call ebx
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov dword [ebp - 0x228], ecx
test ecx, ecx
jne 0x103aa0d
push edi
push esi
push 0x103aa48
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
cmp eax, edi
ja 0x103aa0d
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.0103aa30
mov eax, dword [ebp - 0x228]
call fcn.01002808
ret 8