Function at 0x140040460
Capabilities:
Check if file exists
Copy file
Delete file
Get common file path
Get file attributes
Read .ini file
Set file attributes

Disassembly:
mov rax, rsp
push rdi
push r12
push r13
sub rsp, 0x560
mov qword [rsp + 0x60], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rbp
mov qword [rax + 0x20], rsi
mov rax, qword [0x140099938]
xor rax, rsp
mov qword [rsp + 0x550], rax
mov rsi, rcx
mov ebp, 0x100
lea rcx, [rsp + 0x70]
call fcn.1400527a8
nop
mov r13d, 7
mov qword [rsp + 0xf8], r13
xor edi, edi
mov qword [rsp + 0xf0], rdi
mov word [rsp + 0xe0], di
mov qword [rsp + 0x120], r13
mov qword [rsp + 0x118], rdi
mov word [rsp + 0x108], di
mov qword [rsp + 0xd0], r13
mov qword [rsp + 0xc8], rdi
mov word [rsp + 0xb8], di
cmp dword [rsi + 0x60], edi
jne 0x1400405af
mov ecx, 0x3e9
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop
cmp qword [rsp + 0xd0], 8
jb 0x140040526
mov rcx, qword [rsp + 0xb8]
call fcn.14005ab0c
mov qword [rsp + 0xd0], r13
mov qword [rsp + 0xc8], rdi
mov word [rsp + 0xb8], di
cmp qword [rsp + 0x120], 8
jb 0x140040556
mov rcx, qword [rsp + 0x108]
call fcn.14005ab0c
mov qword [rsp + 0x120], r13
mov qword [rsp + 0x118], rdi
mov word [rsp + 0x108], di
cmp qword [rsp + 0xf8], 8
jb 0x140040586
mov rcx, qword [rsp + 0xe0]
call fcn.14005ab0c
mov qword [rsp + 0xf8], r13
mov qword [rsp + 0xf0], rdi
mov word [rsp + 0xe0], di
lea rcx, [rsp + 0x70]
call fcn.140052808
xor eax, eax
jmp 0x140040a86
lea rbx, [rsi + 0x38]
cmp qword [rbx + 0x20], 8
jb 0x1400405c0
mov rcx, qword [rbx + 8]
jmp 0x1400405c4
lea rcx, [rbx + 8]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x140040680
mov ecx, 2
call qword [sym.imp.KERNEL32.dll_SetLastError]
nop
cmp qword [rsp + 0xd0], 8
jb 0x1400405f7
mov rcx, qword [rsp + 0xb8]
call fcn.14005ab0c
mov qword [rsp + 0xd0], r13
mov qword [rsp + 0xc8], rdi
mov word [rsp + 0xb8], di
cmp qword [rsp + 0x120], 8
jb 0x140040627
mov rcx, qword [rsp + 0x108]
call fcn.14005ab0c
mov qword [rsp + 0x120], r13
mov qword [rsp + 0x118], rdi
mov word [rsp + 0x108], di
cmp qword [rsp + 0xf8], 8
jb 0x140040657
mov rcx, qword [rsp + 0xe0]
call fcn.14005ab0c
mov qword [rsp + 0xf8], r13
mov qword [rsp + 0xf0], rdi
mov word [rsp + 0xe0], di
lea rcx, [rsp + 0x70]
call fcn.140052808
xor eax, eax
jmp 0x140040a86
lea r12, [rsi + 8]
mov rcx, r12
call fcn.1400078cc
or r9, 0xffffffffffffffff
xor r8d, r8d
mov rdx, rbx
lea rcx, [rsp + 0xb0]
call fcn.140002130
mov esi, 0x20a
mov r8, rsi
xor edx, edx
lea rcx, [rsp + 0x340]
call fcn.14005bb90
mov r8, rsi
xor edx, edx
lea rcx, [rsp + 0x130]
call fcn.14005bb90
lea rdx, [rsp + 0x340]
mov ecx, 0x105
call qword [sym.imp.KERNEL32.dll_GetTempPathW]
cmp eax, edi
je 0x14004077e
lea r9, [rsp + 0x130]
xor r8d, r8d
lea rdx, [0x140080118]
lea rcx, [rsp + 0x340]
call qword [sym.imp.KERNEL32.dll_GetTempFileNameW]
cmp eax, edi
je 0x14004077e
cmp qword [rbx + 0x20], 8
jb 0x140040718
mov rcx, qword [rbx + 8]
jmp 0x14004071c
lea rcx, [rbx + 8]
xor r8d, r8d
lea rdx, [rsp + 0x130]
call qword [sym.imp.KERNEL32.dll_CopyFileW]
cmp eax, edi
je 0x14004077e
lea r9, [rsp + 0x130]
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
mov edx, 0x80
lea rcx, [rsp + 0x130]
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea rcx, [rsp + 0x130]
call fcn.14005b1c0
mov r8, rax
lea rdx, [rsp + 0x130]
lea rcx, [rsp + 0xb0]
call fcn.140002280
lea r9, [rsp + 0xb8]
cmp qword [rsp + 0xd0], 8
cmovae r9, qword [rsp + 0xb8]
lea r8, str.strTargetInfFile___1_s__IN_n
lea rdx, str.CIniSections::GetList
mov esi, 5
mov ecx, esi
call fcn.140009480
mov r8d, 0xee7
lea rdx, str...CommonDeviceInf.cpp
mov ecx, 0x200
call fcn.140048afc
mov rbx, rax
cmp rax, rdi
je 0x14004086b
lea rcx, [rsp + 0xb8]
cmp qword [rsp + 0xd0], 8
cmovae rcx, qword [rsp + 0xb8]
mov qword [rsp + 0x28], rcx
mov dword [rsp + 0x20], 2
lea r9, [rsp + 0x30]
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
lea r8, [rsp + 0xb8]
cmp qword [rsp + 0xd0], 8
cmovae r8, qword [rsp + 0xb8]
mov edx, ebp
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetPrivateProfileSectionNamesW]
lea ecx, [rbp - 2]
cmp ecx, eax
jne 0x14004086b
mov rcx, rbx
call fcn.140048b24
add ebp, 0x100
mov ecx, ebp
add rcx, rcx
mov r8d, 0xef2
lea rdx, str...CommonDeviceInf.cpp
call fcn.140048afc
mov rbx, rax
cmp rax, rdi
jne 0x1400407d5
cmp word [rsp + 0x130], di
je 0x1400408b3
lea r9, [rsp + 0x130]
lea r8, str.Delete_the_temp_file.___1_s___n
lea rdx, str.CIniSections::GetList
mov ecx, esi
call fcn.140009480
mov edx, 0x80
lea rcx, [rsp + 0x130]
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
lea rcx, [rsp + 0x130]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
cmp rbx, rdi
jne 0x140040951
cmp qword [rsp + 0xd0], 8
jb 0x1400408d4
mov rcx, qword [rsp + 0xb8]
call fcn.14005ab0c
mov qword [rsp + 0xd0], r13
mov qword [rsp + 0xc8], rdi
mov word [rsp + 0xb8], di
cmp qword [rsp + 0x120], 8
jb 0x140040904
mov rcx, qword [rsp + 0x108]
call fcn.14005ab0c
mov qword [rsp + 0x120], r13
mov qword [rsp + 0x118], rdi
mov word [rsp + 0x108], di
cmp qword [rsp + 0xf8], 8
jb 0x140040934
mov rcx, qword [rsp + 0xe0]
call fcn.14005ab0c
mov qword [rsp + 0xf8], r13
mov qword [rsp + 0xf0], rdi
mov word [rsp + 0xe0], di
jmp 0x140040a7a
mov rdx, rbx
lea rcx, [rsp + 0x70]
call fcn.1400532bc
mov rcx, rbx
call fcn.140048b24
mov esi, edi
lea rcx, [rsp + 0x70]
call fcn.140051294
cmp rax, rdi
jbe 0x1400409e5
mov rbx, rdi
mov rdx, rbx
lea rcx, [rsp + 0x70]
call fcn.1400513e4
mov rbx, rax
mov qword [rsp + 0x58], r13
mov qword [rsp + 0x50], rdi
mov word [rsp + 0x40], di
mov rcx, rax
call fcn.14005b1c0
mov r8, rax
mov rdx, rbx
lea rcx, [rsp + 0x38]
call fcn.140002280
nop
lea rdx, [rsp + 0x38]
mov rcx, r12
call fcn.14001a3a4
nop
cmp qword [rsp + 0x58], 8
jb 0x1400409d2
mov rcx, qword [rsp + 0x40]
call fcn.14005ab0c
inc esi
mov ebx, esi
lea rcx, [rsp + 0x70]
call fcn.140051294
cmp rbx, rax
jb 0x14004097a
cmp qword [rsp + 0xd0], 8
jb 0x1400409fd
mov rcx, qword [rsp + 0xb8]
call fcn.14005ab0c
mov qword [rsp + 0xd0], r13
mov qword [rsp + 0xc8], rdi
mov word [rsp + 0xb8], di
cmp qword [rsp + 0x120], 8
jb 0x140040a2d
mov rcx, qword [rsp + 0x108]
call fcn.14005ab0c
mov qword [rsp + 0x120], r13
mov qword [rsp + 0x118], rdi
mov word [rsp + 0x108], di
cmp qword [rsp + 0xf8], 8
jb 0x140040a5d
mov rcx, qword [rsp + 0xe0]
call fcn.14005ab0c
mov qword [rsp + 0xf8], r13
mov qword [rsp + 0xf0], rdi
mov word [rsp + 0xe0], di
mov edi, 1
lea rcx, [rsp + 0x70]
call fcn.140052808
mov eax, edi
mov rcx, qword [rsp + 0x550]
xor rcx, rsp
call fcn.14005bad0
lea r11, [rsp + 0x560]
mov rbx, qword [r11 + 0x28]
mov rbp, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r13
pop r12
pop rdi
ret