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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffdb8
push ebx
push esi
xor ebx, ebx
mov dword [ebp - 0x244], ebx
mov dword [ebp - 0x248], ebx
mov dword [ebp - 0x240], ebx
mov dword [ebp - 0x23c], ebx
mov dword [ebp - 0x230], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0xc], ebx
mov esi, ecx
mov dword [ebp - 4], edx
mov eax, dword [ebp - 4]
call fcn.51004a94
xor eax, eax
push ebp
push 0x510b90bb
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, esi
call fcn.510045e4
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x230]
mov edx, dword [ebp - 4]
call fcn.51004e28
mov eax, dword [ebp - 0x230]
call fcn.51004e38
push eax
call sub.ole32.dll_CLSIDFromProgID
mov ebx, eax
mov eax, ebx
call fcn.51016e18
test al, al
je 0x510b9085
lea edx, [ebp - 8]
lea eax, [ebp - 0x24]
call fcn.510660d8
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
mov dword [ebp - 0x238], eax
mov byte [ebp - 0x234], 0xb
lea edx, [ebp - 0x238]
xor ecx, ecx
mov eax, 0x510b90d0
call fcn.51009ec0
lea eax, [ebp - 0x10]
push eax
push 0x20019
push 0
mov eax, dword [ebp - 0xc]
call fcn.51004aa4
push eax
push 0x80000000
call sub.advapi32.dll_RegOpenKeyExA_1
test eax, eax
je 0x510b8f4e
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
mov dword [ebp - 0x238], eax
mov byte [ebp - 0x234], 0xb
lea edx, [ebp - 0x238]
xor ecx, ecx
mov eax, 0x510b90f0
call fcn.51009ec0
lea eax, [ebp - 0x10]
push eax
push 0x20019
push 0
mov eax, dword [ebp - 0xc]
call fcn.51004aa4
push eax
push 0x80000000
call sub.advapi32.dll_RegOpenKeyExA_1
test eax, eax
je 0x510b8f96
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
mov dword [ebp - 0x238], eax
mov byte [ebp - 0x234], 0xb
lea edx, [ebp - 0x238]
xor ecx, ecx
mov eax, 0x510b9110
call fcn.51009ec0
lea eax, [ebp - 0x10]
push eax
push 0x20019
push 0
mov eax, dword [ebp - 0xc]
call fcn.51004aa4
push eax
push 0x80000000
call sub.advapi32.dll_RegOpenKeyExA_1
test eax, eax
jne 0x510b9085
lea eax, [ebp - 0x128]
mov edx, 0x104
call fcn.5100770c
mov dword [ebp - 0x14], 0x104
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x128]
push eax
push 0
push 0
push 0
mov eax, dword [ebp - 0x10]
push eax
call sub.advapi32.dll_RegQueryValueExA_1
test eax, eax
jne 0x510b907c
push 0x104
lea eax, [ebp - 0x22c]
push eax
lea eax, [ebp - 0x128]
push eax
call sub.kernel32.dll_ExpandEnvironmentStringsA
lea eax, [ebp - 0x23c]
lea edx, [ebp - 0x22c]
mov ecx, 0x104
call fcn.51004854
mov eax, dword [ebp - 0x23c]
mov edx, esi
call fcn.51008c98
lea edx, [ebp - 0x240]
mov eax, dword [esi]
call fcn.51008a70
mov edx, dword [ebp - 0x240]
mov eax, esi
call fcn.51004638
mov edx, dword [esi]
mov eax, 0x510b9130
call fcn.51004be8
test eax, eax
jle 0x510b907c
lea eax, [ebp - 0x248]
push eax
mov edx, dword [esi]
mov eax, 0x510b9130
call fcn.51004be8
mov ecx, eax
dec ecx
mov eax, dword [esi]
mov edx, 1
call fcn.51004b04
mov eax, dword [ebp - 0x248]
lea edx, [ebp - 0x244]
call fcn.51008c98
mov edx, dword [ebp - 0x244]
mov eax, esi
call fcn.51004638
mov eax, dword [ebp - 0x10]
push eax
call sub.advapi32.dll_RegCloseKey_1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x510b90c2
lea eax, [ebp - 0x248]
mov edx, 4
call fcn.51004608
lea eax, [ebp - 0x230]
call fcn.51004cc4
lea eax, [ebp - 0xc]
mov edx, 3
call fcn.51004608
ret