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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x47c91d
mov eax, dword fs:[0]
push eax
sub esp, 0x34
mov eax, dword [0x4b41e0]
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 - 0x38], ebx
cmp dword [ebx], 0
lea esi, [ebx + 4]
mov dword [ebp - 0x3c], esi
jne 0x4086c0
push 2
call fcn.0046a22b
add esp, 4
mov dword [ebx], eax
xor ecx, ecx
mov word [eax], cx
mov dword [esi], ecx
jmp 0x4086c3
mov dword [ebp - 0x3c], esi
mov edi, dword [ebx]
push 0x20a
mov byte [ebx + 8], 1
mov dword [esi], 0
call fcn.0046a22b
xor ecx, ecx
mov dword [ebx], eax
add esp, 4
xor edx, edx
mov word [eax + 0x208], cx
test edi, edi
je 0x408730
cmp word [edi], cx
je 0x4086f9
inc edx
cmp word [edi + edx*2], cx
jne 0x4086f2
xor esi, esi
cmp edx, 0x104
jle 0x40870d
mov edx, 0x104
mov dword [ebp - 0x34], edx
jmp 0x408714
mov dword [ebp - 0x34], edx
test edx, edx
jle 0x408730
mov ecx, dword [ebx]
mov ax, word [edi + esi*2]
mov word [ecx + esi*2], ax
inc esi
cmp esi, edx
jl 0x408714
mov eax, dword [ebx]
xor edx, edx
mov ecx, dword [ebp - 0x34]
mov word [eax + ecx*2], dx
jmp 0x40873c
mov eax, dword [ebx]
xor ecx, ecx
mov word [eax + edx*2], cx
test edi, edi
je 0x408745
push edi
call fcn.00469e73
add esp, 4
push 0
push dword [ebx]
call dword [sym.imp.SHLWAPI.dll_PathFindOnPathW]
test eax, eax
je 0x40875a
mov al, 1
jmp 0x408c5e
mov esi, dword [ebp - 0x3c]
mov eax, dword [esi]
test eax, eax
jne 0x40877a
mov ecx, dword [ebx]
test ecx, ecx
je 0x408778
cmp word [ecx], ax
je 0x408778
nop
inc eax
cmp word [ecx + eax*2], 0
jne 0x408770
mov dword [esi], eax
cmp eax, 2
jl 0x408c5c
cmp dword [ebx], 0
mov ecx, 1
jne 0x4087a0
push 2
call fcn.0046a22b
add esp, 4
mov dword [ebx], eax
xor ecx, ecx
mov word [eax], cx
mov dword [esi], ecx
mov eax, dword [ebx]
cmp word [eax + ecx*2], 0x3a
je 0x408c5c
push 0
push 1
push 1
push 0
push 0x49eab0
mov ecx, ebx
call fcn.00402320
test eax, eax
jne 0x408c5c
push eax
push 1
push 1
push eax
push 0x49ef64
mov ecx, ebx
call fcn.00402320
mov dword [ebp - 0x24], eax
test eax, eax
jne 0x408801
mov eax, dword [esi]
test eax, eax
jne 0x4087fd
mov ecx, dword [ebx]
test ecx, ecx
je 0x4087fb
cmp word [ecx], ax
je 0x4087fb
inc eax
cmp word [ecx + eax*2], 0
jne 0x4087f3
mov dword [esi], eax
inc eax
mov dword [ebp - 0x24], eax
xorps xmm0, xmm0
mov dword [ebp - 0x14], 0
movq qword [ebp - 0x1c], xmm0
xor esi, esi
xor edi, edi
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x1c], edi
mov byte [ebp - 0x14], 1
mov dword [ebp - 4], edi
cmp dword [ebx], edi
jne 0x40883b
push 2
call fcn.0046a22b
add esp, 4
mov dword [ebx], eax
xor ecx, ecx
mov word [eax], cx
mov ecx, dword [ebp - 0x3c]
mov dword [ecx], edi
mov eax, dword [ebx]
mov edx, 2
mov ecx, dword [ebp - 0x24]
dec ecx
mov byte [ebx + 8], 1
test eax, eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x20], ecx
setne byte [ebp - 0x14]
test eax, eax
je 0x4088e8
cmp ecx, 1
jge 0x40887b
xor ecx, ecx
mov dword [ebp - 0x20], ecx
cmp word [eax], cx
je 0x40887b
nop dword [eax]
inc ecx
cmp word [eax + ecx*2], 0
jne 0x408870
mov dword [ebp - 0x20], ecx
xorps xmm0, xmm0
movlpd qword [ebp - 0x2c], xmm0
mov dword [ebp - 0x2c], 0
lea eax, [ecx + 1]
mov byte [ebp - 4], 1
xor ecx, ecx
xor esi, esi
mul edx
mov dword [ebp - 0x18], esi
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0046a22b
mov edx, dword [ebp - 0x20]
add esp, 4
mov edi, eax
mov dword [ebp - 0x1c], edi
test edx, edx
jle 0x4088df
mov ecx, dword [ebp - 0x30]
sub eax, ecx
mov dword [ebp - 0x30], eax
mov edi, eax
movzx eax, word [ecx]
mov ebx, eax
mov dword [ebp - 0x30], ebx
test ax, ax
je 0x4088dc
inc esi
mov word [edi + ecx], ax
add ecx, 2
mov dword [ebp - 0x18], esi
cmp esi, edx
jl 0x4088c0
mov edi, dword [ebp - 0x1c]
xor eax, eax
mov word [edi + esi*2], ax
mov byte [ebp - 4], al
mov eax, dword [ebp - 0x24]
cmp eax, 5
jl 0x40891b
add eax, 0xfffffffc
test edi, edi
jne 0x408910
push 2
call fcn.0046a22b
mov edi, eax
add esp, 4
xor eax, eax
mov dword [ebp - 0x1c], edi
xor esi, esi
mov dword [ebp - 0x18], esi
mov word [edi], ax
cmp word [edi + eax*2], 0x2e
je 0x4089dc
mov byte [ebp - 0x14], 0
test esi, esi
jne 0x40893b
test edi, edi
je 0x408938
cmp word [edi], si
je 0x408938
nop dword [eax]
inc esi
cmp word [edi + esi*2], 0
jne 0x408930
mov dword [ebp - 0x18], esi
xor eax, eax
nop dword [eax]
inc eax
cmp word [eax*2 + str..exe], 0
jne 0x408940
add esi, eax
xor ecx, ecx
mov edx, 2
lea eax, [esi + 1]
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0046a22b
add esp, 4
mov dword [ebp - 0x34], eax
mov edx, eax
test edi, edi
je 0x4089a1
movzx ecx, word [edi]
mov ebx, ecx
mov dword [ebp - 0x30], ebx
test cx, cx
je 0x4089a1
mov ebx, edi
movzx ecx, cx
sub ebx, eax
nop word [eax + eax]
mov word [edx], cx
add edx, 2
movzx eax, word [ebx + edx]
mov ecx, eax
test ax, ax
jne 0x408990
mov ebx, str..exe
mov ecx, 0x2e
sub ebx, edx
nop dword [eax]
mov word [edx], cx
lea edx, [edx + 2]
movzx eax, word [ebx + edx]
mov ecx, eax
test ax, ax
jne 0x4089b0
xor eax, eax
mov word [edx], ax
test edi, edi
je 0x4089d3
push edi
call fcn.00469e73
add esp, 4
mov edi, dword [ebp - 0x34]
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x18], esi
mov byte [ebp - 0x14], 0
test esi, esi
jne 0x4089fb
test edi, edi
je 0x4089f8
cmp word [edi], si
je 0x4089f8
nop dword [eax]
inc esi
cmp word [edi + esi*2], 0
jne 0x4089f0
mov dword [ebp - 0x18], esi
xor eax, eax
nop dword [eax]
inc eax
cmp word [eax*2 + str.HKLMSOFTWAREMicrosoftWindowsCurrentVersionApp_Paths_], 0
jne 0x408a00
add eax, esi
xor ecx, ecx
mov dword [ebp - 0x34], eax
mov edx, 2
inc eax
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0046a22b
mov ebx, str.HKLMSOFTWAREMicrosoftWindowsCurrentVersionApp_Paths_
mov dword [ebp - 0x30], eax
add esp, 4
mov edx, edi
mov ecx, eax
mov esi, 0x48
sub ebx, eax
nop
mov word [ecx], si
add ecx, 2
movzx eax, word [ebx + ecx]
mov esi, eax
test ax, ax
jne 0x408a40
mov ebx, dword [ebp - 0x38]
test edi, edi
je 0x408a73
movzx eax, word [edi]
mov esi, eax
test ax, ax
je 0x408a73
mov word [ecx], ax
lea edx, [edx + 2]
movzx eax, word [edx]
add ecx, 2
test ax, ax
jne 0x408a62
xor eax, eax
mov word [ecx], ax
test edi, edi
je 0x408a85
push edi
call fcn.00469e73
add esp, 4
mov edi, dword [ebp - 0x30]
mov edx, 0x20019
mov eax, dword [ebp - 0x34]
push ecx
mov ecx, edi
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x18], eax
mov byte [ebp - 0x14], 1
call fcn.00405480
mov esi, eax
mov dword [ebp - 0x28], esi
push edi
mov byte [ebp - 4], 2
call fcn.00469e73
xor eax, eax
mov byte [ebp - 0x14], 1
add esp, 4
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
test esi, esi
je 0x408c36
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
lea eax, [ebp - 0x20]
push eax
push 0
lea eax, [ebp - 0x24]
push eax
push 0
push 0x49eab8
push esi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x408c36
mov eax, dword [ebp - 0x24]
cmp eax, 1
je 0x408b07
cmp eax, 2
je 0x408b07
cmp eax, 7
jne 0x408c36
mov eax, dword [ebp - 0x20]
xor ecx, ecx
add eax, 4
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x20], eax
mov edx, 2
shr eax, 1
mov dword [ebp - 0x30], eax
inc eax
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0046a22b
mov edi, eax
mov byte [ebp - 0x14], 1
mov eax, dword [ebp - 0x30]
xor ecx, ecx
add esp, 4
mov dword [ebp - 0x34], edi
mov word [edi + eax*2], cx
mov word [edi], cx
mov dword [edi + eax*2 - 4], ecx
lea eax, [ebp - 0x20]
push eax
push edi
push ecx
push ecx
push 0x49eab8
push esi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x408c36
cmp dword [ebp - 0x24], 7
jne 0x408b9f
mov ecx, dword [ebp - 0x30]
cmp ecx, 3
jbe 0x408b9f
mov byte [ebp - 0x14], 1
add ecx, 0xffffffff
je 0x408b9f
lea ebx, [eax + 0xa]
xor edx, edx
cmp dx, word [edi + eax*2]
jne 0x408b97
cmp word [edi + eax*2 + 2], dx
je 0x408b97
mov word [edi + eax*2], bx
inc eax
cmp eax, ecx
jb 0x408b84
mov ebx, dword [ebp - 0x38]
xor eax, eax
cmp word [edi], ax
je 0x408bae
inc eax
cmp word [edi + eax*2], 0
jne 0x408ba6
mov dword [ebp - 0x18], eax
test eax, eax
je 0x408c36
xor eax, eax
mov byte [ebp - 0x14], 1
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov eax, dword [ebx]
test eax, eax
je 0x408bd7
push eax
call fcn.00469e73
add esp, 4
mov eax, dword [ebp - 0x3c]
mov dword [ebx], edi
mov byte [ebx + 8], 1
mov dword [eax], 0
test edi, edi
je 0x408c31
push 0x2000
call fcn.0046a22b
add esp, 4
mov edi, eax
push 0x1000
push edi
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov dword [ebp - 0x30], eax
test eax, eax
jne 0x408c1c
push edi
call fcn.00469e73
mov bl, byte [ebx + 8]
add esp, 4
jmp 0x408c3c
push dword [ebx]
call fcn.00469e73
mov ecx, dword [ebp - 0x3c]
add esp, 4
mov eax, dword [ebp - 0x30]
dec eax
mov dword [ebx], edi
mov dword [ecx], eax
mov bl, byte [ebx + 8]
jmp 0x408c3c
xor bl, bl
test esi, esi
je 0x408c48
cmp esi, 0xffffffff
je 0x408c48
push esi
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x408c58
push eax
call fcn.00469e73
add esp, 4
mov al, bl
jmp 0x408c5e
xor al, al
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.00469e65
mov esp, ebp
pop ebp
ret