Function at 0x4064e0
Capabilities:
Get common file path
Query or enumerate registry value
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xcc
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
xor eax, eax
cmp edi, eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], eax
je 0x4066e2
mov ecx, dword [edi + 0x28]
cmp ecx, eax
je 0x4066e2
movzx eax, byte [ecx]
mov dl, byte [ecx + eax + 1]
mov edi, dword [edi + 0x2c]
lea esi, [ecx + eax + 1]
mov eax, 0xff
inc esi
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x34], esi
add esi, eax
mov bl, byte [esi]
inc esi
mov dword [ebp - 0x20], esi
add esi, eax
mov byte [ebp + 0xb], bl
mov bl, byte [esi]
inc esi
mov dword [ebp - 0x24], esi
add esi, eax
mov byte [ebp - 1], bl
mov bl, byte [esi]
inc esi
mov dword [ebp - 0x2c], esi
add esi, eax
sub edi, esi
add edi, ecx
je 0x4065eb
movzx eax, dl
mov dword [ebp - 0x30], eax
movzx eax, byte [ebp + 0xb]
mov dword [ebp + 8], eax
movzx eax, byte [ebp - 1]
mov dword [ebp - 0x1c], eax
movzx eax, bl
mov dword [ebp - 0x28], eax
mov edx, dword [ebp - 0x10]
cmp edx, dword [ebp - 0x30]
jne 0x40657f
xor edx, edx
mov dword [ebp - 0x10], edx
mov ecx, dword [ebp - 0x14]
cmp ecx, dword [ebp + 8]
jne 0x40658c
xor ecx, ecx
mov dword [ebp - 0x14], ecx
mov eax, dword [ebp - 0x1c]
cmp dword [ebp - 0xc], eax
jne 0x406598
and dword [ebp - 0xc], 0
mov eax, dword [ebp - 0x28]
cmp dword [ebp - 8], eax
jne 0x4065a4
and dword [ebp - 8], 0
mov ebx, dword [ebp - 0x34]
mov eax, dword [ebp - 0x18]
add eax, esi
mov dl, byte [ebx + edx]
mov ebx, dword [ebp - 0x20]
xor byte [eax], dl
mov dl, byte [eax]
mov cl, byte [ebx + ecx]
mov ebx, dword [ebp - 0xc]
xor cl, dl
mov edx, dword [ebp - 0x24]
mov byte [eax], cl
mov dl, byte [edx + ebx]
mov ebx, dword [ebp - 8]
xor dl, cl
mov ecx, dword [ebp - 0x2c]
mov byte [eax], dl
mov cl, byte [ecx + ebx]
xor cl, dl
inc dword [ebp - 0x18]
inc dword [ebp - 0x10]
inc dword [ebp - 0x14]
inc dword [ebp - 0xc]
inc dword [ebp - 8]
cmp dword [ebp - 0x18], edi
mov byte [eax], cl
jb 0x406572
lea eax, [ebp - 0xcc]
mov dword [ebp - 0xcc], 0x94
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
cmp dword [ebp - 0xbc], 2
mov ebx, dword [ebp + 0xc]
jne 0x40664f
lea eax, [ebp + 8]
push eax
push 0x20019
push 0
push 0x40f448
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40664f
lea eax, [ebp + 0x10]
push eax
lea eax, [ebp + 0xc]
push ebx
push eax
push 0
push 0x40f42c
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
jne 0x406664
push dword [ebp + 0x10]
push ebx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp word [ebx + eax*2 - 2], 0x5c
mov dword [ebp + 8], eax
je 0x406685
push 0x40f428
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcatW]
mov eax, dword [ebp + 8]
lea eax, [ebx + eax*2 + 2]
push eax
call fcn.0040643b
mov dword [esp], 0x40f41c
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcatW]
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x4066d7
lea eax, [ebp - 0x38]
push 0
push eax
push edi
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
push ebx
jne 0x4066e9
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 0x14]
mov dword [ecx], eax
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 1
pop eax
jmp 0x4066e4