Function at 0x401470
Capabilities:
Check if file exists
Check mutex on windows
Copy file
Create directory
Get common file path
Get program files directory
Print debug messages

Disassembly:
sub esp, 0x618
push ebx
push ebp
push esi
push edi
xor ebx, ebx
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x421]
mov byte [esp + 0x420], bl
mov esi, dword [sym.imp.SHLWAPI.dll_wnsprintfA]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x42038c
push 0x420368
lea eax, [esp + 0x428]
push 0x104
push eax
call esi
add esp, 0x10
lea ecx, [esp + 0x420]
push ecx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x219]
mov byte [esp + 0x218], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x115]
mov byte [esp + 0x114], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x31d]
mov byte [esp + 0x31c], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x420338
push 1
push ebx
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov ebp, eax
cmp ebp, ebx
jne 0x40156d
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x11]
mov byte [esp + 0x10], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x42038c
push 0x420314
lea edx, [esp + 0x18]
push 0x104
push edx
stosb byte es:[edi], al
call esi
add esp, 0x10
lea eax, [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x618
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x4015c9
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x11]
mov byte [esp + 0x10], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x42038c
push 0x4202f0
lea ecx, [esp + 0x18]
push 0x104
push ecx
stosb byte es:[edi], al
call esi
add esp, 0x10
lea edx, [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x618
ret
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
lea eax, [esp + 0x118]
push 0x26
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
mov edi, dword [sym.imp.SHLWAPI.dll_PathAppendA]
lea ecx, [esp + 0x114]
push 0x4202d8
push ecx
call edi
mov ebp, dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
lea edx, [esp + 0x114]
push edx
call ebp
test eax, eax
jne 0x40161b
lea eax, [esp + 0x114]
push ebx
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExA]
lea ecx, [esp + 0x114]
push ecx
call ebp
test eax, eax
jne 0x401681
lea edx, [esp + 0x114]
push ebx
push edx
call fcn.00402df0
add esp, 8
test eax, eax
jne 0x401681
mov ecx, 0x40
lea edi, [esp + 0x11]
mov byte [esp + 0x10], bl
push 0x42038c
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x4202b4
lea eax, [esp + 0x18]
push 0x104
push eax
call esi
add esp, 0x10
lea ecx, [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x618
ret
lea edx, [esp + 0x114]
push 0x4202a0
push edx
call edi
mov edi, dword [sym.imp.KERNEL32.dll_lstrcpynA]
lea eax, [esp + 0x114]
push pe_nt_image_headers32
lea ecx, [esp + 0x320]
push eax
push ecx
call edi
lea edx, [esp + 0x31c]
push 0x420298
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [esp + 0x218]
push 0x104
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
je 0x401560
lea ecx, [esp + 0x114]
lea edx, [esp + 0x218]
push ecx
push edx
call sub.MSVCRT.dll__mbsicmp
add esp, 8
test eax, eax
je 0x401773
mov ebp, dword [sym.imp.KERNEL32.dll_CopyFileA]
lea eax, [esp + 0x114]
push ebx
lea ecx, [esp + 0x21c]
push eax
push ecx
call ebp
test eax, eax
jne 0x401762
lea edx, [esp + 0x31c]
push ebx
lea eax, [esp + 0x21c]
push edx
push eax
call ebp
test eax, eax
jne 0x40174a
lea ecx, [esp + 0x218]
push ebx
push ecx
call fcn.00403060
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x618
ret
lea edx, [esp + 0x114]
lea eax, [esp + 0x31c]
push edx
push eax
call fcn.00403060
add esp, 8
lea ecx, [esp + 0x218]
push ebx
push ecx
call fcn.00403060
add esp, 8
lea edx, [esp + 0x114]
push 0x104
lea eax, [esp + 0x320]
push edx
push eax
call edi
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x11]
mov byte [esp + 0x10], bl
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x114]
lea edx, [esp + 0x10]
stosw word es:[edi], ax
push ecx
push 0x420288
push 0x104
push edx
stosb byte es:[edi], al
call esi
push ebx
push ebx
push 2
lea eax, [esp + 0x2c]
push 0x10
push eax
push 0x420268
push 0x420258
call fcn.00401160
add esp, 0x2c
test eax, eax
je 0x401560
push 0x4201f0
push 0x420258
call fcn.004011f0
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x52d]
mov byte [esp + 0x52c], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x42038c
push 0x4201c8
lea ecx, [esp + 0x534]
push 0x104
push ecx
stosb byte es:[edi], al
call esi
add esp, 0x18
lea edx, [esp + 0x524]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x618
ret