Function at 0x405220
Capabilities:
Copy file
Delete file
Get common file path
Read file on windows
Set file attributes

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x7a4
mov eax, dword [0x41e040]
xor eax, esp
mov dword [esp + 0x7a0], eax
push ebx
push esi
push edi
push 1
mov esi, ecx
push 0x4201d8
mov dword [esp + 0x1c], esi
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
test eax, eax
jne 0x40565c
push 0x87
push eax
mov byte [esp + 0x20], al
lea eax, [esp + 0x21]
push eax
call fcn.0040c350
mov ebx, dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
add esp, 0xc
test esi, esi
jne 0x4053f4
mov eax, dword [0x4201ec]
test eax, eax
jne 0x405292
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov dword [0x4201ec], eax
push 0x12c
lea ecx, [esp + 0x2fc]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea edx, [esp + 0x2f8]
push 0x5c
push edx
call fcn.0040807a
add esp, 8
test eax, eax
je 0x4052c1
xor ecx, ecx
mov word [eax], cx
lea eax, [esp + 0x2f8]
lea edx, [eax + 2]
jmp 0x4052d0
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4052d0
sub eax, edx
sar eax, 1
mov esi, 0x12b
sub esi, eax
cmp esi, 0xc
jbe 0x4052f0
mov esi, 0xc
lea edi, [esp + eax*2 + 0x2f8]
test edi, edi
je 0x40530d
lea edx, [esi + esi]
push edx
push str._strings.bin
push edi
call fcn.004088e0
add esp, 0xc
lea ecx, [esp + 0xa0]
push ecx
xor eax, eax
push 0x12c
mov word [edi + esi*2], ax
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [esp + 0xa0]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405330
sub eax, edx
sar eax, 1
cmp word [esp + eax*2 + 0x9e], 0x5c
jne 0x40536d
lea eax, [esp + 0xa0]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405354
sub eax, edx
sar eax, 1
xor edx, edx
mov word [esp + eax*2 + 0x9e], dx
lea eax, [esp + 0xa0]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405377
sub eax, edx
sar eax, 1
mov esi, 0x12b
sub esi, eax
cmp esi, 0xc
jbe 0x405397
mov esi, 0xc
lea edi, [esp + eax*2 + 0xa0]
test edi, edi
je 0x4053b4
lea eax, [esi + esi]
push eax
push str._strings.bin
push edi
call fcn.004088e0
add esp, 0xc
push 0x80
lea edx, [esp + 0xa4]
xor ecx, ecx
push edx
mov word [edi + esi*2], cx
call ebx
lea eax, [esp + 0xa0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push 0
lea ecx, [esp + 0xa4]
push ecx
lea edx, [esp + 0x300]
push edx
call dword [sym.imp.KERNEL32.dll_CopyFileW]
jmp 0x4054a6
push 0x12b
lea eax, [esp + 0xa4]
push esi
push eax
call fcn.00407f41
lea eax, [esp + 0xac]
add esp, 0xc
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405414
sub eax, edx
sar eax, 1
cmp word [esp + eax*2 + 0x9e], 0x5c
jne 0x405459
lea eax, [esp + 0xa0]
lea edx, [eax + 2]
jmp 0x405440
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405440
sub eax, edx
sar eax, 1
xor ecx, ecx
mov word [esp + eax*2 + 0x9e], cx
lea eax, [esp + 0xa0]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x405463
sub eax, edx
sar eax, 1
mov esi, 0x12b
sub esi, eax
cmp esi, 0xc
jbe 0x405483
mov esi, 0xc
lea edi, [esp + eax*2 + 0xa0]
test edi, edi
je 0x4054a0
lea edx, [esi + esi]
push edx
push str._strings.bin
push edi
call fcn.004088e0
add esp, 0xc
xor eax, eax
mov word [edi + esi*2], ax
push 0x80
lea ecx, [esp + 0xa4]
push ecx
call ebx
push 0x12c
lea edx, [esp + 0x554]
push edx
lea eax, [esp + 0xa8]
push eax
call dword [sym.imp.KERNEL32.dll_GetShortPathNameW]
push 0x40
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x558]
push edx
call sub.LZ32.dll_LZOpenFileW
mov ebx, eax
test ebx, ebx
jl 0x405605
push 2
push 0
push ebx
call sub.LZ32.dll_LZSeek
cdq
test edx, edx
ja 0x405504
cmp eax, 0x100000
jbe 0x40550b
mov edi, 0x100000
jmp 0x40550d
mov edi, eax
push edi
call fcn.00407e77
mov esi, eax
add esp, 4
test esi, esi
je 0x4055db
push 0
push 0
push ebx
call sub.LZ32.dll_LZSeek
push edi
push esi
push ebx
call sub.LZ32.dll_LZRead
mov dword [esp + 0x10], eax
test eax, eax
je 0x4055ad
mov edi, eax
call fcn.00406cf0
call fcn.00406c40
mov edi, eax
test edi, edi
je 0x405598
mov ecx, dword [esp + 0x10]
mov eax, dword [edi]
mov edx, dword [eax + 0x18]
push ecx
push esi
mov ecx, edi
call edx
test al, al
je 0x40557a
push 0x405200
mov dword [0x4201dc], edi
call fcn.00408fc4
add esp, 4
push esi
call fcn.00407d02
jmp 0x4055e5
mov eax, dword [edi]
mov edx, dword [eax + 4]
mov ecx, edi
call edx
push str.AutoStringInit:SetDataUtf8_failed_n
call fcn.00407fcb
add esp, 4
push esi
call fcn.00407d02
jmp 0x4055e5
push str.AutoStringInit:CfgBallCreate_failed_n
call fcn.00407fcb
add esp, 4
push esi
call fcn.00407d02
jmp 0x4055e5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AutoStringInit:LZRead_failed___error:_d_n
call fcn.00407fcb
lea eax, [esp + 0x558]
push eax
push str.AutoStringInit:LZRead_failed___shortFileName:_s_n
call fcn.00407fcb
add esp, 0x10
push esi
call fcn.00407d02
jmp 0x4055e5
push str.AutoStringInit:Memory_allocation_error_n
call fcn.00407fcb
add esp, 4
push ebx
call sub.LZ32.dll_LZClose
cmp dword [esp + 0x14], 0
jne 0x40563d
lea ecx, [esp + 0xa0]
push ecx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
jmp 0x40563d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.AutoStringInit:LZOpenFile_failed___error:_d_n
call fcn.00407fcb
lea edx, [esp + 0x558]
push edx
push str.AutoStringInit:LZOpenFile_failed___shortFileName:_s_n
call fcn.00407fcb
lea eax, [esp + 0xb0]
push eax
push str.AutoStringInit:LZOpenFile_failed___tempFileName:_s_n
call fcn.00407fcb
add esp, 0x18
mov ecx, dword [0x4201dc]
test ecx, ecx
je 0x405665
mov edx, dword [ecx]
mov eax, dword [edx + 0x34]
push 0x4201e0
push 0xffffffffffffffe0
push str.IDS_POSTPROCESS
push 0
call eax
cmp dword [0x4201dc], 0
jne 0x405672
push str.AutoStringInit:Failed_n
call fcn.00407fcb
add esp, 4
mov ecx, dword [esp + 0x7ac]
xor eax, eax
cmp dword [0x4201dc], eax
pop edi
pop esi
setne al
pop ebx
xor ecx, esp
call fcn.00407bfa
mov esp, ebp
pop ebp
ret