Function at 0x1005af50
Capabilities:
Create process on windows
Query environment variable
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x8b8
mov eax, dword [0x1008400c]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
call fcn.1005ad40
cmp dword [eax + 4], 6
jb 0x1005b045
cmp dword [eax + 8], 2
jb 0x1005b045
mov eax, dword fs:[0x2c]
mov ecx, dword [0x10086ba8]
mov ecx, dword [eax + ecx*4]
mov eax, dword [0x10086c54]
cmp eax, dword [ecx + 4]
jg 0x1005b244
mov eax, dword [0x10084510]
test eax, eax
jne 0x1005b0f0
mov dword [ebp - 0x8a4], eax
lea edi, [ebp - 0x9c]
lea eax, [ebp - 0x8a4]
mov ecx, 0x26
push eax
push 0x20119
push 0
lea eax, [ebp - 0x9c]
mov esi, str.SoftwareClassesCLSID054AAE20_4BEA_4347_8A35_64A533254A9DLocalServer32
push eax
rep movsd dword es:[edi], dword [esi]
push SysStringLen
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x1005b045
push 0x800
push eax
lea eax, [ebp - 0x89c]
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp - 0x8ac], 0x400
lea eax, [ebp - 0x8ac]
mov dword [ebp - 0x8b0], 1
push eax
lea eax, [ebp - 0x89c]
push eax
lea eax, [ebp - 0x8b0]
push eax
push 0
push 0
push dword [ebp - 0x8a4]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push dword [ebp - 0x8a4]
test eax, eax
je 0x1005b057
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
xor al, al
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10069210
mov esp, ebp
pop ebp
ret
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea ecx, [ebp - 0x89c]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1005b066
sub ecx, edx
lea eax, [ebp - 0x89c]
sar ecx, 1
push ecx
push eax
mov ecx, 0x10084500
call fcn.10002800
mov ecx, dword [0x10084514]
mov edx, 0x10084500
mov esi, dword [0x10084500]
cmp ecx, 8
mov eax, dword [0x10084510]
cmovae edx, esi
mov dword [ebp - 0x8a8], eax
setae byte [ebp - 0x89d]
mov dword [ebp - 0x8b8], edx
cmp eax, 0x14
jb 0x1005b0fc
add eax, 0xffffffed
lea ecx, [edx + eax*2]
mov eax, edx
mov dword [ebp - 0x8b4], ecx
nop dword [eax]
mov edx, ecx
sub edx, eax
sar edx, 1
je 0x1005b0ea
movzx ecx, word [eax]
mov esi, ecx
cmp ecx, 0x25
je 0x1005b139
add eax, 2
sub edx, 1
jne 0x1005b0d8
mov eax, dword [ebp - 0x8a8]
mov ecx, dword [0x10084514]
mov esi, dword [0x10084500]
test eax, eax
je 0x1005b045
push 5
push 0
cmp ecx, 8
mov eax, 0x10084500
push 0
cmovae eax, esi
push eax
push 0x10073608
push 0
call dword [sym.imp.SHELL32.dll_ShellExecuteW]
mov ecx, dword [ebp - 4]
cmp eax, 0x20
pop edi
setg al
xor ecx, ebp
pop esi
call fcn.10069210
mov esp, ebp
pop ebp
ret
mov edi, 0x14
mov ecx, str._CommonProgramFiles_
mov edx, eax
cmp si, word [ecx]
jne 0x1005b15a
add edx, 2
add ecx, 2
sub edi, 1
je 0x1005b168
movzx esi, word [edx]
jmp 0x1005b145
mov ecx, dword [ebp - 0x8b4]
add eax, 2
jmp 0x1005b0d0
sub eax, dword [ebp - 0x8b8]
sar eax, 1
cmp eax, 0xffffffff
je 0x1005b0ea
mov esi, dword [ebp - 0x8a8]
cmp esi, eax
jb 0x1005b27a
mov ecx, esi
mov edx, 0x14
sub ecx, eax
cmp ecx, edx
cmovb edx, ecx
cmp byte [ebp - 0x89d], 0
mov ecx, 0x10084500
cmovne ecx, dword [0x10084500]
sub esi, edx
mov dword [0x10084510], esi
sub esi, eax
lea ecx, [ecx + eax*2]
lea eax, [esi*2 + 2]
push eax
lea eax, [ecx + edx*2]
push eax
push ecx
call sub.VCRUNTIME140.dll_memmove
add esp, 0xc
push 0
push 0
push str.CommonProgramW6432
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov edi, eax
test edi, edi
je 0x1005b045
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.100695a8
mov esi, eax
add esp, 4
lea eax, [edi + edi]
lea ecx, [eax - 1]
cmp ecx, 0x3e7fffff
ja 0x1005b21d
cmp eax, 1
jb 0x1005b21d
push eax
push 0
push esi
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push edi
push esi
push str.CommonProgramW6432
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
push esi
push ecx
call fcn.1003f280
push esi
call fcn.100695a3
mov eax, dword [0x10084510]
add esp, 4
jmp 0x1005b0f0
push 0x10086c54
call fcn.100696fa
add esp, 4
cmp dword [0x10086c54], 0xffffffff
jne 0x1005af9e
push 0x1006e5b0
call fcn.10069556
push 0x10086c54
call fcn.100696b0
add esp, 8
jmp 0x1005af9e
call fcn.1000ef90
int3