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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
push ebx
push esi
push edi
lea ecx, [ebp - 0xc]
call fcn.00444f6c
lea ecx, [ebp - 8]
call fcn.00444f6c
mov eax, dword [ebp + 0xc]
xor ebx, ebx
cmp word [eax], bx
mov edi, 0x80000001
mov dword [ebp - 0x20], ebx
jne 0x499a6b
mov dword [ebp + 0xc], ebx
mov esi, dword [ebp + 8]
cmp word [esi], bx
sete byte [ebp + 0xb]
cmp byte [ebp + 0xb], bl
jne 0x499aea
push 5
push esi
push str.HKCU_
call fcn.0043fc19
add esp, 0xc
test al, al
je 0x499a93
add esi, 0xa
jmp 0x499ae1
push 0x13
push esi
push str.HKEY_CURRENT_USER_
call fcn.0043fc19
add esp, 0xc
test al, al
je 0x499aac
add esi, 0x24
jmp 0x499ae1
push 5
push esi
push str.HKLM_
call fcn.0043fc19
add esp, 0xc
test al, al
je 0x499ac5
add esi, 0xa
jmp 0x499adc
push 0x13
push esi
push str.HKEY_LOCAL_MACHINE_
call fcn.0043fc19
add esp, 0xc
test al, al
je 0x499ae1
add esi, 0x26
mov edi, 0x80000002
mov dword [ebp - 0x20], 2
jmp 0x499b05
mov eax, dword [ebp - 0x20]
cmp eax, 3
jae 0x499d19
shl eax, 2
mov edi, dword [eax + 0x4ce2c8]
mov esi, dword [eax + 0x4ce2bc]
lea eax, [ebp - 4]
push eax
movzx eax, word [0x4dcc20]
or eax, 0xf003f
push eax
push ebx
push esi
push edi
mov dword [ebp - 4], ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x28], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
cmp dword [ebp - 4], ebx
je 0x499cfc
push ebx
push ebx
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x30]
push eax
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyW]
mov esi, eax
cmp esi, ebx
jne 0x499d04
mov eax, dword [ebp - 0x24]
lea eax, [eax*4 + 8]
push eax
lea ecx, [ebp - 0x18]
call fcn.00444f8a
mov eax, dword [ebp - 0x28]
lea eax, [eax*4 + 8]
push eax
lea ecx, [ebp - 0x10]
call fcn.00444f8a
cmp dword [ebp - 0x30], ebx
mov dword [ebp - 0x1c], ebx
jle 0x499cde
mov eax, dword [ebp - 0x24]
shl eax, 2
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x28]
shl eax, 2
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x18]
mov word [eax], bx
lea eax, [ebp - 0x34]
push eax
push dword [ebp - 0x10]
lea eax, [ebp - 0x38]
push ebx
push ebx
push eax
push dword [ebp - 0x18]
push dword [ebp - 0x1c]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
test eax, eax
jne 0x499ccf
mov eax, dword [ebp - 0x18]
cmp word [eax], bx
je 0x499ccf
cmp dword [ebp + 0xc], ebx
je 0x499bec
push eax
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
jne 0x499ccf
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x10]
shr eax, 1
mov word [ecx + eax*2], bx
mov eax, dword [ebp - 0x18]
mov esi, dword [ebp - 0x10]
push eax
push str.PATH
mov dword [ebp - 0x2c], eax
call fcn.0043fc58
test al, al
pop ecx
pop ecx
je 0x499c44
mov eax, dword [ebp - 0x10]
cmp word [eax], bx
je 0x499c3a
mov eax, dword [ebp - 0xc]
cmp word [eax], bx
je 0x499c2f
push 0x4ce2b0
lea ecx, [ebp - 0xc]
call fcn.00444fd8
push dword [ebp - 0x10]
lea ecx, [ebp - 0xc]
call fcn.00444fd8
mov esi, dword [ebp - 0xc]
mov dword [ebp - 0x2c], 0x4ce2a4
push ebx
push 0xffffffffffffffff
lea eax, [ebp - 8]
push eax
push esi
mov ecx, 0x4dd0f0
call fcn.004553cd
push dword [ebp - 8]
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
cmp byte [ebp + 0xb], bl
je 0x499ccf
xor edi, edi
push dword [ebp - 0x2c]
lea esi, [edi + 0x4c30d4]
mov eax, dword [esi]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
jne 0x499cc7
push 0x4ce29c
lea ecx, [ebp - 0x14]
call fcn.0044e827
push dword [esi]
lea ecx, [ebp - 0x14]
call fcn.00444fd8
push 0x4ccd0c
lea ecx, [ebp - 0x14]
call fcn.00444fd8
push dword [ebp - 8]
lea ecx, [ebp - 0x14]
call fcn.00444fd8
push 1
push ebx
push ebx
push dword [ebp - 0x14]
mov ecx, 0x4dd0f0
call fcn.0045c924
lea ecx, [ebp - 0x14]
call fcn.0043e825
add edi, 8
cmp edi, 0x40
jb 0x499c69
inc dword [ebp - 0x1c]
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x30]
jl 0x499b8d
lea ecx, [ebp - 0x10]
call fcn.0043e825
lea ecx, [ebp - 0x18]
call fcn.0043e825
cmp dword [ebp - 4], ebx
je 0x499cfc
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
inc dword [ebp - 0x20]
jmp 0x499aea
cmp dword [ebp - 4], ebx
je 0x499d12
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp - 4], ebx
mov ebx, esi
jmp 0x499d53
cmp dword [ebp + 0xc], ebx
je 0x499d67
push dword [ebp + 0xc]
push str.PATH
call fcn.0043fc58
test al, al
pop ecx
pop ecx
je 0x499d67
push ebx
push 0xffffffffffffffff
lea eax, [ebp - 8]
push eax
push dword [ebp - 0xc]
mov ecx, 0x4dd0f0
call fcn.004553cd
push dword [ebp - 8]
push 0x4ce2a4
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
lea ecx, [ebp - 8]
call fcn.0043e825
lea ecx, [ebp - 0xc]
call fcn.0043e825
mov eax, ebx
jmp 0x499d79
lea ecx, [ebp - 8]
call fcn.0043e825
lea ecx, [ebp - 0xc]
call fcn.0043e825
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret