Function at 0x4239f0
Capabilities:
Check if file exists
Copy file
Get file attributes
Set file attributes

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x31c
push ebx
push esi
push edi
mov ebx, eax
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x423a04
sub eax, edx
mov esi, eax
cmp esi, 1
mov dword [esp + 0x10], esi
jl 0x423c47
mov al, byte [esi + ebx - 1]
cmp al, 0x5c
lea ecx, [esi + ebx - 1]
mov dword [esp + 0x14], ecx
je 0x423c47
cmp al, 0x2f
je 0x423c47
mov eax, dword [ebp + 0x10]
cmp eax, 1
je 0x423aab
cmp eax, 2
je 0x423a4e
cmp eax, 3
jne 0x423b6c
push 0x4698e4
push ebx
call fcn.00459902
mov esi, eax
add esp, 8
test esi, esi
je 0x423a7f
push 2
push 0
push esi
call fcn.0045985d
push esi
call fcn.0045978d
push esi
mov edi, eax
call fcn.00459521
add esp, 0x14
jmp 0x423a81
xor edi, edi
mov eax, dword [ebp + 0x10]
cmp eax, 2
jne 0x423a92
test edi, edi
jne 0x423aa3
jmp 0x423b6c
cmp eax, 3
jne 0x423aa3
cmp edi, 0x44c
jl 0x423b6c
mov esi, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
cmp esi, 4
jl 0x423ab5
mov esi, 4
mov edx, 1
cmp esi, edx
jl 0x423acb
mov eax, ecx
cmp byte [eax], 0x2e
je 0x423acb
inc edx
dec eax
cmp edx, esi
jle 0x423ac0
xor eax, eax
cmp edx, esi
mov ecx, 0x41
lea edi, [esp + 0x18]
rep stosd dword es:[edi], eax
stosb byte es:[edi], al
jg 0x423af6
mov eax, dword [esp + 0x10]
sub eax, edx
je 0x423af6
push eax
lea eax, [esp + 0x1c]
push ebx
push eax
call fcn.00458f80
add esp, 0xc
jmp 0x423b0a
lea edx, [esp + 0x18]
mov eax, ebx
sub edx, ebx
mov edi, edi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x423b00
lea edi, [esp + 0x18]
dec edi
nop
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x423b10
mov ecx, dword [str..bak]
mov esi, dword [ebp + 0x14]
mov dl, byte [0x474d30]
push esi
mov dword [edi], ecx
lea eax, [esp + 0x1c]
push eax
mov byte [edi + 4], dl
mov edi, dword [sym.imp.KERNEL32.dll_CopyFileA]
push ebx
call edi
test eax, eax
jne 0x423b6c
lea ecx, [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x423b6c
test al, 1
je 0x423b6c
push 0x80
lea edx, [esp + 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push esi
lea eax, [esp + 0x1c]
push eax
push ebx
call edi
push 0x469850
push ebx
call fcn.00459902
mov esi, eax
add esp, 8
test esi, esi
jne 0x423be5
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x423bb0
test al, 1
je 0x423bb0
push 0x80
push ebx
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push 0x469850
push ebx
call fcn.00459902
mov esi, eax
add esp, 8
test esi, esi
jne 0x423be5
push ebx
lea ecx, [esp + 0x128]
push str.ERROR:_Failed_to_open_the_file__s_for_writing_in_updateFile_n
push ecx
call fcn.00458ee7
lea edx, [esp + 0x12c]
push edx
mov dword [esp + 0x130], 1
call fcn.0043e010
add esp, 0x10
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
push esi
push eax
mov edi, 1
push edi
push ecx
call fcn.004592e3
push esi
call fcn.00459521
mov eax, dword [ebp + 0x18]
add esp, 0x14
cmp eax, edi
jne 0x423c1d
push 0x4012
call fcn.004236a0
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
lea edx, [esp + 0x128]
push str._s_has_been_overwritten_with_the_master_copy_stored_at_the_Kaseya_server_n
push edx
call fcn.00458ee7
lea eax, [esp + 0x12c]
push eax
mov dword [esp + 0x130], edi
call fcn.0043e010
add esp, 0x10
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret