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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x23c
mov eax, dword [0x5bb70c3c]
push ebx
xor ebx, ebx
cmp dword [0x5bb73c48], ebx
mov dword [ebp - 4], eax
mov dword [ebp - 0x234], ebx
mov dword [ebp - 0x23c], ebx
mov dword [ebp - 0x21c], ebx
jne 0x5ba7f121
call fcn.5ba7f133
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x210]
push eax
push ebx
push 0xf003f
push ebx
push ebx
push ebx
push 0x5ba4c668
call fcn.5ba57156
push eax
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
test eax, eax
jne 0x5ba7f117
push esi
push edi
push 4
pop esi
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x234]
push eax
lea eax, [ebp - 0x22c]
push eax
push ebx
mov edi, 0x5ba4f658
push edi
push dword [ebp - 0x210]
mov dword [ebp - 0x218], esi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x5ba7ed0b
lea eax, [ebp - 0x21c]
push eax
push 0x20019
push ebx
push 0x5ba4f574
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x5ba7ecff
push dword [ebp - 0x210]
push dword [ebp - 0x21c]
call sub.MSOERT2.dll_CopyRegistry
push dword [ebp - 0x21c]
call dword [entry0]
mov dword [ebp - 0x21c], 1
jmp 0x5ba7ed21
cmp dword [ebp - 0x22c], esi
jne 0x5ba7ed1b
cmp dword [ebp - 0x218], esi
je 0x5ba7ed21
mov dword [ebp - 0x234], ebx
lea eax, [ebp - 0x230]
push eax
push 0x20019
push ebx
push 0x5ba4f5ac
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x5ba7ed90
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x23c]
push eax
push ebx
push ebx
push edi
push dword [ebp - 0x230]
mov dword [ebp - 0x218], esi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov eax, dword [ebp - 0x234]
cmp eax, dword [ebp - 0x23c]
jae 0x5ba7ed84
push dword [ebp - 0x210]
push dword [ebp - 0x230]
call sub.MSOERT2.dll_CopyRegistry
push dword [ebp - 0x230]
call dword [entry0]
cmp dword [ebp - 0x21c], ebx
mov edi, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov byte [ebp - 0x20c], bl
mov byte [ebp - 0x108], bl
jne 0x5ba7ee03
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x228]
push eax
push ebx
push ebx
push 0x5ba4cae8
push dword [ebp - 0x210]
mov dword [ebp - 0x218], esi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x5ba7eddb
mov dword [ebp - 0x228], ebx
cmp dword [ebp - 0x228], ebx
jne 0x5ba7ee24
mov eax, 0x104
push eax
lea ecx, [ebp - 0x20c]
push ecx
push eax
lea eax, [ebp - 0x108]
push eax
push dword [ebp - 0x210]
call fcn.5ba7fc11
push esi
lea eax, [ebp - 0x228]
push eax
push esi
push ebx
push 0x5ba4cae8
push dword [ebp - 0x210]
mov dword [ebp - 0x228], 1
call edi
call fcn.5ba7f2d0
cmp dword [ebp - 0x21c], ebx
je 0x5ba7ee40
mov dword [ebp - 0x214], 7
jmp 0x5ba7eee3
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp - 0x22c]
push eax
push ebx
push 0x5ba47360
push dword [ebp - 0x210]
mov dword [ebp - 0x218], esi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x5ba7ee77
mov dword [ebp - 0x214], ebx
cmp dword [ebp - 0x214], ebx
jne 0x5ba7eeb8
push dword [ebp - 0x210]
call fcn.5ba7fc9c
lea eax, [ebp - 0x238]
push eax
push ebx
call fcn.5ba7ffd7
cmp dword [ebp - 0x238], 1
je 0x5ba7eea9
cmp dword [ebp - 0x238], 2
jne 0x5ba7eeae
call fcn.5baf15dd
mov dword [ebp - 0x214], 1
cmp dword [ebp - 0x214], 1
jne 0x5ba7eecb
mov dword [ebp - 0x214], 2
cmp dword [ebp - 0x214], 2
jne 0x5ba7eeef
call fcn.5ba80140
mov dword [ebp - 0x214], 3
cmp dword [ebp - 0x21c], ebx
jne 0x5ba7f003
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x220]
push eax
push ebx
push ebx
push 0x5ba4cb00
push dword [ebp - 0x210]
mov dword [ebp - 0x218], esi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x5ba7ef20
mov dword [ebp - 0x220], ebx
cmp dword [ebp - 0x220], ebx
jne 0x5ba7f00d
cmp byte [ebp - 0x108], bl
jne 0x5ba7efbb
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x22c]
push eax
push ebx
push 0x5ba4cac4
push dword [ebp - 0x210]
mov dword [ebp - 0x218], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
cmp dword [ebp - 0x22c], 2
push 0x104
jne 0x5ba7ef9f
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
lea eax, [ebp - 0x20c]
push 0x104
push eax
lea eax, [ebp - 0x108]
jmp 0x5ba7efac
lea eax, [ebp - 0x108]
push eax
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
cmp byte [ebp - 0x108], bl
je 0x5ba7f003
cmp byte [ebp - 0x20c], bl
je 0x5ba7f003
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x108]
push eax
push ebx
call fcn.5baf37cd
test eax, eax
jl 0x5ba7f00d
call fcn.5bb0838c
push esi
lea eax, [ebp - 0x220]
push eax
push esi
push ebx
push 0x5ba4cb10
push dword [ebp - 0x210]
mov dword [ebp - 0x220], 1
call edi
jmp 0x5ba7f00d
mov dword [ebp - 0x220], 1
push esi
lea eax, [ebp - 0x220]
push eax
push esi
push ebx
push 0x5ba4cb00
push dword [ebp - 0x210]
call edi
cmp dword [ebp - 0x21c], ebx
je 0x5ba7f038
mov dword [ebp - 0x224], 1
jmp 0x5ba7f080
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x224]
push eax
push ebx
push ebx
push 0x5ba4cb10
push dword [ebp - 0x210]
mov dword [ebp - 0x218], esi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x5ba7f069
mov dword [ebp - 0x224], ebx
cmp dword [ebp - 0x224], ebx
jne 0x5ba7f097
mov dword [ebp - 0x224], 1
call fcn.5ba8020c
push esi
lea eax, [ebp - 0x224]
push eax
push esi
push ebx
push 0x5ba4cb10
push dword [ebp - 0x210]
call edi
cmp dword [ebp - 0x214], 3
jne 0x5ba7f0ab
call fcn.5ba8034c
mov dword [ebp - 0x214], esi
cmp dword [ebp - 0x214], esi
jne 0x5ba7f0c2
call fcn.5ba80df8
mov dword [ebp - 0x214], 5
cmp dword [ebp - 0x214], 5
jne 0x5ba7f0da
call fcn.5ba81011
mov dword [ebp - 0x214], 6
cmp dword [ebp - 0x214], 6
jne 0x5ba7f0f2
call fcn.5ba8173a
mov dword [ebp - 0x214], 7
push esi
lea eax, [ebp - 0x214]
push eax
push esi
push ebx
push 0x5ba47360
push dword [ebp - 0x210]
call edi
push dword [ebp - 0x210]
call dword [entry0]
pop edi
pop esi
mov dword [0x5bb73c48], 1
mov ecx, dword [ebp - 4]
xor eax, eax
pop ebx
call fcn.5bb3f314
leave
ret