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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x424596
mov eax, dword fs:[0]
push eax
sub esp, 0x44c
mov eax, dword [0x434014]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [ebp - 0x444], ebx
mov edi, dword [ebp + 8]
lea eax, [ebp - 0x410]
mov esi, dword [ebp + 0xc]
push 0x400
push 0
push eax
mov dword [ebp - 0x44c], edi
mov dword [ebp - 0x448], esi
call fcn.0040a8e0
xor eax, eax
mov dword [ebp - 0x420], 1
add esp, 0xc
mov dword [ebp - 0x43c], 0x3fe
mov dword [ebp - 0x428], 0
mov dword [ebp - 0x424], 7
mov word [ebp - 0x438], ax
mov dword [ebp - 4], eax
lea eax, [ebp - 0x43c]
push eax
lea eax, [ebp - 0x410]
push eax
lea eax, [ebp - 0x420]
push eax
push 0
push edi
push dword [ebx]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov ebx, eax
mov eax, dword [ebp - 0x420]
cmp eax, 1
je 0x405c18
cmp eax, 2
jne 0x405ff2
test ebx, ebx
jne 0x405c4c
lea ecx, [ebp - 0x410]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405c25
sub ecx, edx
lea eax, [ebp - 0x410]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x438]
call fcn.00403560
jmp 0x405dc4
cmp ebx, 0xea
jne 0x405ff7
mov eax, dword [ebp - 0x43c]
xor ebx, ebx
add eax, 2
mov dword [ebp - 0x414], 0
xorps xmm0, xmm0
mov dword [ebp - 0x440], eax
xor edi, edi
movq qword [ebp - 0x41c], xmm0
xor esi, esi
mov dword [ebp - 0x41c], ebx
mov dword [ebp - 0x418], ebx
mov dword [ebp - 0x414], edi
test eax, eax
je 0x405d05
cmp eax, 0x7fffffff
ja 0x406053
cmp eax, 0x1000
jb 0x405cd1
lea ecx, [eax + 0x23]
cmp ecx, eax
jbe 0x406058
push ecx
call fcn.00408ed8
add esp, 4
test eax, eax
je 0x40606c
lea ebx, [eax + 0x23]
and ebx, 0xffffffe0
mov dword [ebx - 4], eax
jmp 0x405cdc
push eax
call fcn.00408ed8
add esp, 4
mov ebx, eax
mov eax, dword [ebp - 0x440]
push eax
push 0
push ebx
lea edi, [ebx + eax]
mov dword [ebp - 0x41c], ebx
mov dword [ebp - 0x414], edi
call fcn.0040a8e0
add esp, 0xc
mov dword [ebp - 0x418], edi
mov esi, ebx
lea eax, [ebp - 0x43c]
mov byte [ebp - 4], 1
push eax
push ebx
lea eax, [ebp - 0x420]
push eax
mov eax, dword [ebp - 0x444]
push 0
push dword [ebp - 0x44c]
push dword [eax]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov ebx, eax
test ebx, ebx
je 0x405d6b
test esi, esi
je 0x405ff7
sub edi, esi
cmp edi, 0x1000
jb 0x405d5c
mov ecx, dword [esi - 4]
add edi, 0x23
sub esi, ecx
lea eax, [esi - 4]
cmp eax, 0x1f
ja 0x40606c
mov esi, ecx
push edi
push esi
call fcn.00408f08
add esp, 8
jmp 0x405ff7
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405d70
sub ecx, edx
sar ecx, 1
push ecx
push esi
lea ecx, [ebp - 0x438]
call fcn.00403560
mov byte [ebp - 4], 0
test esi, esi
je 0x405dbe
sub edi, esi
cmp edi, 0x1000
jb 0x405db4
mov ecx, dword [esi - 4]
add edi, 0x23
sub esi, ecx
lea eax, [esi - 4]
cmp eax, 0x1f
ja 0x40606c
mov esi, ecx
push edi
push esi
call fcn.00408f08
add esp, 8
mov esi, dword [ebp - 0x448]
mov eax, dword [ebp - 0x420]
cmp eax, 1
jne 0x405dfe
lea eax, [ebp - 0x438]
cmp esi, eax
je 0x405ff7
cmp dword [ebp - 0x424], 8
mov ecx, esi
push dword [ebp - 0x428]
cmovae eax, dword [ebp - 0x438]
push eax
call fcn.00403560
jmp 0x405ff7
cmp eax, 2
jne 0x405ff2
cmp dword [ebp - 0x424], 8
lea ecx, [ebp - 0x444]
push 1
lea eax, [ebp - 0x438]
mov dword [ebp - 0x444], 0
cmovae eax, dword [ebp - 0x438]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov dword [ebp - 0x458], eax
test eax, eax
je 0x405dcf
xor edx, edx
mov dword [ebp - 0x414], 0
lea ecx, [eax + 2]
mov dword [ebp - 0x44c], 0
mov dword [ebp - 0x450], ecx
xorps xmm0, xmm0
movq qword [ebp - 0x41c], xmm0
mov dword [ebp - 0x41c], edx
mov dword [ebp - 0x418], edx
mov dword [ebp - 0x414], edx
test ecx, ecx
je 0x405f3e
cmp ecx, 0x7fffffff
ja 0x40605d
lea esi, [ecx + ecx]
cmp esi, 0x1000
jb 0x405ec1
lea eax, [esi + 0x23]
cmp eax, esi
jbe 0x406062
push eax
call fcn.00408ed8
add esp, 4
test eax, eax
je 0x406067
lea edi, [eax + 0x23]
and edi, 0xffffffe0
mov dword [edi - 4], eax
jmp 0x405ed4
test esi, esi
je 0x405ed2
push esi
call fcn.00408ed8
add esp, 4
mov edi, eax
jmp 0x405ed4
xor edi, edi
lea ecx, [ebp - 0x44c]
mov dword [ebp - 0x440], 0
mov ax, word [ecx]
lea edx, [edi + esi]
lea ecx, [ebp - 0x440]
mov dword [ebp - 0x41c], edi
cmp ax, word [ecx]
mov ecx, dword [ebp - 0x450]
mov dword [ebp - 0x454], edx
mov dword [ebp - 0x414], edx
jne 0x405f21
push esi
push 0
push edi
call fcn.0040a8e0
mov edx, dword [ebp - 0x454]
add esp, 0xc
jmp 0x405f2c
xor eax, eax
shr ecx, 1
rep stosd dword es:[edi], eax
adc ecx, ecx
rep stosw word es:[edi], ax
mov eax, dword [ebp - 0x458]
mov dword [ebp - 0x418], edx
mov edx, dword [ebp - 0x41c]
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x438]
cmp dword [ebp - 0x424], 8
cmovae ecx, dword [ebp - 0x438]
inc eax
push eax
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x405f89
mov edx, dword [ebp - 0x41c]
mov ecx, edx
lea esi, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x405f70
sub ecx, esi
sar ecx, 1
push ecx
mov ecx, dword [ebp - 0x448]
push edx
jmp 0x405fae
mov ecx, dword [ebp - 0x448]
lea eax, [ebp - 0x438]
cmp ecx, eax
je 0x405fb3
cmp dword [ebp - 0x424], 8
push dword [ebp - 0x428]
cmovae eax, dword [ebp - 0x438]
push eax
call fcn.00403560
mov edx, dword [ebp - 0x41c]
test edx, edx
je 0x405ff7
mov ecx, dword [ebp - 0x414]
mov eax, edx
sub ecx, edx
and ecx, 0xfffffffe
cmp ecx, 0x1000
jb 0x405fe6
mov edx, dword [edx - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406067
push ecx
push edx
call fcn.00408f08
add esp, 8
jmp 0x405ff7
mov ebx, 0x3f4
mov edx, dword [ebp - 0x424]
cmp edx, 8
jb 0x406033
mov ecx, dword [ebp - 0x438]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x406029
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40606c
push edx
push ecx
call fcn.00408f08
add esp, 8
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00408ec2
mov esp, ebp
pop ebp
ret 8
call fcn.00406b10
call fcn.00401240
call fcn.00406b10
call fcn.00401240
call fcn.0040e5c1
call fcn.0040e5c1
int3