Function at 0x40a0e0
Capabilities:
Write file on windows

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
sub rsp, 0x90
mov qword [rsp + 0x50], 0xfffffffffffffffe
mov qword [rsp + 0xd8], rbx
mov rax, qword [0x0043e2a8]
xor rax, rsp
mov qword [rsp + 0x80], rax
mov r12, r8
mov r13, rdx
mov rdi, rcx
xor esi, esi
mov rax, qword [r8]
mov rcx, r8
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
test al, al
je 0x40a2d7
mov rcx, r12
call fcn.00402720
mov r11d, eax
add r11, qword [rdi + 0x50]
cmp qword [rdi + 0x60], r11
jae 0x40a1be
mov rcx, r12
call fcn.00402720
mov ebx, eax
add rbx, qword [rdi + 0x50]
mov r8d, ebx
sub r8d, dword [rdi + 0x60]
je 0x40a1ba
mov qword [rsp + 0x20], rsi
lea r9, [rsp + 0x48]
mov rdx, qword [rdi + 0x60]
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40a1ba
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test eax, eax
jle 0x40a18a
movzx ebx, ax
or ebx, 0x80070000
cmp qword [rdi + 0x40], 8
jb 0x40a197
mov r8, qword [rdi + 0x28]
jmp 0x40a19b
lea r8, [rdi + 0x28]
mov r9d, ebx
lea rdx, str.Writing__flushing__config_file__s_failed._Error_code:_0x_x_r_n
mov ecx, 2
call fcn.00415890
test ebx, ebx
jns 0x40a1be
mov eax, ebx
jmp 0x40a377
mov qword [rdi + 0x60], rbx
mov rcx, r12
call fcn.00402730
mov rcx, rax
lea rdx, [rsp + 0x58]
call fcn.004183a0
nop
lea rcx, [rsp + 0x38]
call fcn.0040eb00
nop
lea r8, [rsp + 0x38]
lea rdx, [rsp + 0x58]
mov rcx, rdi
call fcn.00409dd0
mov esi, eax
test eax, eax
jns 0x40a21b
lea rcx, [rsp + 0x38]
call fcn.0040eb10
nop
cmp qword [rsp + 0x78], 8
jb 0x40a214
mov rcx, qword [rsp + 0x60]
call fcn.0041a9c0
mov eax, esi
jmp 0x40a377
lea rcx, [rsp + 0x38]
call fcn.0040ec20
mov ebx, eax
lea rcx, [rsp + 0x38]
call fcn.0040cfb0
mov rdx, rax
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0x30]
mov r8d, ebx
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40a2b1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test eax, eax
jle 0x40a267
movzx ebx, ax
or ebx, 0x80070000
cmp qword [rdi + 0x40], 8
jb 0x40a274
mov r8, qword [rdi + 0x28]
jmp 0x40a278
lea r8, [rdi + 0x28]
mov r9d, ebx
lea rdx, str.Writing_config_file__s_failed._Error_code:_0x_x_r_n
mov ecx, 2
call fcn.00415890
nop
lea rcx, [rsp + 0x38]
call fcn.0040eb10
nop
cmp qword [rsp + 0x78], 8
jb 0x40a2aa
mov rcx, qword [rsp + 0x60]
call fcn.0041a9c0
mov eax, ebx
jmp 0x40a377
lea rcx, [rsp + 0x38]
call fcn.0040eb10
nop
cmp qword [rsp + 0x78], 8
jb 0x40a375
mov rcx, qword [rsp + 0x60]
call fcn.0041a9c0
jmp 0x40a375
mov rcx, r12
call fcn.00402730
mov rcx, rax
call fcn.00417170
mov ebp, eax
mov eax, dword [rdi + 0x18]
add rbp, rax
add rbp, qword [rdi + 0x50]
cmp qword [rdi + 0x60], rbp
jae 0x40a375
mov rcx, r12
call fcn.00402720
mov ebx, eax
add rbx, qword [rdi + 0x50]
mov r8d, ebx
sub r8d, dword [rdi + 0x60]
je 0x40a36d
mov qword [rsp + 0x20], rsi
lea r9, [rsp + 0x30]
mov rdx, qword [rdi + 0x60]
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40a36d
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test eax, eax
jle 0x40a340
movzx esi, ax
or esi, 0x80070000
cmp qword [rdi + 0x40], 8
jb 0x40a34d
mov r8, qword [rdi + 0x28]
jmp 0x40a351
lea r8, [rdi + 0x28]
mov r9d, esi
lea rdx, str.Writing__flushing__config_file__s_failed._Error_code:_0x_x_r_n
mov ecx, 2
call fcn.00415890
test esi, esi
jns 0x40a371
mov eax, esi
jmp 0x40a377
mov qword [rdi + 0x60], rbx
mov qword [rdi + 0x60], rbp
mov eax, esi
mov rcx, qword [rsp + 0x80]
xor rcx, rsp
call fcn.0041b280
mov rbx, qword [rsp + 0xd8]
add rsp, 0x90
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret