Function at 0x405642
Capabilities:
Get common file path
Set current directory
Set file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xafc
mov dl, byte [0x4182fc]
push ebx
push esi
push edi
push 0xf
xor eax, eax
pop ecx
lea edi, [ebp - 0x67]
mov byte [ebp - 0x68], dl
push 0x40
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0xafc]
pop ecx
mov dword [ebp - 4], eax
xor eax, eax
lea edi, [ebp - 0x32b]
mov byte [ebp - 0x32c], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x3f
xor eax, eax
pop ecx
lea edi, [ebp - 0x1a7]
mov byte [ebp - 0x1a8], dl
push 0x1f
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
pop ecx
xor eax, eax
lea edi, [ebp - 0x227]
mov byte [ebp - 0x228], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0xf
xor eax, eax
pop ecx
lea edi, [ebp - 0xa7]
mov byte [ebp - 0xa8], dl
push 7
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
pop ecx
xor eax, eax
lea edi, [ebp - 0x27]
mov byte [ebp - 0x28], dl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x68]
push 0x40
push eax
push 0x589
mov dword [ebp - 8], 0x7d0
call fcn.00406e92
lea eax, [ebp - 8]
push eax
push 0
lea eax, [ebp - 0x68]
push 0
push eax
push dword [ebp + 8]
call fcn.00403730
add esp, 0x20
test eax, eax
je 0x405947
lea eax, [ebp - 0x32c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
lea eax, [ebp - 0x68]
push eax
lea eax, [ebp - 0x32c]
push eax
call edi
push eax
mov ebx, 0x4182fc
push str.CopyKeyBlob._1.__08X.__s.__s.
push ebx
push 3
call fcn.00407279
mov esi, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
add esp, 0x18
push 0x4142b4
call esi
lea eax, [ebp - 0xa8]
push 0x40
push eax
push 0x8fe
call fcn.00406e92
lea eax, [ebp - 0x28]
push 0x4142a8
push eax
call fcn.0040b4f0
lea eax, [ebp - 0x68]
push 0x40
push eax
push 0x59a
call fcn.00406e92
lea eax, [ebp - 0x28]
push 1
push eax
lea eax, [ebp - 0xa8]
push eax
lea eax, [ebp - 0x1a8]
push eax
lea eax, [ebp - 0x68]
push eax
push dword [ebp + 8]
call fcn.0040b0bd
add esp, 0x38
test eax, eax
jne 0x4057dc
call edi
mov esi, eax
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0xa8]
push eax
lea eax, [ebp - 0x1a8]
push eax
lea eax, [ebp - 0x68]
push eax
push esi
push str.CopyKeyBlob._2.__08X.__s.__s.__s.__s.
push ebx
push 3
call fcn.00407279
add esp, 0x20
push esi
jmp 0x405941
lea eax, [ebp - 0x32c]
push eax
call esi
mov esi, dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
lea eax, [ebp - 0x1a8]
push 0
push eax
call esi
xor eax, eax
push eax
push 0x80
push 2
push eax
push eax
lea eax, [ebp - 0x1a8]
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
je 0x405919
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x405919
lea eax, [ebp - 0x1a8]
push eax
push str.CopyKeyBlob._4.__s.
push ebx
push 3
call fcn.00407279
lea eax, [ebp - 0x228]
push eax
push dword [ebp + 8]
call fcn.004015a6
add esp, 0x18
test eax, eax
jne 0x405877
call edi
mov edi, eax
lea eax, [ebp - 0x228]
push eax
push edi
push str.CopyKeyBlob._5.__08X.__08X.
push ebx
push 3
call fcn.00407279
add esp, 0x14
jmp 0x4058fe
lea eax, [ebp - 0x228]
push eax
lea eax, [ebp - 8]
push eax
call fcn.0040355e
pop ecx
test eax, eax
pop ecx
je 0x4058e9
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x1a8]
push eax
call fcn.00402f99
pop ecx
test eax, eax
pop ecx
je 0x4058e9
lea eax, [ebp - 0x1a8]
push eax
push str.CopyKeyBlob._7.__s.
push ebx
push 3
call fcn.00407279
add esp, 0x10
push 0x40
push 0x414144
push 0xffffffffffffffff
push 0
push 0x979
call fcn.00406e92
add esp, 0xc
push eax
push dword [ebp + 8]
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 1
pop eax
jmp 0x405949
call edi
mov edi, eax
push edi
push str.CopyKeyBlob._6.__08X.
push ebx
push 1
call fcn.00407279
add esp, 0x10
lea eax, [ebp - 0x1a8]
push 0
push eax
call esi
lea eax, [ebp - 0x1a8]
push eax
call fcn.0040ba8c
pop ecx
push edi
jmp 0x405941
call edi
sub esp, 0x4c
mov esi, 0x4187b0
mov dword [ebp + 8], eax
push 0x13
pop ecx
mov edi, esp
push eax
push str.CopyKeyBlob._3.__08X.__s.
push ebx
rep movsd dword es:[edi], dword [esi]
push 1
call fcn.00407279
add esp, 0x5c
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret