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

Disassembly:
sub esp, 0x28
mov eax, dword [0x466df4]
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 0x40af74
xor edx, edx
cmp word [ecx], dx
cmove ecx, edx
mov dword [esp + 0x20], ecx
test edi, edi
je 0x40af81
mov eax, dword [esi + 0x20]
mov dword [esp + 0x18], eax
jmp 0x40afc3
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 0x40afb8
push 0
lea ecx, [ebx + 4]
call fcn.0040cea0
push eax
push edi
mov ecx, ebp
call fcn.00405b50
test al, al
je 0x40b20b
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
mov dword [esi + 0x20], eax
cmp eax, 1
je 0x40afe2
cmp eax, 2
je 0x40afe2
cmp eax, 7
je 0x40afe2
xor cl, cl
mov byte [esp + 0x13], cl
test edi, edi
je 0x40b145
jmp 0x40aff5
mov cl, 1
mov byte [esp + 0x13], cl
test edi, edi
jne 0x40aff5
mov edi, 2
mov dword [esp + 0x14], edi
mov ebp, dword [esp + 0x1c]
lea ebx, [esi + 0x34]
nop dword [eax]
test cl, cl
je 0x40b00f
mov eax, edi
and eax, 1
add edi, eax
mov dword [esp + 0x14], edi
mov ecx, dword [esi + 0x30]
cmp ecx, ebx
je 0x40b02b
mov eax, dword [esi + 0x14]
shr eax, 0xa
not al
test al, 1
je 0x40b02b
push ecx
call fcn.00427d4e
add esp, 4
mov dword [esi + 0x1c], 0
mov eax, ebx
mov dword [esi + 0x30], ebx
mov dword [ebx], 0
cmp edi, 0x10
jbe 0x40b056
push edi
call fcn.00406b80
add esp, 4
test eax, eax
je 0x40b20b
mov dword [esi + 0x30], 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 0x40b0ba
cmp eax, 0xea
jne 0x40b20b
cmp ebp, 0x80000004
je 0x40b093
cmp ebp, 0x80000050
je 0x40b093
mov edi, dword [esp + 0x14]
jmp 0x40b0a9
mov edi, dword [esp + 0x14]
cmp edi, 0x100000
jae 0x40b20b
add edi, edi
mov dword [esp + 0x14], edi
mov cl, byte [esp + 0x13]
test edi, edi
jne 0x40b000
jmp 0x40b141
mov cl, byte [esp + 0x13]
mov edi, dword [esp + 0x14]
test cl, cl
je 0x40b141
mov eax, dword [esi + 0x30]
cmp word [eax + edi - 2], 0
je 0x40b141
lea ebx, [edi + 2]
cmp ebx, 0x10
jbe 0x40b135
push ebx
mov ecx, esi
call fcn.0040a3f0
test al, al
je 0x40b20b
mov eax, dword [esp + 0x14]
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x1c]
push eax
push dword [esi + 0x30]
push 0
push 0
push dword [esp + 0x30]
push ebp
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x40b12a
mov ecx, esi
call fcn.0040a230
pop edi
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x24]
xor ecx, esp
call fcn.00422f50
add esp, 0x28
ret 0x18
mov eax, dword [esi + 0x30]
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 0x40b26d
test cl, cl
je 0x40b26d
cmp eax, 7
jne 0x40b1af
mov esi, dword [esi + 0x30]
shr edi, 1
dec edi
test esi, esi
je 0x40b26d
test edi, edi
je 0x40b26d
cmp edi, 3
jb 0x40b26d
lea edi, [esi + edi*2]
cmp esi, edi
jae 0x40b26d
lea ebx, [eax + 3]
nop word [eax + eax]
push esi
call fcn.0040bc90
add esp, 4
lea esi, [esi + eax*2]
cmp esi, edi
jae 0x40b1a3
mov word [esi], bx
add esi, 2
cmp esi, edi
jb 0x40b190
jmp 0x40b26d
cmp eax, 2
jne 0x40b26d
test byte [esp + 0x50], 1
jne 0x40b26d
mov ebp, dword [esi + 0x30]
push 0
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov dword [esp + 0x1c], eax
lea edi, [eax + eax]
cmp edi, 0x10
jbe 0x40b222
push edi
call fcn.00406b80
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x40b20b
mov eax, dword [esp + 0x1c]
push eax
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x40b228
cmp edi, 0x10
jbe 0x40b20b
push ebx
call fcn.00427d4e
add esp, 4
pop edi
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x24]
xor ecx, esp
call fcn.00422f50
add esp, 0x28
ret 0x18
lea ebx, [esp + 0x24]
jmp 0x40b1f0
mov ecx, dword [esi + 0x30]
lea ebp, [esi + 0x34]
cmp ecx, ebp
je 0x40b247
mov eax, dword [esi + 0x14]
shr eax, 0xa
not al
test al, 1
je 0x40b247
push ecx
call fcn.00427d4e
add esp, 4
mov dword [esi + 0x30], ebp
mov dword [ebp], 0
cmp edi, 0x10
jbe 0x40b25b
mov dword [esi + 0x30], ebx
jmp 0x40b26a
push edi
lea eax, [esp + 0x28]
push eax
push ebp
call fcn.004246a0
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.00422f50
add esp, 0x28
ret 0x18