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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x22c
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push 1
xor edi, edi
mov eax, dword [esi]
mov dword [ebp - 0x24], edi
mov ebx, dword [eax + 8]
pop eax
push ebx
mov dword [ebp - 8], ebx
mov dword [esi + 4], eax
mov dword [esi + 8], eax
call fcn.01007d22
test eax, eax
je 0x10136d6
mov dword [esi + 4], edi
mov dword [esi + 8], edi
mov dword [esi + 0xc], edi
mov ax, word [0x100bcfa]
mov word [ebp - 0x20], ax
lea eax, [ebp - 0xc]
push eax
push 0x20019
push edi
push 0x100bb80
push dword [ebx + 0x68]
call dword [sym.imp.ADVAPI32.DLL_RegOpenKeyExW]
mov ebx, dword [sym.imp.ADVAPI32.DLL_RegQueryValueExA]
cmp eax, edi
jne 0x10135ce
lea eax, [ebp + 8]
mov dword [ebp + 8], 0xa
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 4]
push eax
push edi
push 0x100bb6c
push dword [ebp - 0xc]
call ebx
cmp eax, edi
jne 0x1013532
cmp dword [ebp - 4], 1
jne 0x1013532
lea eax, [ebp - 0x20]
push eax
call dword [sym.imp.MSVCRT.DLL_atoi]
pop ecx
mov dword [esi + 4], eax
lea eax, [ebp + 8]
mov dword [ebp + 8], 0xa
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 4]
push eax
push edi
push 0x100bce8
push dword [ebp - 0xc]
call ebx
cmp eax, edi
jne 0x1013568
cmp dword [ebp - 4], 1
jne 0x1013568
lea eax, [ebp - 0x20]
push eax
call dword [sym.imp.MSVCRT.DLL_atoi]
pop ecx
mov dword [esi + 8], eax
lea eax, [ebp + 8]
mov dword [ebp + 8], edi
push eax
lea eax, [ebp - 4]
push edi
push eax
push edi
push 0x100bccc
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.DLL_RegQueryValueExW]
cmp eax, 2
je 0x101377f
push dword [ebp + 8]
push edi
call dword [sym.imp.KERNEL32.DLL_LocalAlloc]
cmp eax, edi
mov dword [esi + 0xc], eax
je 0x10135c5
lea ecx, [ebp + 8]
push ecx
push eax
lea eax, [ebp - 4]
push eax
push edi
push 0x100bccc
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.DLL_RegQueryValueExW]
cmp eax, edi
je 0x10135c5
push dword [esi + 0xc]
call dword [sym.imp.KERNEL32.DLL_LocalFree]
mov dword [esi + 0xc], edi
push dword [ebp - 0xc]
call dword [sym.imp.ADVAPI32.DLL_RegCloseKey]
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 8]
push 0x20019
push edi
push 0x100bc58
push dword [eax + 0x68]
call dword [sym.imp.ADVAPI32.DLL_RegOpenKeyExW]
test eax, eax
jne 0x10136ce
lea eax, [ebp + 8]
mov dword [ebp + 8], 0xa
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 4]
push eax
push edi
push 0x100bb6c
push dword [ebp - 0x10]
call ebx
cmp eax, edi
jne 0x1013627
cmp dword [ebp - 4], 1
jne 0x1013627
lea eax, [ebp - 0x20]
push eax
call dword [sym.imp.MSVCRT.DLL_atoi]
pop ecx
mov dword [esi + 4], eax
lea eax, [ebp + 8]
mov dword [ebp + 8], 0xa
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 4]
push eax
push edi
push 0x100bce8
push dword [ebp - 0x10]
call ebx
cmp eax, edi
jne 0x101365d
cmp dword [ebp - 4], 1
jne 0x101365d
lea eax, [ebp - 0x20]
push eax
call dword [sym.imp.MSVCRT.DLL_atoi]
pop ecx
mov dword [esi + 8], eax
lea eax, [ebp + 8]
mov ebx, dword [sym.imp.ADVAPI32.DLL_RegQueryValueExW]
push eax
lea eax, [ebp - 4]
push edi
push eax
push edi
push 0x100bccc
push dword [ebp - 0x10]
mov dword [ebp + 8], edi
call ebx
cmp eax, 2
je 0x10136c5
mov eax, dword [esi + 0xc]
cmp eax, edi
je 0x1013690
push eax
call dword [sym.imp.KERNEL32.DLL_LocalFree]
mov dword [esi + 0xc], edi
push dword [ebp + 8]
push edi
call dword [sym.imp.KERNEL32.DLL_LocalAlloc]
cmp eax, edi
mov dword [esi + 0xc], eax
je 0x10136c5
lea ecx, [ebp + 8]
push ecx
push eax
lea eax, [ebp - 4]
push eax
push edi
push 0x100bccc
push dword [ebp - 0x10]
call ebx
cmp eax, edi
je 0x10136c5
push dword [esi + 0xc]
call dword [sym.imp.KERNEL32.DLL_LocalFree]
mov dword [esi + 0xc], edi
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.DLL_RegCloseKey]
push dword [ebp - 8]
call fcn.01007d87
mov eax, dword [esi + 0xc]
cmp eax, edi
je 0x1013775
mov ebx, dword [sym.imp.KERNEL32.DLL_lstrlenW]
push eax
call ebx
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x22c]
push 0x104
push eax
push dword [esi + 0xc]
call dword [sym.imp.KERNEL32.DLL_ExpandEnvironmentStringsW]
dec eax
cmp eax, dword [ebp - 0x14]
mov dword [ebp - 8], eax
je 0x1013787
push dword [esi + 0xc]
call dword [sym.imp.KERNEL32.DLL_LocalFree]
push 0x1021a50
call ebx
add eax, dword [ebp - 8]
lea eax, [eax + eax + 2]
push eax
push 0x40
call dword [sym.imp.KERNEL32.DLL_LocalAlloc]
cmp eax, edi
mov dword [esi + 0xc], eax
je 0x1013775
mov ebx, dword [sym.imp.MSVCRT.DLL_wcscpy]
lea ecx, [ebp - 0x22c]
push ecx
push eax
call ebx
mov eax, dword [esi + 0xc]
pop ecx
pop ecx
mov ecx, dword [ebp - 8]
push 0x1021a50
lea eax, [eax + ecx*2]
push eax
call ebx
pop ecx
pop ecx
push 0x100bc48
push dword [esi + 0xc]
call dword [sym.imp.MSVCRT.DLL__wcsicmp]
pop ecx
test eax, eax
pop ecx
jne 0x101376e
mov dword [esi + 8], edi
mov dword [ebp - 0x24], 1
mov eax, dword [ebp - 0x24]
pop edi
pop esi
pop ebx
leave
ret 4
mov dword [esi + 8], edi
jmp 0x10135c5
push 0x42
push 0x1021a50
call ebx
push dword [esi + 0xc]
mov edx, eax
mov dword [ebp - 0x14], edx
call ebx
mov ecx, dword [ebp - 0x14]
add ecx, eax
lea eax, [ecx + ecx + 2]
push eax
push dword [esi + 0xc]
call dword [sym.imp.KERNEL32.DLL_LocalReAlloc]
cmp eax, edi
je 0x1013775
push 0x1021a50
push eax
mov dword [esi + 0xc], eax
call dword [sym.imp.KERNEL32.DLL_lstrcatW]
jmp 0x1013757