Function at 0x140019914
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
push rsi
push rdi
push r12
push r13
push r14
sub rsp, 0x40
mov rdi, rcx
mov rcx, qword [rcx]
xor r14d, r14d
mov r12d, 1
test rcx, rcx
je 0x140019953
cmp dword [rdi + 0x10], r14d
je 0x140019999
cmp dword [rdi + 0x14], r14d
je 0x140019953
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [rdi], r14
cmp dword [rdi + 0x10], r14d
je 0x140019999
cmp qword [rdi], r14
jne 0x1400199a2
mov rcx, qword [rdi + 8]
test rcx, rcx
je 0x140019999
mov qword [rsp + 0x30], r14
xor r9d, r9d
mov edx, 0xc0000000
mov r8d, r12d
mov dword [rsp + 0x28], pe_nt_image_headers64
mov dword [rsp + 0x20], 2
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov qword [rdi], rax
cmp rax, 0xffffffffffffffff
jne 0x140019999
mov qword [rdi], r14
cmp qword [rdi], r14
je 0x140019be6
cmp dword [rdi + 0x10], r14d
je 0x140019bb2
test byte [rdi + 0x50], r12b
mov rbp, qword [rdi + 0x30]
lea rax, [0x1400240a8]
lea r13, [0x1400240a4]
mov esi, r14d
cmove r13, rax
cmp dword [rdi + 0x28], 0xfde9
mov eax, 5
cmove esi, eax
jmp 0x140019a2e
mov rcx, qword [rbp + 0x18]
cmp qword [rbp + 0x10], r12
jne 0x140019a03
call sub.msvcrt.dll_strlen
test byte [rdi + 0x50], 2
lea esi, [rsi + rax + 4]
je 0x140019a2a
lea rcx, [0x1400240a0]
call sub.msvcrt.dll_strlen
add esi, eax
jmp 0x140019a2a
cmp qword [rbp + 0x10], 2
jne 0x140019a15
call sub.msvcrt.dll_strlen
lea esi, [rsi + rax + 4]
jmp 0x140019a2a
call sub.msvcrt.dll_strlen
mov rcx, qword [rbp + 0x10]
lea ebx, [rsi + rax]
call sub.msvcrt.dll_strlen
lea esi, [rbx + rax + 5]
mov rbp, qword [rbp]
test rbp, rbp
jne 0x1400199da
xor edx, edx
test esi, esi
jne 0x140019a56
mov rcx, qword [rdi]
xor r9d, r9d
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov rcx, qword [rdi]
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
jmp 0x140019bb2
mov rcx, qword [0x14002a940]
lea eax, [rsi + 1]
movsxd r8, eax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rbp, rax
test rax, rax
je 0x140019bb2
cmp dword [rdi + 0x28], 0xfde9
mov rbx, rax
jne 0x140019aab
lea rdx, [0x14002409c]
mov rcx, rax
call sub.msvcrt.dll_strcpy
lea rdx, [0x1400240a0]
mov rcx, rbx
call sub.msvcrt.dll_strcat
mov rcx, rbx
call sub.msvcrt.dll_strlen
lea rbx, [rbx + rax]
mov rsi, qword [rdi + 0x30]
jmp 0x140019b62
mov rdx, qword [rsi + 0x10]
cmp rdx, 1
jne 0x140019b12
test byte [rdi + 0x50], 2
je 0x140019ae3
test r12d, r12d
jne 0x140019ae3
lea rdx, [0x1400240a0]
mov rcx, rbx
call sub.msvcrt.dll_strcpy
mov rcx, rbx
call sub.msvcrt.dll_strlen
add rbx, rax
lea rdx, [0x140024098]
mov rcx, rbx
call sub.msvcrt.dll_strcpy
mov rdx, qword [rsi + 0x18]
mov rcx, rbx
call sub.msvcrt.dll_strcat
lea rdx, [0x140024094]
mov rcx, rbx
call sub.msvcrt.dll_strcat
mov r12d, r14d
jmp 0x140019b45
mov rcx, rbx
cmp rdx, 2
jne 0x140019b29
lea rdx, [0x140024090]
call sub.msvcrt.dll_strcpy
jmp 0x140019b39
call sub.msvcrt.dll_strcpy
mov rdx, r13
mov rcx, rbx
call sub.msvcrt.dll_strcat
mov rdx, qword [rsi + 0x18]
mov rcx, rbx
call sub.msvcrt.dll_strcat
lea rdx, [0x1400240a0]
mov rcx, rbx
call sub.msvcrt.dll_strcat
mov rcx, rbx
call sub.msvcrt.dll_strlen
mov rsi, qword [rsi]
add rbx, rax
test rsi, rsi
jne 0x140019ab4
mov rcx, qword [rdi]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov rcx, qword [rdi]
sub ebx, ebp
lea r9, [rsp + 0x70]
mov r8d, ebx
mov rdx, rbp
mov qword [rsp + 0x20], r14
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, qword [rdi]
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov rcx, qword [0x14002a940]
mov r8, rbp
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov r8, qword [rdi + 0x18]
test r8, r8
je 0x140019bca
mov rcx, qword [0x14002a940]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [rdi]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140019be6
mov rdx, qword [rdi + 0x30]
lea rcx, [rdi + 0x30]
add rdx, 0x10
call fcn.14001f8c8
cmp qword [rdi + 0x30], r14
jne 0x140019bd5
mov r8, qword [rdi + 0x48]
test r8, r8
je 0x140019c04
mov rcx, qword [0x14002a940]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov r8, qword [rdi + 8]
test r8, r8
je 0x140019c1c
mov rcx, qword [0x14002a940]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
xor edx, edx
mov rcx, rdi
lea r8d, [rdx + 0x58]
call sub.msvcrt.dll_memset
lea r11, [rsp + 0x40]
mov rbx, qword [r11 + 0x38]
mov rbp, qword [r11 + 0x40]
mov rsp, r11
pop r14
pop r13
pop r12
pop rdi
pop rsi
ret
lea rcx, [0x14002af30]
jmp 0x140019914