Function at 0x140046710
Capabilities:
Check if file exists
Delete directory
Move file

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r14
sub rsp, 0x4e8
mov rax, qword [0x1400840b0]
xor rax, rsp
mov qword [rsp + 0x4d0], rax
xor eax, eax
mov rdi, rcx
mov r14, r8
mov rbx, rdx
xor esi, esi
lea rcx, [rsp + 0x2b1]
mov r8d, 0x103
xor edx, edx
mov dword [rsp + 0x4c], r9d
mov ebp, 1
mov qword [rsp + 0x60], rsi
mov qword [rsp + 0x68], rax
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x78], rsi
mov qword [rsp + 0x80], rax
mov qword [rsp + 0x88], rax
mov byte [rsp + 0x2b0], al
call fcn.14004a070
lea rcx, [rsp + 0x3c1]
xor edx, edx
mov r8d, 0x103
mov dword [rsp + 0x44], esi
mov byte [rsp + 0x3c0], sil
call fcn.14004a070
lea rcx, [rsp + 0x91]
xor edx, edx
mov r8d, 0x103
mov byte [rsp + 0x90], sil
call fcn.14004a070
lea r8d, [rbp + 1]
xor r9d, r9d
xor edx, edx
mov rcx, rdi
mov word [rsp + 0x40], 0x2c
call qword [sym.imp.SETUPAPI.dll_SetupOpenInfFileA]
cmp rax, 0xffffffffffffffff
mov r12, rax
jne 0x1400467f0
mov eax, esi
jmp 0x140046c36
lea r9, [rsp + 0x60]
lea r8, str.CopyFiles
mov rdx, rbx
mov rcx, rax
call qword [sym.imp.SETUPAPI.dll_SetupFindFirstLineA]
test eax, eax
je 0x140046c2b
lea rcx, [rsp + 0x60]
mov qword [rsp + 0x4e0], r15
call qword [sym.imp.SETUPAPI.dll_SetupGetFieldCount]
mov r15d, ebp
mov dword [rsp + 0x48], ebp
cmp eax, ebp
mov ebx, eax
mov dword [rsp + 0x50], eax
jl 0x140046c23
mov qword [rsp + 0x538], r13
lea r8, [rsp + 0x2b0]
lea rcx, [rsp + 0x60]
mov r9d, 0x104
mov edx, r15d
mov byte [rsp + 0x3c0], 0
mov qword [rsp + 0x20], rsi
call qword [sym.imp.SETUPAPI.dll_SetupGetStringFieldA]
lea rdx, [rsp + 0x2b0]
mov rcx, r12
call qword [sym.imp.SETUPAPI.dll_SetupGetLineCountA]
test eax, eax
jle 0x140046c09
lea r9, [rsp + 0x78]
lea r8, [rsp + 0x2b0]
lea rdx, str.DestinationDirs
mov rcx, r12
call qword [sym.imp.SETUPAPI.dll_SetupFindFirstLineA]
test eax, eax
je 0x1400468e1
lea rax, [rsp + 0x3c0]
mov qword [rsp + 0x30], rsi
lea r9, [rsp + 0x2b0]
lea r8, str.DestinationDirs
mov rdx, r12
xor ecx, ecx
mov dword [rsp + 0x28], 0x104
mov qword [rsp + 0x20], rax
call qword [sym.imp.SETUPAPI.dll_SetupGetLineTextA]
test eax, eax
je 0x140046c09
jmp 0x140046940
lea r9, [rsp + 0x78]
lea r8, str.DefaultDestDir
lea rdx, str.DestinationDirs
mov rcx, r12
call qword [sym.imp.SETUPAPI.dll_SetupFindFirstLineA]
test eax, eax
je 0x140046c09
lea rax, [rsp + 0x3c0]
mov qword [rsp + 0x30], rsi
lea r9, str.DefaultDestDir
lea r8, str.DestinationDirs
mov rdx, r12
xor ecx, ecx
mov dword [rsp + 0x28], 0x104
mov qword [rsp + 0x20], rax
call qword [sym.imp.SETUPAPI.dll_SetupGetLineTextA]
test eax, eax
je 0x140046c09
lea rdx, [rsp + 0x40]
lea rcx, [rsp + 0x3c0]
call fcn.140056440
lea rdx, [rsp + 0x40]
xor ecx, ecx
call fcn.140056440
lea r8, [rsp + 0x44]
lea rcx, [rsp + 0x78]
mov edx, 1
mov r13, rax
mov qword [rsp + 0x58], rax
call qword [sym.imp.SETUPAPI.dll_SetupGetIntField]
test eax, eax
je 0x140046c09
mov ecx, dword [rsp + 0x44]
lea rdx, [rsp + 0x90]
mov r8d, 0x104
call fcn.140040e40
test eax, eax
je 0x140046c09
test r13, r13
je 0x1400469f2
xor eax, eax
or rcx, 0xffffffffffffffff
lea rdi, [rsp + 0x90]
repne scasb al, byte [rdi]
movzx eax, word [0x140073ed8]
or rcx, 0xffffffffffffffff
mov word [rdi - 1], ax
xor eax, eax
lea rdi, [rsp + 0x90]
repne scasb al, byte [rdi]
xor ecx, ecx
nop
nop
nop
movzx eax, byte [r13 + rcx]
add rcx, 1
test al, al
mov byte [rdi + rcx - 2], al
jne 0x1400469e0
cmp dword [rsp + 0x44], 0x101d0
je 0x140046a23
lea r8, [rsp + 0x2b0]
lea rdx, [rsp + 0x90]
mov rcx, r12
call fcn.140046170
test eax, eax
jne 0x140046b8e
mov ebp, esi
jmp 0x140046b8e
lea rcx, [rsp + 0x1a1]
xor edx, edx
mov r8d, 0x103
mov byte [rsp + 0x1a0], 0
call fcn.14004a070
test r14, r14
mov rbx, r14
je 0x140046b2e
mov r13d, dword [rsp + 0x4c]
xor r15d, r15d
cmp byte [rbx], r15b
je 0x140046b22
lea rax, [r14 + r13]
cmp rbx, rax
jae 0x140046b22
lea rdx, str.__:_____
mov r8b, 0x5f
mov rcx, rbx
call fcn.14003e860
mov rcx, r15
mov rsi, rax
movzx eax, byte [rsp + rcx + 0x90]
add rcx, 1
test al, al
mov byte [rsp + rcx + 0x19f], al
jne 0x140046a82
xor eax, eax
or rcx, 0xffffffffffffffff
lea rdi, [rsp + 0x1a0]
repne scasb al, byte [rdi]
movzx eax, word [0x140073ed8]
test rsi, rsi
mov word [rdi - 1], ax
mov rdx, rbx
lea rdi, [rsp + 0x1a0]
cmovne rdx, rsi
xor eax, eax
or rcx, 0xffffffffffffffff
repne scasb al, byte [rdi]
xor ecx, ecx
movzx eax, byte [rdx + rcx]
add rcx, 1
test al, al
mov byte [rdi + rcx - 2], al
jne 0x140046ad0
lea r8, [rsp + 0x2b0]
lea rdx, [rsp + 0x1a0]
mov rcx, r12
call fcn.140046170
test eax, eax
cmove ebp, r15d
test rsi, rsi
je 0x140046b0b
mov rcx, rsi
call fcn.14004ad40
or rcx, 0xffffffffffffffff
xor eax, eax
mov rdi, rbx
repne scasb al, byte [rdi]
not rcx
add rbx, rcx
jne 0x140046a54
mov r13, qword [rsp + 0x58]
mov r15d, dword [rsp + 0x48]
xor esi, esi
mov rcx, rsi
movzx eax, byte [rsp + rcx + 0x90]
add rcx, 1
test al, al
mov byte [rsp + rcx + 0x19f], al
jne 0x140046b31
xor eax, eax
or rcx, 0xffffffffffffffff
lea rdi, [rsp + 0x1a0]
repne scasb al, byte [rdi]
movzx eax, word [0x140075cc0]
lea r8, [rsp + 0x2b0]
mov word [rdi - 1], ax
movzx eax, byte [0x140075cc2]
lea rdx, [rsp + 0x1a0]
mov rcx, r12
mov byte [rdi + 1], al
call fcn.140046170
mov ebx, dword [rsp + 0x50]
test eax, eax
cmove ebp, esi
test r13, r13
je 0x140046c09
lea rcx, [rsp + 0x90]
call qword [sym.imp.KERNEL32.dll_RemoveDirectoryA]
test eax, eax
jne 0x140046bf5
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x140046c09
cmp eax, 3
je 0x140046c09
xor edx, edx
lea rcx, [rsp + 0x90]
lea r8d, [rdx + 4]
call qword [sym.imp.KERNEL32.dll_MoveFileExA]
test eax, eax
je 0x140046be7
lea rdx, [rsp + 0x90]
lea rcx, str.Delete_directory_after_reboot:__s
call fcn.14003e300
jmp 0x140046c09
lea rcx, str.MoveFileEx
call fcn.140041bd0
jmp 0x140046c09
lea rdx, [rsp + 0x90]
lea rcx, str.Deleted_directory:__s
call fcn.14003e300
add r15d, 1
cmp r15d, ebx
mov dword [rsp + 0x48], r15d
jle 0x140046840
mov r13, qword [rsp + 0x538]
mov r15, qword [rsp + 0x4e0]
mov rcx, r12
call qword [sym.imp.SETUPAPI.dll_SetupCloseInfFile]
mov eax, ebp
mov rcx, qword [rsp + 0x4d0]
xor rcx, rsp
call fcn.140048c00
add rsp, 0x4e8
pop r14
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret