Function at 0x406d00
Capabilities:
Check if file exists
Create directory
Move file

Disassembly:
push ebp
lea ebp, [esp - 0xac]
sub esp, 0xac
push 0xffffffffffffffff
push 0x4e671b
mov eax, dword fs:[0]
push eax
sub esp, 0x18
mov eax, dword [0x50b0b0]
xor eax, ebp
mov dword [ebp + 0xa8], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
xor eax, eax
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 7
mov word [ebp - 0x24], ax
mov dword [ebp - 4], eax
mov dword [ebp + 0x28], eax
mov dword [ebp + 0x2c], 7
mov word [ebp + 0x18], ax
lea eax, [ebp - 0x24]
mov byte [ebp - 4], 1
push eax
call fcn.004063a0
add esp, 4
test eax, eax
js 0x4070b4
lea eax, [ebp + 0x18]
push eax
call fcn.004062b0
add esp, 4
test eax, eax
js 0x40707e
push str.SynologyActiveBackupAgent
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp + 0x90]
push eax
call fcn.00401a40
push str.ActiveBackupforBusinessAgent
lea eax, [ebp + 0x18]
mov byte [ebp - 4], 2
push eax
lea eax, [ebp + 0x60]
push eax
call fcn.00401a40
add esp, 0x18
push 0x16
xor eax, eax
mov byte [ebp - 4], 3
push str._servicelog_db.sqlite
lea ecx, [ebp + 0x30]
mov dword [ebp + 0x40], 0
mov dword [ebp + 0x44], 7
mov word [ebp + 0x30], ax
call fcn.0040b650
push 0x19
xor eax, eax
mov byte [ebp - 4], 4
push str._service_system_db.sqlite
lea ecx, [ebp + 0x48]
mov dword [ebp + 0x58], 0
mov dword [ebp + 0x5c], 7
mov word [ebp + 0x48], ax
call fcn.0040b650
cmp dword [ebp + 0xa4], 8
lea eax, [ebp + 0x90]
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmovae eax, dword [ebp + 0x90]
push eax
mov byte [ebp - 4], 5
call edi
test eax, eax
je 0x406ff7
cmp dword [ebp + 0x74], 8
lea eax, [ebp + 0x60]
cmovae eax, dword [ebp + 0x60]
push eax
call edi
test eax, eax
jne 0x406e5e
cmp dword [ebp + 0x74], 8
lea eax, [ebp + 0x60]
push 0
cmovae eax, dword [ebp + 0x60]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
test eax, eax
jne 0x406ff7
lea eax, [ebp + 0x30]
push eax
lea eax, [ebp + 0x90]
push eax
lea eax, [ebp + 0x78]
push eax
call fcn.00401990
add esp, 0xc
cmp dword [eax + 0x14], 8
jb 0x406e7d
mov eax, dword [eax]
push eax
call edi
lea ecx, [ebp + 0x78]
mov esi, eax
call fcn.00403870
test esi, esi
je 0x406ee9
push str.log_db.sqlite
lea eax, [ebp + 0x60]
push eax
lea eax, [ebp]
push eax
call fcn.00401a40
mov esi, eax
lea eax, [ebp + 0x30]
mov byte [ebp - 4], 6
push eax
lea eax, [ebp + 0x90]
push eax
lea eax, [ebp + 0x78]
push eax
call fcn.00401990
add esp, 0x18
cmp dword [esi + 0x14], 8
jb 0x406ec5
mov esi, dword [esi]
cmp dword [eax + 0x14], 8
jb 0x406ecd
mov eax, dword [eax]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileW]
lea ecx, [ebp + 0x78]
call fcn.00403870
lea ecx, [ebp]
mov byte [ebp - 4], 5
call fcn.00403870
lea eax, [ebp + 0x48]
push eax
lea eax, [ebp + 0x90]
push eax
lea eax, [ebp]
push eax
call fcn.00401990
add esp, 0xc
cmp dword [eax + 0x14], 8
jb 0x406f08
mov eax, dword [eax]
push eax
call edi
lea ecx, [ebp]
mov esi, eax
call fcn.00403870
test esi, esi
je 0x406f74
push str._system_db.sqlite
lea eax, [ebp + 0x60]
push eax
lea eax, [ebp + 0x78]
push eax
call fcn.00401a40
mov esi, eax
lea eax, [ebp + 0x48]
mov byte [ebp - 4], 7
push eax
lea eax, [ebp + 0x90]
push eax
lea eax, [ebp]
push eax
call fcn.00401990
add esp, 0x18
cmp dword [esi + 0x14], 8
jb 0x406f50
mov esi, dword [esi]
cmp dword [eax + 0x14], 8
jb 0x406f58
mov eax, dword [eax]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileW]
lea ecx, [ebp]
call fcn.00403870
lea ecx, [ebp + 0x78]
mov byte [ebp - 4], 5
call fcn.00403870
cmp dword [ebp + 0xa4], 8
lea eax, [ebp + 0x90]
lea ecx, [ebp + 0x78]
cmovae eax, dword [ebp + 0x90]
push eax
call fcn.00402af0
lea eax, [ebp + 0x78]
mov byte [ebp - 4], 8
push eax
call fcn.004078b0
add esp, 4
mov byte [ebp - 4], 5
lea ecx, [ebp + 0x78]
call fcn.00403870
push str.ActiveBackupAgent
lea eax, [ebp + 0x18]
push eax
lea eax, [ebp]
push eax
call fcn.00401a40
add esp, 0xc
cmp dword [eax + 0x14], 8
mov byte [ebp - 4], 9
jb 0x406fce
mov eax, dword [eax]
push eax
lea ecx, [ebp + 0x78]
call fcn.00402af0
lea eax, [ebp + 0x78]
mov byte [ebp - 4], 0xa
push eax
call fcn.004078b0
add esp, 4
lea ecx, [ebp + 0x78]
call fcn.00403870
lea ecx, [ebp]
call fcn.00403870
mov edx, dword [ebp + 0x5c]
cmp edx, 8
jb 0x407031
mov ecx, dword [ebp + 0x48]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x407027
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40710c
push edx
push ecx
call fcn.004bf27b
add esp, 8
mov edx, dword [ebp + 0x44]
cmp edx, 8
jb 0x40706b
mov ecx, dword [ebp + 0x30]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x407061
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40710c
push edx
push ecx
call fcn.004bf27b
add esp, 8
lea ecx, [ebp + 0x60]
call fcn.00403870
lea ecx, [ebp + 0x90]
call fcn.00403870
mov edx, dword [ebp + 0x2c]
cmp edx, 8
jb 0x4070b4
mov ecx, dword [ebp + 0x18]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4070aa
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40710c
push edx
push ecx
call fcn.004bf27b
add esp, 8
mov edx, dword [ebp - 0x10]
cmp edx, 8
jb 0x4070ea
mov ecx, dword [ebp - 0x24]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4070e0
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40710c
push edx
push ecx
call fcn.004bf27b
add esp, 8
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp + 0xa8]
xor ecx, ebp
call fcn.004bf6e8
lea esp, [ebp + 0xac]
pop ebp
ret
call fcn.004c4b9a
int3