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

Disassembly:
sub esp, 0x28
mov eax, dword [0x467fd4]
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 0x40b0c4
xor edx, edx
cmp word [ecx], dx
cmove ecx, edx
mov dword [esp + 0x20], ecx
test edi, edi
je 0x40b0d1
mov eax, dword [esi + 0x20]
mov dword [esp + 0x18], eax
jmp 0x40b113
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 0x40b108
push 0
lea ecx, [ebx + 4]
call fcn.0040d1e0
push eax
push edi
mov ecx, ebp
call fcn.00405aa0
test al, al
je 0x40b35b
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x14]
mov dword [esi + 0x20], eax
cmp eax, 1
je 0x40b132
cmp eax, 2
je 0x40b132
cmp eax, 7
je 0x40b132
xor cl, cl
mov byte [esp + 0x13], cl
test edi, edi
je 0x40b295
jmp 0x40b145
mov cl, 1
mov byte [esp + 0x13], cl
test edi, edi
jne 0x40b145
mov edi, 2
mov dword [esp + 0x14], edi
mov ebp, dword [esp + 0x1c]
lea ebx, [esi + 0x34]
nop dword [eax]
test cl, cl
je 0x40b15f
mov eax, edi
and eax, 1
add edi, eax
mov dword [esp + 0x14], edi
mov ecx, dword [esi + 0x30]
cmp ecx, ebx
je 0x40b17b
mov eax, dword [esi + 0x14]
shr eax, 0xa
not al
test al, 1
je 0x40b17b
push ecx
call fcn.00427a8e
add esp, 4
mov dword [esi + 0x1c], 0
mov eax, ebx
mov dword [esi + 0x30], ebx
mov dword [ebx], 0
cmp edi, 0x10
jbe 0x40b1a6
push edi
call fcn.00406c20
add esp, 4
test eax, eax
je 0x40b35b
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 0x40b20a
cmp eax, 0xea
jne 0x40b35b
cmp ebp, 0x80000004
je 0x40b1e3
cmp ebp, 0x80000050
je 0x40b1e3
mov edi, dword [esp + 0x14]
jmp 0x40b1f9
mov edi, dword [esp + 0x14]
cmp edi, 0x100000
jae 0x40b35b
add edi, edi
mov dword [esp + 0x14], edi
mov cl, byte [esp + 0x13]
test edi, edi
jne 0x40b150
jmp 0x40b291
mov cl, byte [esp + 0x13]
mov edi, dword [esp + 0x14]
test cl, cl
je 0x40b291
mov eax, dword [esi + 0x30]
cmp word [eax + edi - 2], 0
je 0x40b291
lea ebx, [edi + 2]
cmp ebx, 0x10
jbe 0x40b285
push ebx
mov ecx, esi
call fcn.0040a660
test al, al
je 0x40b35b
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 0x40b27a
mov ecx, esi
call fcn.0040a4e0
pop edi
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x24]
xor ecx, esp
call fcn.00422c85
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 0x40b3bd
test cl, cl
je 0x40b3bd
cmp eax, 7
jne 0x40b2ff
mov esi, dword [esi + 0x30]
shr edi, 1
dec edi
test esi, esi
je 0x40b3bd
test edi, edi
je 0x40b3bd
cmp edi, 3
jb 0x40b3bd
lea edi, [esi + edi*2]
cmp esi, edi
jae 0x40b3bd
lea ebx, [eax + 3]
nop word [eax + eax]
push esi
call fcn.0040bde0
add esp, 4
lea esi, [esi + eax*2]
cmp esi, edi
jae 0x40b2f3
mov word [esi], bx
add esi, 2
cmp esi, edi
jb 0x40b2e0
jmp 0x40b3bd
cmp eax, 2
jne 0x40b3bd
test byte [esp + 0x50], 1
jne 0x40b3bd
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 0x40b372
push edi
call fcn.00406c20
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x40b35b
mov eax, dword [esp + 0x1c]
push eax
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x40b378
cmp edi, 0x10
jbe 0x40b35b
push ebx
call fcn.00427a8e
add esp, 4
pop edi
pop esi
pop ebp
xor al, al
pop ebx
mov ecx, dword [esp + 0x24]
xor ecx, esp
call fcn.00422c85
add esp, 0x28
ret 0x18
lea ebx, [esp + 0x24]
jmp 0x40b340
mov ecx, dword [esi + 0x30]
lea ebp, [esi + 0x34]
cmp ecx, ebp
je 0x40b397
mov eax, dword [esi + 0x14]
shr eax, 0xa
not al
test al, 1
je 0x40b397
push ecx
call fcn.00427a8e
add esp, 4
mov dword [esi + 0x30], ebp
mov dword [ebp], 0
cmp edi, 0x10
jbe 0x40b3ab
mov dword [esi + 0x30], ebx
jmp 0x40b3ba
push edi
lea eax, [esp + 0x28]
push eax
push ebp
call fcn.004243e0
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.00422c85
add esp, 0x28
ret 0x18