Function at 0x140004310
Capabilities:
Check if file exists
Create thread
Delete file
Get common file path
Get file attributes
Move file
Read file on windows
Set file attributes
Write file on windows

Disassembly:
push rbp
push rbx
push r12
lea rbp, [rsp - 0x1cb0]
mov eax, 0x1db0
call fcn.140017d00
sub rsp, rax
mov qword [rsp + 0x1dd0], rsi
mov qword [rsp + 0x1da8], rdi
mov qword [rsp + 0x1d98], r14
xor r14d, r14d
mov qword [rsp + 0x1d90], r15
mov r15, rcx
mov eax, r14d
lea rcx, [rsp + 0x48]
mov rsi, rdx
mov dword [rbp + 0x1ce0], eax
mov qword [rsp + 0x48], r14
call fcn.14000bc60
mov r11d, dword [0x14001e690]
cmp r11d, 2
jne 0x1400047f7
lea rcx, [rsp + 0x78]
mov qword [rsp + 0x1da0], r13
call fcn.1400022c0
mov edi, 0x104
lea rdx, [rbp + 0x280]
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
mov rcx, qword [str.9TRI]
lea rdx, [rbp + 0xc90]
call fcn.14000deb0
movzx eax, byte [rbp + 0xc90]
lea r11, [rbp + 0xc90]
lea rcx, [rbp - 0x60]
test al, al
je 0x1400043e6
nop dword [rax + rax]
movsx eax, al
inc r11
add rcx, 2
mov word [rcx - 2], ax
movzx eax, byte [r11]
test al, al
jne 0x1400043d0
mov word [rcx], r14w
lea r9, [rbp + 0x280]
lea rdx, [rbp - 0x60]
lea rcx, [rbp + 0x280]
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_GetTempFileNameW]
mov rcx, qword [0x14001e698]
xor r9d, r9d
mov qword [rsp + 0x30], r14
lea r8d, [r9 + 1]
mov edx, 0x80000000
mov dword [rsp + 0x28], 0x80
mov r12, r14
mov qword [rsp + 0x58], r14
mov dword [rsp + 0x40], r14d
mov r13d, r14d
mov rsi, r14
mov dword [rbp + 0x1ce8], r14d
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
cmp rax, 0xffffffffffffffff
je 0x1400044fb
mov r9d, 2
xor r8d, r8d
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, rbx
mov dword [rbp + 0x1ce8], eax
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [rbp + 0x1ce8]
xor edx, edx
call fcn.14000e210
mov rsi, rax
test rax, rax
je 0x1400044fb
mov r8d, dword [rbp + 0x1ce8]
lea r9, [rbp + 0x1ce8]
mov rdx, rax
mov rcx, rbx
mov qword [rsp + 0x20], r14
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1400044fb
mov r9d, dword [rbp + 0x1ce8]
lea rax, [rsp + 0x40]
lea rcx, [rsp + 0x78]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x58]
mov r8, rsi
mov rdx, r15
mov qword [rsp + 0x20], rax
call fcn.140002660
mov r12, qword [rsp + 0x58]
mov r15d, 1
test eax, eax
cmovne r14d, r15d
jmp 0x140004501
mov r15d, 1
test rbx, rbx
je 0x14000450f
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test rsi, rsi
je 0x140004529
mov rcx, qword [0x14001e780]
mov r8, rsi
mov edx, 8
call qword [0x14001e798]
test r14d, r14d
je 0x140004596
xor r14d, r14d
lea rcx, [rbp + 0x280]
xor r9d, r9d
mov qword [rsp + 0x30], r14
mov r8d, r15d
mov edx, 0xc0000000
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
cmp rax, 0xffffffffffffffff
je 0x140004582
mov r8d, dword [rsp + 0x40]
lea r9, [rsp + 0x40]
mov rdx, r12
mov rcx, rax
mov qword [rsp + 0x20], r14
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov r13d, r15d
cmp rbx, 0xffffffffffffffff
je 0x140004599
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140004599
xor r14d, r14d
test r12, r12
je 0x1400045b3
mov rcx, qword [0x14001e780]
mov r8, r12
mov edx, 8
call qword [0x14001e798]
test r13d, r13d
mov r13, qword [rsp + 0x1da0]
je 0x1400047d8
mov r12, qword [rsp + 0x48]
lea rax, [rbp + 0x70]
lea rcx, [rbp + 0x70]
mov rdx, r12
sub rdx, rax
nop word [rax + rax]
lea rax, [rdi + 0x7ffffefa]
test rax, rax
je 0x140004603
movzx eax, word [rdx + rcx]
test ax, ax
je 0x140004603
mov word [rcx], ax
add rcx, 2
dec rdi
jne 0x1400045e0
jmp 0x140004608
test rdi, rdi
jne 0x14000460c
sub rcx, 2
mov word [rcx], r14w
mov rcx, qword [str.u1SqNP]
lea rdx, [rbp + 0x490]
call fcn.14000deb0
movzx eax, byte [rbp + 0x490]
lea r11, [rbp + 0x490]
lea rcx, [rbp - 0x60]
test al, al
je 0x140004656
nop dword [rax]
movsx eax, al
inc r11
add rcx, 2
mov word [rcx - 2], ax
movzx eax, byte [r11]
test al, al
jne 0x140004640
mov word [rcx], r14w
lea rdx, [rbp - 0x60]
lea rcx, [rbp + 0x70]
call qword [sym.imp.SHLWAPI.dll_PathRenameExtensionW]
lea rcx, [rbp + 0x70]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
mov ebx, r14d
nop word [rax + rax]
lea rdx, [rbp + 0x70]
mov r8d, 2
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_MoveFileExW]
test eax, eax
jne 0x1400046ae
mov ecx, 0x7d0
call qword [sym.imp.KERNEL32.dll_Sleep]
inc ebx
cmp ebx, 0xa
jl 0x140004680
jmp 0x1400047b7
mov ebx, r14d
nop word [rax + rax]
lea rcx, [rbp + 0x280]
mov rdx, r12
call qword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
jne 0x1400046eb
mov ecx, 0x7d0
call qword [sym.imp.KERNEL32.dll_Sleep]
inc ebx
cmp ebx, 0xa
jl 0x1400046c0
jmp 0x1400047b7
mov rdi, qword [0x14001e7b0]
mov eax, r15d
mov dword [rbp + 0x1ce0], eax
test rdi, rdi
je 0x1400047b7
mov ebx, dword [0x14001e7b8]
test ebx, ebx
je 0x1400047b7
mov rcx, qword [str.iTcM9e_pNf]
lea rdx, [rbp + 0x1490]
call fcn.14000deb0
movzx eax, byte [rbp + 0x1490]
lea r11, [rbp + 0x1490]
lea rcx, [rbp - 0x60]
test al, al
je 0x140004756
nop dword [rax + rax]
movsx eax, al
inc r11
add rcx, 2
mov word [rcx - 2], ax
movzx eax, byte [r11]
test al, al
jne 0x140004740
mov word [rcx], r14w
mov qword [rsp + 0x30], r14
lea rcx, [rbp - 0x60]
xor r9d, r9d
mov r8d, r15d
mov edx, 0xc0000000
mov dword [rsp + 0x28], 0x80
mov rsi, rbx
mov dword [rsp + 0x50], r14d
mov dword [rsp + 0x20], 2
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
cmp rax, 0xffffffffffffffff
je 0x1400047b7
lea r9, [rsp + 0x50]
mov r8d, esi
mov rdx, rdi
mov rcx, rax
mov qword [rsp + 0x20], r14
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp - 0x80]
mov dword [0x14001e690], r14d
test rcx, rcx
je 0x1400047ec
mov rax, qword [rcx]
call qword [rax + 0x10]
mov ebx, dword [rbp + 0x1ce0]
jmp 0x140004b42
mov rcx, qword [rbp - 0x80]
test rcx, rcx
je 0x1400047e7
mov rax, qword [rcx]
call qword [rax + 0x10]
mov r12, qword [rsp + 0x48]
mov ebx, dword [rbp + 0x1ce0]
jmp 0x140004b42
mov eax, dword [0x14001e690]
test eax, eax
jne 0x1400047e7
mov r12, qword [rsp + 0x48]
lea rax, [rbp + 0x70]
mov edi, 0x104
mov r8, r12
mov edx, edi
lea rcx, [rbp + 0x70]
sub r8, rax
mov r9d, r14d
nop
lea rax, [rdx + 0x7ffffefa]
test rax, rax
je 0x140004844
movzx eax, word [r8 + rcx]
test ax, ax
je 0x140004844
mov word [rcx], ax
add rcx, 2
dec rdx
jne 0x140004820
jmp 0x140004849
test rdx, rdx
jne 0x140004853
sub rcx, 2
mov r9d, 0x8007007a
mov word [rcx], r14w
test r9d, r9d
js 0x140004b3f
mov rcx, qword [str.u1SqNP]
lea rdx, [rbp + 0x890]
call fcn.14000deb0
movzx eax, byte [rbp + 0x890]
lea r11, [rbp + 0x890]
lea rcx, [rbp - 0x60]
test al, al
je 0x1400048a6
nop dword [rax]
movsx eax, al
inc r11
add rcx, 2
mov word [rcx - 2], ax
movzx eax, byte [r11]
test al, al
jne 0x140004890
mov word [rcx], r14w
lea rdx, [rbp - 0x60]
lea rcx, [rbp + 0x70]
call qword [sym.imp.SHLWAPI.dll_PathRenameExtensionW]
lea rcx, [rbp + 0x70]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x140004912
test al, 0x10
jne 0x140004912
mov ebx, r14d
nop
lea rcx, [rbp + 0x70]
mov edx, 0x80
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
test eax, eax
jne 0x1400048ee
mov ecx, 0x7d0
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rcx, [rbp + 0x70]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x140004b8a
mov ecx, 0x7d0
call qword [sym.imp.KERNEL32.dll_Sleep]
inc ebx
cmp ebx, 3
jl 0x1400048d0
lea r8, [0x14001e6a0]
mov edx, 0x19
mov rcx, rsi
call fcn.140007870
test eax, eax
je 0x140004b3f
mov rdx, qword [0x14001e6a0]
mov rcx, rdx
mov rbx, rdx
sub rcx, rdx
mov rax, rcx
and rax, 0xfffffffffffffffe
cmp rax, 0x400
jge 0x140004a78
cmp word [rbx], r14w
je 0x14000496e
add rcx, 2
add rbx, 2
mov rax, rcx
and rax, 0xfffffffffffffffe
cmp rax, 0x400
jl 0x140004951
cmp rbx, rdx
jbe 0x140004a78
mov rax, rbx
sub rax, rdx
and rax, 0xfffffffffffffffe
cmp rax, 0x400
jge 0x140004a78
mov rsi, rbx
sub rbx, 2
cmp rbx, rdx
jbe 0x1400049af
nop dword [rax]
cmp word [rbx], 0x2f
je 0x1400049af
sub rbx, 2
cmp rbx, rdx
ja 0x1400049a0
add rbx, 2
cmp rbx, rsi
jae 0x140004a28
mov rcx, qword [str.iTcM9e_pNf]
lea rdx, [rbp + 0x1090]
call fcn.14000deb0
movzx eax, byte [rbp + 0x1090]
lea r11, [rbp + 0x1090]
lea rcx, [rbp - 0x60]
test al, al
je 0x1400049f7
movsx eax, al
inc r11
add rcx, 2
mov word [rcx - 2], ax
movzx eax, byte [r11]
test al, al
jne 0x1400049e1
mov word [rcx], r14w
lea r8, [rsp + 0x70]
lea rdx, [rsp + 0x60]
lea rcx, [rbp - 0x60]
call fcn.14000cc90
test eax, eax
je 0x140004a28
mov rdx, qword [rsp + 0x60]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
je 0x140004b3f
mov r8, qword [0x14001e7b0]
test r8, r8
je 0x140004a46
mov rcx, qword [0x14001e780]
mov edx, 8
call qword [0x14001e798]
sub rsi, rbx
xor edx, edx
sar rsi, 1
lea eax, [rsi + rsi + 2]
mov ecx, eax
mov dword [0x14001e7b8], eax
call fcn.14000e210
mov r8d, dword [0x14001e7b8]
mov rdx, rbx
mov rcx, rax
mov qword [0x14001e7b0], rax
call sub.msvcrt.dll_memcpy
mov rax, qword [0x14001e698]
test rax, rax
jne 0x140004a97
xor edx, edx
mov ecx, 0x20a
call fcn.14000e210
mov qword [0x14001e698], rax
mov rdx, rax
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
je 0x140004b3f
mov rcx, qword [str.9TRI]
lea rdx, [rbp + 0x1890]
call fcn.14000deb0
movzx eax, byte [rbp + 0x1890]
lea r11, [rbp + 0x1890]
lea rcx, [rbp - 0x60]
test al, al
je 0x140004af6
nop word [rax + rax]
movsx eax, al
inc r11
add rcx, 2
mov word [rcx - 2], ax
movzx eax, byte [r11]
test al, al
jne 0x140004ae0
mov word [rcx], r14w
mov rcx, qword [0x14001e698]
lea rdx, [rbp - 0x60]
mov r9, rcx
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_GetTempFileNameW]
lea r11, [rsp + 0x68]
lea r8, [0x140004270]
mov qword [rsp + 0x28], r11
xor r9d, r9d
xor edx, edx
xor ecx, ecx
mov dword [rsp + 0x20], r14d
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov ecx, 0x1f4
call qword [sym.imp.KERNEL32.dll_Sleep]
mov ebx, r14d
mov r15, qword [rsp + 0x1d90]
mov r14, qword [rsp + 0x1d98]
mov rdi, qword [rsp + 0x1da8]
mov rsi, qword [rsp + 0x1dd0]
test r12, r12
je 0x140004b7c
mov rcx, qword [0x14001e780]
mov r8, r12
mov edx, 8
call qword [0x14001e798]
mov eax, ebx
add rsp, 0x1db0
pop r12
pop rbx
pop rbp
ret
cmp ebx, 3
jge 0x140004912
or ebx, 0xffffffff
jmp 0x140004b42