Function at 0x411540
Capabilities:
Check if file exists
Check mutex on windows
Delete file
Get common file path
Move file

Disassembly:
mov eax, 0x4295f4
call fcn.0041bd3c
sub esp, 0x14c
push ebx
push edi
mov edi, dword [esp + 0x168]
push 0
push edi
call fcn.004180ef
xor ebx, ebx
pop ecx
inc ebx
pop ecx
test al, al
jne 0x41158f
push ebx
push edi
call fcn.004180ef
pop ecx
pop ecx
test al, al
jne 0x41158f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x41178c
cmp eax, 3
je 0x41178c
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_DeleteFileA]
push edi
call ebp
test eax, eax
jne 0x41178b
push esi
xor ecx, ecx
push 0xf
pop esi
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x24], esi
mov dword [esp + 0x20], ecx
mov byte [esp + 0x10], cl
mov dword [esp + 0x164], ecx
call fcn.00413e2f
cmp eax, 3
jae 0x4115db
push str.Local90
push ecx
push ecx
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
xor ecx, ecx
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x3c], esi
mov dword [esp + 0x38], ecx
mov byte [esp + 0x28], cl
mov byte [esp + 0x164], bl
lea eax, [esp + 0x58]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x41162f
cmp byte [esp + 0x58], 0
jne 0x411615
xor eax, eax
jmp 0x411620
lea eax, [esp + 0x58]
push eax
call fcn.0041b4b0
pop ecx
push eax
lea eax, [esp + 0x5c]
push eax
lea ecx, [esp + 0x18]
call fcn.00406721
mov ecx, dword [esp + 0x20]
test ecx, ecx
je 0x411682
cmp dword [esp + 0x24], 0x10
lea eax, [esp + 0x10]
cmovae eax, dword [esp + 0x10]
cmp byte [eax + ecx - 1], 0x5c
jne 0x411682
lea eax, [ecx - 1]
push eax
push 0
lea eax, [esp + 0x48]
push eax
lea ecx, [esp + 0x1c]
call fcn.00409b2b
mov byte [esp + 0x164], 2
push eax
lea ecx, [esp + 0x14]
call fcn.0040e4d1
mov byte [esp + 0x164], bl
lea ecx, [esp + 0x40]
call fcn.0040165f
cmp dword [esp + 0x24], 0x10
lea eax, [esp + 0x10]
cmovae eax, dword [esp + 0x10]
push ebx
push eax
call fcn.004180ef
pop ecx
pop ecx
test al, al
je 0x41174a
call fcn.0041e092
mov esi, eax
shl esi, 0xf
call fcn.0041e092
or eax, esi
push eax
lea eax, [esp + 0x44]
push str.__tmp__08x
push eax
call fcn.0040b674
add esp, 0xc
mov byte [esp + 0x164], 3
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esp + 0x1c]
call fcn.004079dc
mov byte [esp + 0x164], bl
lea ecx, [esp + 0x40]
call fcn.0040165f
push 0x10
pop esi
cmp dword [esp + 0x24], esi
lea eax, [esp + 0x10]
cmovae eax, dword [esp + 0x10]
push ebx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
test eax, eax
je 0x41174a
cmp dword [esp + 0x24], esi
lea eax, [esp + 0x10]
cmovae eax, dword [esp + 0x10]
push eax
call fcn.0040fe1c
cmp dword [esp + 0x28], esi
lea eax, [esp + 0x14]
cmovae eax, dword [esp + 0x14]
pop ecx
push eax
call ebp
cmp eax, ebx
je 0x411768
cmp dword [esp + 0x24], esi
push 4
lea eax, [esp + 0x14]
cmovae eax, dword [esp + 0x14]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
jmp 0x411768
push edi
call fcn.0040fe1c
pop ecx
push edi
call ebp
cmp eax, ebx
je 0x411768
push 4
push 0
push edi
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
test eax, eax
setne bl
mov byte [esp + 0x164], 0
lea ecx, [esp + 0x28]
call fcn.0040165f
or dword [esp + 0x164], 0xffffffff
lea ecx, [esp + 0x10]
call fcn.0040165f
pop esi
pop ebp
mov ecx, dword [esp + 0x154]
pop edi
mov al, bl
pop ebx
mov dword fs:[0], ecx
leave
ret