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

Disassembly:
sub esp, 0x28
mov eax, dword [0x45cdfc]
xor eax, esp
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x2c]
push ebx
push ebp
mov ebp, dword [esp + 0x44]
mov ebx, ecx
mov ecx, dword [esp + 0x38]
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ecx
push esi
mov esi, dword [esp + 0x40]
push edi
mov edi, dword [esp + 0x48]
mov dword [esp + 0x14], edi
test ecx, ecx
je 0x409b24
xor edx, edx
cmp word [ecx], dx
cmove ecx, edx
mov dword [esp + 0x20], ecx
test edi, edi
je 0x409b31
mov eax, dword [esi + 0x20]
mov dword [esp + 0x18], eax
jmp 0x409b73
lea edx, [esp + 0x14]
push edx
push 0
lea edx, [esp + 0x20]
push edx
push 0
push ecx
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edi, eax
test edi, edi
je 0x409b68
push 0
lea ecx, [ebx + 4]
call fcn.0040baf0
push eax
push edi
mov ecx, ebp
call fcn.00404f00
test al, al
je 0x409d70
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
mov dword [esi + 0x20], eax
cmp eax, 1
je 0x409b92
cmp eax, 2
je 0x409b92
cmp eax, 7
je 0x409b92
xor cl, cl
mov byte [esp + 0x13], cl
test edi, edi
je 0x409ccf
jmp 0x409ba5
mov cl, 1
mov byte [esp + 0x13], cl
test edi, edi
jne 0x409ba5
mov edi, 2
mov dword [esp + 0x14], edi
mov ebp, dword [esp + 0x1c]
lea ebx, [esi + 0x2c]
nop dword [eax]
test cl, cl
je 0x409bbf
mov eax, edi
and eax, 1
add edi, eax
mov dword [esp + 0x14], edi
mov ecx, dword [esi + 0x28]
cmp ecx, ebx
je 0x409bdb
mov eax, dword [esi + 0x14]
shr eax, 0xa
not al
test al, 1
je 0x409bdb
push ecx
call fcn.0042329e
add esp, 4
mov dword [esi + 0x1c], 0
mov eax, ebx
mov dword [esi + 0x28], ebx
mov dword [ebx], 0
cmp edi, 0x10
jbe 0x409c06
push edi
call fcn.00405ef0
add esp, 4
test eax, eax
je 0x409d70
mov dword [esi + 0x28], eax
lea ecx, [esp + 0x14]
mov dword [esi + 0x1c], edi
push ecx
push eax
push 0
push 0
push dword [esp + 0x30]
push ebp
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x409c66
cmp eax, 0xea
jne 0x409d70
cmp ebp, 0x80000004
je 0x409c43
cmp ebp, 0x80000050
je 0x409c43
mov edi, dword [esp + 0x14]
jmp 0x409c59
mov edi, dword [esp + 0x14]
cmp edi, 0x100000
jae 0x409d70
add edi, edi
mov dword [esp + 0x14], edi
mov cl, byte [esp + 0x13]
test edi, edi
je 0x409ccb
jmp 0x409bb0
mov cl, byte [esp + 0x13]
mov edi, dword [esp + 0x14]
test cl, cl
je 0x409ccb
mov eax, dword [esi + 0x28]
cmp word [eax + edi - 2], 0
je 0x409ccb
lea ebx, [edi + 2]
cmp ebx, 0x10
jbe 0x409cbf
push ebx
mov ecx, esi
call fcn.00409280
test al, al
je 0x409d70
mov eax, dword [esp + 0x14]
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x1c]
push eax
push dword [esi + 0x28]
push 0
push 0
push dword [esp + 0x30]
push ebp
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov eax, dword [esi + 0x28]
mov edi, dword [esp + 0x14]
mov cl, byte [esp + 0x13]
xor edx, edx
mov word [edi + eax], dx
mov edi, ebx
mov dword [esp + 0x14], edi
mov eax, dword [esp + 0x18]
mov dword [esi + 0x1c], edi
test edi, edi
je 0x409de5
test cl, cl
je 0x409de5
cmp eax, 7
jne 0x409d33
mov esi, dword [esi + 0x28]
shr edi, 1
dec edi
test esi, esi
je 0x409de5
test edi, edi
je 0x409de5
cmp edi, 3
jb 0x409de5
lea edi, [esi + edi*2]
cmp esi, edi
jae 0x409de5
lea ebx, [eax + 3]
push esi
call fcn.0040a700
add esp, 4
lea esi, [esi + eax*2]
cmp esi, edi
jae 0x409d27
mov word [esi], bx
add esi, 2
cmp esi, edi
jb 0x409d14
jmp 0x409de5
cmp eax, 2
jne 0x409de5
test byte [esp + 0x50], 1
jne 0x409de5
mov ebx, dword [esi + 0x28]
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov dword [esp + 0x1c], eax
lea edi, [eax + eax]
cmp edi, 0x10
jbe 0x409d87
push edi
call fcn.00405ef0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x409d8d
pop edi
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x24]
xor ecx, esp
call fcn.0041e5aa
add esp, 0x28
ret 0x18
lea ebp, [esp + 0x24]
jmp 0x409d91
mov eax, dword [esp + 0x1c]
push eax
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ecx, dword [esi + 0x28]
lea ebx, [esi + 0x2c]
cmp ecx, ebx
je 0x409db9
mov eax, dword [esi + 0x14]
shr eax, 0xa
not al
test al, 1
je 0x409db9
push ecx
call fcn.0042329e
add esp, 4
mov dword [esi + 0x1c], 0
mov dword [esi + 0x28], ebx
mov dword [ebx], 0
cmp edi, 0x10
jbe 0x409dd3
mov dword [esi + 0x28], ebp
jmp 0x409de2
push edi
lea eax, [esp + 0x28]
push eax
push ebx
call fcn.0041fc70
add esp, 0xc
mov dword [esi + 0x1c], edi
mov ecx, dword [esp + 0x34]
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0041e5aa
add esp, 0x28
ret 0x18