Function at 0x140051780
Capabilities:
Check if file exists
Copy file
Delete file
Set file attributes

Disassembly:
push rbp
lea rbp, [rsp - 0x1f70]
mov eax, 0x2070
call fcn.14024c240
sub rsp, rax
mov qword [rsp + 0x58], 0xfffffffffffffffe
mov qword [rsp + 0x2080], rbx
mov qword [rsp + 0x2088], rsi
mov qword [rsp + 0x2090], rdi
mov rax, qword [0x140398250]
xor rax, rsp
mov qword [rbp + 0x1f60], rax
xor r8d, r8d
lea rdx, str.CBaseFuncMgr::FN_CopyXMLFile
lea rcx, [rsp + 0x48]
call fcn.1400075a0
nop
mov rcx, qword [0x1403b9750]
mov rax, qword [rcx]
call qword [rax + 0x48]
mov r9, qword [rax]
lea r8, [rsp + 0x60]
lea rdx, str.SOURCEDIR
mov rcx, rax
call qword [r9 + 0x18]
lea rcx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_lstrlenW]
movsxd rcx, eax
cmp word [rsp + rcx*2 + 0x5e], 0x5c
je 0x140051829
lea rdx, [0x1402e5094]
lea rcx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_lstrcatW]
mov rcx, qword [0x1403b9750]
mov rax, qword [rcx]
call qword [rax + 0x48]
mov r9, qword [rax]
lea r8, [rbp + 0x760]
lea rdx, str.TEMPPATH
mov rcx, rax
call qword [r9 + 0x18]
lea rcx, [rbp + 0x760]
call qword [sym.imp.KERNEL32.dll_lstrlenW]
movsxd rcx, eax
cmp word [rbp + rcx*2 + 0x75e], 0x5c
je 0x14005187d
lea rdx, [0x1402e5094]
lea rcx, [rbp + 0x760]
call qword [sym.imp.KERNEL32.dll_lstrcatW]
mov rcx, qword [0x1403b9750]
mov rax, qword [rcx]
call qword [rax + 0x48]
mov r9, qword [rax]
lea r8, [rbp + 0x1760]
lea rdx, str.PCLTYPE
mov rcx, rax
call qword [r9 + 0x18]
lea rcx, [rbp + 0x1760]
call fcn.14024740c
mov edi, eax
mov rcx, qword [0x1403b9750]
mov rdx, qword [rcx]
call qword [rdx + 0x48]
mov r9, qword [rax]
lea r8, [rbp + 0xf60]
lea rdx, [0x1402e2e08]
mov rcx, rax
call qword [r9 + 0x18]
lea rbx, str.SNMPDiscovery.xml
mov qword [rsp + 0x20], rbx
lea r9, [0x1402dda38]
lea r8, [rbp + 0x760]
lea rdx, [0x1402e07a0]
lea rcx, [rbp + 0x760]
call qword [sym.imp.USER32.dll_wsprintfW]
lea rdx, [0x1402ddbb8]
lea rcx, [rbp + 0xf60]
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
jne 0x140051954
lea r9, str.DDIXML
lea r8, [rsp + 0x60]
lea rdx, [0x1402e07a0]
lea rcx, [rsp + 0x60]
cmp edi, 5
jne 0x140051946
lea rax, str.SNMPDiscoveryP5.xml
mov qword [rsp + 0x20], rax
jmp 0x140051997
lea rax, str.SNMPDiscoveryP6.xml
mov qword [rsp + 0x20], rax
jmp 0x140051997
lea rdx, str.GARO
lea rcx, [rbp + 0xf60]
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
lea r9, str.DDIXML
lea r8, [rsp + 0x60]
lea rdx, [0x1402e07a0]
lea rcx, [rsp + 0x60]
test eax, eax
jne 0x140051992
lea rax, str.SNMPDiscoveryGA1.xml
mov qword [rsp + 0x20], rax
jmp 0x140051997
mov qword [rsp + 0x20], rbx
call qword [sym.imp.USER32.dll_wsprintfW]
lea rcx, [rsp + 0x60]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x1400519eb
lea rcx, [rbp + 0x760]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x1400519eb
lea rcx, [rbp + 0x760]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
je 0x1400519eb
lea r9, [rbp + 0x760]
lea r8, str.SNMPDiscovery_XML_File_deletion__s_
mov edx, 7
lea rcx, [rsp + 0x48]
call fcn.140007780
xor r8d, r8d
lea rdx, [rbp + 0x760]
lea rcx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CopyFileW]
xor esi, esi
test eax, eax
jne 0x140051a79
mov qword [rsp + 0x40], rsi
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], esi
lea rax, [rsp + 0x40]
mov qword [rsp + 0x20], rax
mov r9d, 0x409
mov r8d, ebx
xor edx, edx
mov ecx, 0x1300
call qword [sym.imp.KERNEL32.dll_FormatMessageW]
test eax, eax
je 0x140051a69
mov rcx, qword [rsp + 0x40]
mov qword [rsp + 0x28], rcx
mov dword [rsp + 0x20], ebx
lea r9, str._t_t_tCopyFile
lea r8, str.ApiName:__s__ErrorCode:__d_:__s
lea edx, [rsi + 6]
lea rcx, [rsp + 0x48]
call fcn.140007780
mov rcx, qword [rsp + 0x40]
test rcx, rcx
je 0x140051a79
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov edx, 0x20
lea rcx, [rbp + 0x760]
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
mov rcx, qword [0x1403b9750]
mov rax, qword [rcx]
call qword [rax + 0x48]
mov r9, qword [rax]
lea r8, [rsp + 0x60]
lea rdx, str.SOURCEDIR
mov rcx, rax
call qword [r9 + 0x18]
lea rcx, [rsp + 0x60]
call qword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
mov rcx, qword [0x1403b9750]
mov rax, qword [rcx]
call qword [rax + 0x48]
mov r10, qword [rax]
lea r8, [rbp + 0x760]
lea rdx, str.TEMPPATH
mov rcx, rax
call qword [r10 + 0x18]
lea rcx, [rbp + 0x760]
call qword [sym.imp.SHLWAPI.dll_PathAddBackslashW]
lea rbx, str.SLPDiscovery.xml
mov qword [rsp + 0x20], rbx
lea r9, [0x1402dda38]
lea r8, [rbp + 0x760]
lea rdx, [0x1402e07a0]
lea rcx, [rbp + 0x760]
call qword [sym.imp.USER32.dll_wsprintfW]
lea rdx, [0x1402ddbb8]
lea rcx, [rbp + 0xf60]
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
jne 0x140051b6a
lea r9, str.DDIXML
lea r8, [rsp + 0x60]
lea rdx, [0x1402e07a0]
lea rcx, [rsp + 0x60]
cmp edi, 5
jne 0x140051b5c
lea rax, str.SLPDiscoveryP5.xml
mov qword [rsp + 0x20], rax
jmp 0x140051bad
lea rax, str.SLPDiscoveryP6.xml
mov qword [rsp + 0x20], rax
jmp 0x140051bad
lea rdx, str.GARO
lea rcx, [rbp + 0xf60]
call qword [sym.imp.KERNEL32.dll_lstrcmpiW]
lea r9, str.DDIXML
lea r8, [rsp + 0x60]
lea rdx, [0x1402e07a0]
lea rcx, [rsp + 0x60]
test eax, eax
jne 0x140051ba8
lea rax, str.SLPDiscoveryGA1.xml
mov qword [rsp + 0x20], rax
jmp 0x140051bad
mov qword [rsp + 0x20], rbx
call qword [sym.imp.USER32.dll_wsprintfW]
lea rcx, [rsp + 0x60]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x140051c01
lea rcx, [rbp + 0x760]
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x140051c01
lea rcx, [rbp + 0x760]
call qword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
je 0x140051c01
lea r9, [rbp + 0x760]
lea r8, str.SLPDiscovery_XML_File_deletion__s_
mov edx, 7
lea rcx, [rsp + 0x48]
call fcn.140007780
xor r8d, r8d
lea rdx, [rbp + 0x760]
lea rcx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
jne 0x140051c8f
mov qword [rsp + 0x40], rsi
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], esi
lea rax, [rsp + 0x40]
mov qword [rsp + 0x20], rax
mov r9d, 0x409
mov r8d, ebx
xor edx, edx
mov ecx, 0x1300
call qword [sym.imp.KERNEL32.dll_FormatMessageW]
test eax, eax
je 0x140051c7f
mov rcx, qword [rsp + 0x40]
mov qword [rsp + 0x28], rcx
mov dword [rsp + 0x20], ebx
lea r9, str._t_t_tCopyFile
lea r8, str.ApiName:__s__ErrorCode:__d_:__s
mov edx, 6
lea rcx, [rsp + 0x48]
call fcn.140007780
mov rcx, qword [rsp + 0x40]
test rcx, rcx
je 0x140051c8f
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov edx, 0x20
lea rcx, [rbp + 0x760]
call qword [sym.imp.KERNEL32.dll_SetFileAttributesW]
xor r9d, r9d
lea r8, str.return__08x
lea edx, [r9 + 2]
lea rcx, [rsp + 0x48]
call fcn.140007780
nop
lea rcx, [rsp + 0x48]
call fcn.140007730
xor eax, eax
mov rcx, qword [rbp + 0x1f60]
xor rcx, rsp
call fcn.140245660
lea r11, [rsp + 0x2070]
mov rbx, qword [r11 + 0x10]
mov rsi, qword [r11 + 0x18]
mov rdi, qword [r11 + 0x20]
mov rsp, r11
pop rbp
ret