Function at 0x40bfb7
Capabilities:
Get file attributes
Query or enumerate registry key
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
xor ebx, ebx
push ebx
lea eax, [ebp - 0x20]
push ebx
push eax
lea eax, [ebp - 0x1c]
push eax
push ebx
lea eax, [ebp - 0x18]
push ebx
push eax
push ebx
push ebx
push ebx
push ebx
push dword [ebp + 0xc]
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyA]
test eax, eax
jne 0x40c1bd
mov eax, dword [ebp - 0x18]
push esi
mov esi, dword [sym.imp.KERNEL32.DLL_GlobalAlloc]
inc eax
push edi
push eax
push ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 4], eax
call esi
lea ecx, [ebp - 0x2c]
mov edi, dword [sym.imp.ADVAPI32.dll_RegEnumKeyExA]
push ecx
push ebx
push ebx
lea ecx, [ebp - 4]
push ebx
push ecx
push eax
push ebx
push dword [ebp + 0xc]
mov dword [ebp - 0xc], eax
call edi
test eax, eax
jne 0x40c077
cmp dword [ebp + 0x10], ebx
je 0x40c057
lea eax, [ebp - 0x14]
push eax
push 9
push ebx
push dword [ebp - 0xc]
push dword [ebp + 0xc]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40c057
mov eax, dword [ebp + 0x18]
inc eax
push eax
push dword [ebp + 0x14]
push 1
push dword [ebp - 0x14]
push dword [ebp + 8]
call fcn.0040bfb7
add esp, 0x14
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0x18]
inc dword [ebp - 8]
inc eax
mov dword [ebp - 4], eax
lea eax, [ebp - 0x2c]
push eax
push ebx
push ebx
lea eax, [ebp - 4]
push ebx
push eax
push dword [ebp - 0xc]
push dword [ebp - 8]
push dword [ebp + 0xc]
jmp 0x40c014
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.DLL_GlobalFree]
mov eax, dword [ebp - 0x20]
inc eax
push eax
push ebx
mov dword [ebp - 0x10], eax
call esi
mov edi, eax
mov eax, dword [ebp - 0x1c]
inc eax
mov dword [ebp - 8], ebx
push eax
push ebx
mov dword [ebp - 4], eax
call esi
lea ecx, [ebp - 0x10]
mov dword [ebp - 0xc], eax
push ecx
lea ecx, [ebp - 0x24]
push edi
push ecx
lea ecx, [ebp - 4]
push ebx
push ecx
push eax
push ebx
push dword [ebp + 0xc]
call dword [sym.imp.ADVAPI32.dll_RegEnumValueA]
test eax, eax
jne 0x40c1ad
cmp dword [ebp - 0x24], 1
jne 0x40c183
push edi
call fcn.0040e57d
test al, al
pop ecx
je 0x40c183
push edi
call dword [sym.imp.KERNEL32.DLL_GetFileAttributesA]
test al, 0x10
jne 0x40c0ec
cmp eax, 0xffffffff
jne 0x40c183
push 0xffffffffffffffff
push 0x4133f8
push edi
call fcn.0040e778
add esp, 0xc
mov dword [ebp + 0x10], eax
push edi
call dword [sym.imp.KERNEL32.DLL_lstrlenA]
lea ecx, [eax + edi - 1]
mov eax, dword [ebp + 0x10]
cmp eax, ecx
jne 0x40c113
mov byte [eax], bl
push edi
call dword [sym.imp.KERNEL32.DLL_lstrlenA]
add eax, 3
push eax
push ebx
call esi
push dword [ebp + 0x14]
mov dword [ebp + 0x18], eax
push edi
push str._s__u
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
mov eax, dword [0x414a14]
add esp, 0x10
mov dword [ebp + 0x10], ebx
cmp dword [eax], ebx
jle 0x40c16d
push dword [ebp + 0x10]
mov ecx, 0x414a14
call fcn.0040d029
push eax
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.DLL_lstrcmpA]
test eax, eax
je 0x40c17a
inc dword [ebp + 0x10]
mov eax, dword [0x414a14]
mov ecx, dword [ebp + 0x10]
cmp ecx, dword [eax]
jl 0x40c143
push dword [ebp + 0x18]
mov ecx, 0x414a14
call fcn.0040cfd8
push dword [ebp + 0x18]
call dword [sym.imp.KERNEL32.DLL_GlobalFree]
mov eax, dword [ebp - 0x1c]
inc dword [ebp - 8]
inc eax
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x20]
inc eax
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x24]
push edi
push eax
lea eax, [ebp - 4]
push ebx
push eax
push dword [ebp - 0xc]
push dword [ebp - 8]
jmp 0x40c0ae
mov esi, dword [sym.imp.KERNEL32.DLL_GlobalFree]
push edi
call esi
push dword [ebp - 0xc]
call esi
pop edi
pop esi
pop ebx
leave
ret