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

Disassembly:
sub esp, 0x28
mov eax, dword [0x45ce14]
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 0x409c24
xor edx, edx
cmp word [ecx], dx
cmove ecx, edx
mov dword [esp + 0x20], ecx
test edi, edi
je 0x409c31
mov eax, dword [esi + 0x20]
mov dword [esp + 0x18], eax
jmp 0x409c73
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 0x409c68
push 0
lea ecx, [ebx + 4]
call fcn.0040bbb0
push eax
push edi
mov ecx, ebp
call fcn.00404f10
test al, al
je 0x409e7c
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
mov dword [esi + 0x20], eax
cmp eax, 1
je 0x409c92
cmp eax, 2
je 0x409c92
cmp eax, 7
je 0x409c92
xor cl, cl
mov byte [esp + 0x13], cl
test edi, edi
je 0x409dd8
jmp 0x409ca5
mov cl, 1
mov byte [esp + 0x13], cl
test edi, edi
jne 0x409ca5
mov edi, 2
mov dword [esp + 0x14], edi
mov ebp, dword [esp + 0x1c]
lea ebx, [esi + 0x2c]
nop dword [eax]
test cl, cl
je 0x409cbf
mov eax, edi
and eax, 1
add edi, eax
mov dword [esp + 0x14], edi
mov ecx, dword [esi + 0x28]
cmp ecx, ebx
je 0x409cdb
mov eax, dword [esi + 0x14]
shr eax, 0xa
not al
test al, 1
je 0x409cdb
push ecx
call fcn.00422fb9
add esp, 4
mov dword [esi + 0x1c], 0
mov eax, ebx
mov dword [esi + 0x28], ebx
mov dword [ebx], 0
cmp edi, 0x10
jbe 0x409d06
push edi
call fcn.00405f10
add esp, 4
test eax, eax
je 0x409e7c
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 0x409d67
cmp eax, 0xea
jne 0x409e7c
cmp ebp, 0x80000004
je 0x409d43
cmp ebp, 0x80000050
je 0x409d43
mov edi, dword [esp + 0x14]
jmp 0x409d59
mov edi, dword [esp + 0x14]
cmp edi, 0x100000
jae 0x409e7c
add edi, edi
mov dword [esp + 0x14], edi
mov cl, byte [esp + 0x13]
test edi, edi
jne 0x409cb0
jmp 0x409dd4
mov cl, byte [esp + 0x13]
mov edi, dword [esp + 0x14]
test cl, cl
je 0x409dd4
mov eax, dword [esi + 0x28]
cmp word [eax + edi - 2], 0
je 0x409dd4
lea ebx, [edi + 2]
cmp ebx, 0x10
jbe 0x409dc8
push ebx
mov ecx, esi
call fcn.00409390
test al, al
je 0x409e7c
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]
test eax, eax
je 0x409e7c
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 0x409eea
test cl, cl
je 0x409eea
cmp eax, 7
jne 0x409e3f
mov esi, dword [esi + 0x28]
shr edi, 1
dec edi
test esi, esi
je 0x409eea
test edi, edi
je 0x409eea
cmp edi, 3
jb 0x409eea
lea edi, [esi + edi*2]
cmp esi, edi
jae 0x409eea
lea ebx, [eax + 3]
nop dword [eax]
push esi
call fcn.0040a800
add esp, 4
lea esi, [esi + eax*2]
cmp esi, edi
jae 0x409e33
mov word [esi], bx
add esi, 2
cmp esi, edi
jb 0x409e20
jmp 0x409eea
cmp eax, 2
jne 0x409eea
test byte [esp + 0x50], 1
jne 0x409eea
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 0x409e93
push edi
call fcn.00405f10
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x409e99
pop edi
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x24]
xor ecx, esp
call fcn.0041e282
add esp, 0x28
ret 0x18
lea ebp, [esp + 0x24]
jmp 0x409e9d
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 0x409ec5
mov eax, dword [esi + 0x14]
shr eax, 0xa
not al
test al, 1
je 0x409ec5
push ecx
call fcn.00422fb9
add esp, 4
mov dword [esi + 0x28], ebx
mov dword [ebx], 0
cmp edi, 0x10
jbe 0x409ed8
mov dword [esi + 0x28], ebp
jmp 0x409ee7
push edi
lea eax, [esp + 0x28]
push eax
push ebx
call fcn.0041f9c0
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.0041e282
add esp, 0x28
ret 0x18