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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
push ecx
push ebx
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push edi
lea eax, [ebp - 4]
push eax
xor ebx, ebx
push ebx
lea eax, [ebp - 8]
push eax
push ebx
push dword [ebp + 0x10]
push dword [ebp + 8]
call esi
cmp eax, ebx
je 0x101b95c
cmp eax, 2
jne 0x101ba56
cmp dword [ebp + 0x14], ebx
je 0x101ba56
cmp dword [ebp + 0xc], 7
push dword [ebp + 0x14]
jne 0x101b950
call fcn.0101beb9
shl eax, 1
mov dword [ebp - 4], eax
jmp 0x101b96b
call sub.msvcrt.dll_wcslen
pop ecx
lea eax, [eax + eax + 2]
jmp 0x101b94b
mov eax, dword [ebp + 0xc]
cmp dword [ebp - 8], eax
jne 0x101bae8
mov eax, dword [ebp - 4]
cmp eax, ebx
jne 0x101b975
push 0x20
pop eax
mov dword [ebp - 4], eax
mov ecx, eax
and ecx, 1
lea edi, [ecx + eax + 2]
push edi
call fcn.0101b7e6
mov ebx, eax
test ebx, ebx
je 0x101ba56
lea eax, [ebp - 4]
push eax
push ebx
lea eax, [ebp - 8]
push eax
push 0
push dword [ebp + 0x10]
push dword [ebp + 8]
call esi
lea ecx, [edi + ebx]
mov byte [ecx - 1], 0
mov byte [ecx - 2], 0
test byte [ebp - 4], 1
mov esi, eax
je 0x101b9b8
mov byte [ecx - 3], 0
test esi, esi
je 0x101ba18
cmp esi, 2
jne 0x101ba56
cmp dword [ebp + 0x14], 0
je 0x101ba56
cmp dword [ebp + 0xc], 7
jne 0x101b9f4
mov esi, dword [ebp + 0x14]
push esi
call fcn.0101beb9
mov ecx, eax
shl ecx, 1
mov eax, ecx
shr ecx, 2
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
jmp 0x101b9ff
push dword [ebp + 0x14]
push ebx
call sub.msvcrt.dll_wcscpy
pop ecx
pop ecx
push dword [ebp - 4]
push ebx
push dword [ebp + 0xc]
push 0
push dword [ebp + 0x10]
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
jne 0x101ba56
cmp dword [ebp + 0xc], 2
jne 0x101ba86
mov esi, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push 0
push 0
push ebx
call esi
mov edi, eax
test edi, edi
je 0x101ba56
lea eax, [edi + edi + 2]
push eax
mov dword [ebp - 4], eax
call fcn.0101b7e6
test eax, eax
mov dword [ebp + 0x10], eax
je 0x101ba56
push edi
push eax
push ebx
call esi
test eax, eax
jne 0x101ba7d
push dword [ebp + 0x10]
call fcn.0101b86f
push ebx
call fcn.0101b86f
mov esi, dword [ebp + 0x18]
test esi, esi
je 0x101ba66
and dword [esi], 0
mov edi, dword [ebp + 0x14]
test edi, edi
je 0x101bae8
cmp dword [ebp + 0xc], 7
push edi
jne 0x101ba9b
call fcn.0101beb9
shl eax, 1
jmp 0x101baa5
push ebx
call fcn.0101b86f
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebp + 0x18]
test eax, eax
je 0x101ba92
mov ecx, dword [ebp - 4]
mov dword [eax], ecx
mov eax, ebx
pop edi
pop esi
pop ebx
leave
ret 0x14
call sub.msvcrt.dll_wcslen
pop ecx
lea eax, [eax + eax + 2]
push eax
mov dword [ebp - 4], eax
call fcn.0101b7e6
mov ebx, eax
test ebx, ebx
je 0x101bae8
cmp dword [ebp + 0xc], 7
jne 0x101bad4
mov ecx, dword [ebp - 4]
mov eax, ecx
mov esi, edi
shr ecx, 2
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp + 0x18]
jmp 0x101badd
push edi
push ebx
call sub.msvcrt.dll_wcscpy
pop ecx
pop ecx
test esi, esi
je 0x101ba92
mov eax, dword [ebp - 4]
mov dword [esi], eax
jmp 0x101ba92
xor eax, eax
jmp 0x101ba94