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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4e59c6
mov eax, dword fs:[0]
push eax
sub esp, 0xf8
mov eax, dword [0x50a0b0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
xor ebx, ebx
xor eax, eax
mov dword [ebp - 0x100], ebx
mov dword [ebp - 0xd4], ebx
mov dword [ebp - 0xd0], 7
mov word [ebp - 0xe4], ax
mov dword [ebp - 4], eax
lea eax, [ebp - 0xe4]
push eax
call fcn.00406380
add esp, 4
test eax, eax
jns 0x40667a
push str.Failed_to_get_program_data_n
call fcn.00406300
add esp, 4
or esi, 0xffffffff
jmp 0x406d8e
push str.ActiveBackupforBusinessAgent
lea eax, [ebp - 0xe4]
push eax
lea eax, [ebp - 0xfc]
push eax
call fcn.00401a50
push str.log
lea eax, [ebp - 0xfc]
mov byte [ebp - 4], 1
push eax
lea eax, [ebp - 0xcc]
push eax
call fcn.00401a50
add esp, 0x18
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea eax, [ebp - 0xcc]
or edi, 0xffffffff
mov byte [ebp - 4], 2
cmp dword [ebp - 0xb8], 8
cmovae eax, dword [ebp - 0xcc]
push eax
call esi
test eax, eax
jne 0x406710
cmp dword [ebp - 0xb8], 8
lea eax, [ebp - 0xcc]
push 0
cmovae eax, dword [ebp - 0xcc]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
test eax, eax
je 0x406710
push str.Failed_to_create_log_folder_n
call fcn.00406300
add esp, 4
or esi, edi
jmp 0x406d78
push str.ui.log
lea eax, [ebp - 0xfc]
push eax
lea eax, [ebp - 0x84]
push eax
call fcn.00401a50
add esp, 0xc
cmp dword [eax + 0x14], 8
jb 0x406733
mov eax, dword [eax]
push eax
call esi
lea ecx, [ebp - 0x84]
mov esi, eax
call fcn.00403880
test esi, esi
je 0x4067b2
push str.ui.log
lea eax, [ebp - 0xcc]
push eax
lea eax, [ebp - 0xb4]
push eax
call fcn.00401a50
mov esi, eax
push str.ui.log
lea eax, [ebp - 0xfc]
mov byte [ebp - 4], 3
push eax
lea eax, [ebp - 0x84]
push eax
call fcn.00401a50
add esp, 0x18
cmp dword [esi + 0x14], 8
jb 0x406788
mov esi, dword [esi]
cmp dword [eax + 0x14], 8
jb 0x406790
mov eax, dword [eax]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileW]
lea ecx, [ebp - 0x84]
call fcn.00403880
lea ecx, [ebp - 0xb4]
mov byte [ebp - 4], 2
call fcn.00403880
mov esi, 0x2d
cmp edi, 0xffffffff
jne 0x4067f3
push 7
xor eax, eax
mov dword [ebp - 0x74], 0
push str.log.txt
lea ecx, [ebp - 0x84]
mov dword [ebp - 0x70], 7
mov word [ebp - 0x84], ax
call fcn.0040b6e0
lea ecx, [ebp - 0x84]
or ebx, 1
jmp 0x4068bd
test edi, edi
jns 0x40680e
mov eax, edi
neg eax
push eax
lea eax, [ebp - 0x12]
push eax
call fcn.004021e0
mov word [eax - 2], si
lea ecx, [eax - 2]
jmp 0x40681a
lea eax, [ebp - 0x12]
push edi
push eax
call fcn.004021e0
mov ecx, eax
xor eax, eax
mov dword [ebp - 0x5c], 0
mov word [ebp - 0x6c], ax
add esp, 8
lea eax, [ebp - 0x12]
mov dword [ebp - 0x58], 7
cmp ecx, eax
je 0x406846
sub eax, ecx
sar eax, 1
push eax
push ecx
lea ecx, [ebp - 0x6c]
call fcn.0040b6e0
or ebx, 0x18
push 8
push str.log.txt_
or ebx, 2
mov dword [ebp - 4], 5
push 0
lea ecx, [ebp - 0x6c]
mov dword [ebp - 0x100], ebx
call fcn.0040cc30
mov ecx, eax
mov eax, dword [ecx]
mov dword [ebp - 0xb4], eax
mov eax, dword [ecx + 4]
mov dword [ebp - 0xb0], eax
mov eax, dword [ecx + 8]
mov dword [ebp - 0xac], eax
mov eax, dword [ecx + 0xc]
mov dword [ebp - 0xa8], eax
mov eax, dword [ecx + 0x10]
mov dword [ebp - 0xa4], eax
mov eax, dword [ecx + 0x14]
mov dword [ebp - 0xa0], eax
xor eax, eax
mov dword [ecx + 0x10], 0
or ebx, 0x24
mov dword [ecx + 0x14], 7
mov word [ecx], ax
lea ecx, [ebp - 0xb4]
mov eax, dword [ecx + 4]
mov esi, dword [ecx]
mov dword [ebp - 0x98], eax
mov eax, dword [ecx + 8]
mov dword [ebp - 0x94], eax
mov eax, dword [ecx + 0xc]
mov dword [ebp - 0x90], eax
mov eax, dword [ecx + 0x10]
mov dword [ebp - 0x104], eax
mov dword [ebp - 0x8c], eax
mov eax, dword [ecx + 0x14]
mov dword [ebp - 0x100], eax
mov dword [ebp - 0x88], eax
xor eax, eax
mov dword [ebp - 0x9c], esi
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 7
mov word [ecx], ax
mov dword [ebp - 4], 6
test bl, 4
je 0x406960
mov edx, dword [ebp - 0xa0]
and ebx, 0xfffffffb
cmp edx, 8
jb 0x406960
mov ecx, dword [ebp - 0xb4]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x406956
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406de8
push edx
push ecx
call fcn.004bf4bc
add esp, 8
mov byte [ebp - 4], 7
test bl, 2
je 0x4069ba
mov edx, dword [ebp - 0x58]
and ebx, 0xfffffffd
cmp edx, 8
jb 0x4069a6
mov ecx, dword [ebp - 0x6c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40699c
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406de8
push edx
push ecx
call fcn.004bf4bc
add esp, 8
xor eax, eax
mov dword [ebp - 0x5c], 0
mov dword [ebp - 0x58], 7
mov word [ebp - 0x6c], ax
mov byte [ebp - 4], 8
test bl, 1
je 0x406a03
mov edx, dword [ebp - 0x70]
and ebx, 0xfffffffe
cmp edx, 8
jb 0x406a03
mov ecx, dword [ebp - 0x84]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4069f9
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406de8
push edx
push ecx
call fcn.004bf4bc
add esp, 8
push 0x4e97dc
lea eax, [ebp - 0xfc]
push eax
lea eax, [ebp - 0x84]
push eax
call fcn.00401a50
add esp, 0xc
mov ecx, eax
cmp dword [ebp - 0x100], 8
lea eax, [ebp - 0x9c]
push dword [ebp - 0x104]
cmovae eax, esi
mov byte [ebp - 4], 9
push eax
call fcn.0040b480
mov ecx, eax
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 0
or ebx, 0x40
mov eax, dword [ecx]
mov dword [ebp - 0x54], eax
mov eax, dword [ecx + 4]
mov dword [ebp - 0x50], eax
mov eax, dword [ecx + 8]
mov dword [ebp - 0x4c], eax
mov eax, dword [ecx + 0xc]
mov dword [ebp - 0x48], eax
mov eax, dword [ecx + 0x10]
mov dword [ebp - 0x44], eax
mov eax, dword [ecx + 0x14]
mov dword [ebp - 0x40], eax
xor eax, eax
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 7
mov word [ecx], ax
mov edx, dword [ebp - 0x70]
mov byte [ebp - 4], 0xb
cmp edx, 8
jb 0x406aca
mov ecx, dword [ebp - 0x84]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x406ac0
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406de8
push edx
push ecx
call fcn.004bf4bc
add esp, 8
xor eax, eax
mov dword [ebp - 0x74], 0
cmp dword [ebp - 0x40], 8
mov word [ebp - 0x84], ax
lea eax, [ebp - 0x54]
cmovae eax, dword [ebp - 0x54]
push eax
mov dword [ebp - 0x70], 7
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x406cd3
push 0x4e97dc
lea eax, [ebp - 0xcc]
push eax
lea eax, [ebp - 0xb4]
push eax
call fcn.00401a50
add esp, 0xc
mov ecx, eax
cmp dword [ebp - 0x88], 8
lea eax, [ebp - 0x9c]
push dword [ebp - 0x8c]
cmovae eax, dword [ebp - 0x9c]
push eax
mov byte [ebp - 4], 0xc
call fcn.0040b480
mov ecx, eax
or ebx, 0x80
mov dword [ebp - 0x100], ebx
mov eax, dword [ecx]
mov dword [ebp - 0x6c], eax
mov eax, dword [ecx + 4]
mov dword [ebp - 0x68], eax
mov eax, dword [ecx + 8]
mov dword [ebp - 0x64], eax
mov eax, dword [ecx + 0xc]
mov dword [ebp - 0x60], eax
mov eax, dword [ecx + 0x10]
mov dword [ebp - 0x5c], eax
mov eax, dword [ecx + 0x14]
mov dword [ebp - 0x58], eax
xor eax, eax
mov word [ecx], ax
lea eax, [ebp - 0x54]
mov dword [ecx + 0x10], 0
mov dword [ecx + 0x14], 7
lea ecx, [ebp - 0x6c]
cmp dword [ebp - 0x58], 8
cmovae ecx, dword [ebp - 0x6c]
cmp dword [ebp - 0x40], 8
push ecx
cmovae eax, dword [ebp - 0x54]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileW]
mov edx, dword [ebp - 0x58]
cmp edx, 8
jb 0x406bd8
mov ecx, dword [ebp - 0x6c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x406bce
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406de8
push edx
push ecx
call fcn.004bf4bc
add esp, 8
mov edx, dword [ebp - 0xa0]
xor eax, eax
mov dword [ebp - 0x5c], 0
mov dword [ebp - 0x58], 7
mov word [ebp - 0x6c], ax
mov byte [ebp - 4], 0xb
cmp edx, 8
jb 0x406c30
mov ecx, dword [ebp - 0xb4]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x406c26
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406de8
push edx
push ecx
call fcn.004bf4bc
add esp, 8
mov edx, dword [ebp - 0x40]
inc edi
mov byte [ebp - 4], 8
cmp edx, 8
jb 0x406c6f
mov ecx, dword [ebp - 0x54]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x406c65
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406de8
push edx
push ecx
call fcn.004bf4bc
add esp, 8
mov edx, dword [ebp - 0x88]
xor eax, eax
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 7
mov word [ebp - 0x54], ax
mov byte [ebp - 4], 2
lea esi, [eax + 0x2d]
cmp edx, 8
jb 0x4067b7
mov ecx, dword [ebp - 0x9c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x406cc4
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406de8
push edx
push ecx
call fcn.004bf4bc
add esp, 8
jmp 0x4067b7
cmp dword [ebp - 0x40], 8
lea eax, [ebp - 0x54]
cmovae eax, dword [ebp - 0x54]
push eax
push str._s_does_not_exists_n
call fcn.00406300
mov edx, dword [ebp - 0x40]
add esp, 8
cmp edx, 8
jb 0x406d26
mov ecx, dword [ebp - 0x54]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x406d1c
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406de8
push edx
push ecx
call fcn.004bf4bc
add esp, 8
mov edx, dword [ebp - 0x88]
xor eax, eax
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x40], 7
mov word [ebp - 0x54], ax
cmp edx, 8
jb 0x406d76
mov ecx, dword [ebp - 0x9c]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x406d6c
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406de8
push edx
push ecx
call fcn.004bf4bc
add esp, 8
xor esi, esi
lea ecx, [ebp - 0xcc]
call fcn.00403880
lea ecx, [ebp - 0xfc]
call fcn.00403880
mov edx, dword [ebp - 0xd0]
cmp edx, 8
jb 0x406dca
mov ecx, dword [ebp - 0xe4]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x406dc0
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406ded
push edx
push ecx
call fcn.004bf4bc
add esp, 8
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004bf929
mov esp, ebp
pop ebp
ret
call fcn.004c4cda
call fcn.004c4cda
int3