Function at 0x140013040
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
push rsi
push rdi
push r12
push r14
push r15
sub rsp, 0x20
mov rdi, qword [0x1400cd1d8]
mov rax, qword [rdi + 0x38]
test rax, rax
je 0x14001309c
cmp byte [rdi + 1], 0
je 0x14001309c
mov byte [rax + 0x18], 0
mov rbx, qword [rdi + 0x38]
test rbx, rbx
je 0x14001309c
mov rcx, rbx
call fcn.140035e00
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x140013093
dec dword [rax + 0xec]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
xor r12d, r12d
mov qword [rdi + 0x38], r12
mov rcx, qword [rdi + 0x3c70]
test rcx, rcx
je 0x1400130d5
mov qword [rdi + 0x3c68], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400130c8
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x3c70], r12
cmp byte [rdi], r12b
je 0x140013941
cmp byte [rdi + 0x5c29], r12b
je 0x140013146
mov rbx, qword [rdi + 0x20]
test rbx, rbx
je 0x140013146
mov rax, qword [0x1400cd1d8]
mov dword [rax + 0x5c2c], r12d
mov qword [rsp + 0x50], r12
lea rcx, [rsp + 0x50]
call fcn.1400265c0
mov rsi, rax
lea rdx, [0x1400c43d4]
mov rcx, rbx
call fcn.140010a70
mov rbx, rax
test rax, rax
je 0x140013146
mov r9, rax
mov r8, qword [rsp + 0x50]
mov edx, 1
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov ebx, r12d
cmp dword [rdi + 0x5c70], r12d
jle 0x140013190
mov rsi, r12
nop word [rax + rax]
mov rcx, qword [rdi + 0x5c78]
cmp dword [rsi + rcx + 4], 6
jne 0x140013182
mov rax, qword [rsi + rcx + 0x10]
movsxd rdx, ebx
shl rdx, 5
add rdx, rcx
mov rcx, rdi
call rax
inc ebx
add rsi, 0x20
cmp ebx, dword [rdi + 0x5c70]
jl 0x140013160
mov esi, r12d
cmp dword [rdi + 0x3ea8], r12d
jle 0x1400131e1
mov r14, r12
nop
mov rax, qword [rdi + 0x3eb0]
mov rbx, qword [r14 + rax]
test rbx, rbx
je 0x1400131d3
mov rcx, rbx
call fcn.140013e60
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400131ca
dec dword [rax + 0xec]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
inc esi
add r14, 8
cmp esi, dword [rdi + 0x3ea8]
jl 0x1400131a0
mov rcx, qword [rdi + 0x3eb0]
test rcx, rcx
je 0x140013213
mov qword [rdi + 0x3ea8], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x140013206
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x3eb0], r12
mov rcx, qword [rdi + 0x3ec0]
test rcx, rcx
je 0x140013245
mov qword [rdi + 0x3eb8], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x140013238
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x3ec0], r12
mov rcx, qword [rdi + 0x3ed0]
test rcx, rcx
je 0x140013277
mov qword [rdi + 0x3ec8], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x14001326a
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x3ed0], r12
mov qword [rdi + 0x3f08], r12
mov rcx, qword [rdi + 0x3ee0]
test rcx, rcx
je 0x1400132b0
mov qword [rdi + 0x3ed8], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400132a3
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x3ee0], r12
mov rcx, qword [rdi + 0x3ef0]
test rcx, rcx
je 0x1400132e2
mov qword [rdi + 0x3ee8], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400132d5
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x3ef0], r12
mov qword [rdi + 0x48f0], r12
mov qword [rdi + 0x3f18], r12
mov qword [rdi + 0x3f10], r12
mov qword [rdi + 0x3fa0], r12
mov qword [rdi + 0x3f88], r12
mov qword [rdi + 0x3f20], r12
lea rcx, [rdi + 0x4640]
call fcn.14000f0c0
mov rcx, qword [rdi + 0x4860]
test rcx, rcx
je 0x14001334a
mov qword [rdi + 0x4858], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x14001333d
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4860], r12
mov rcx, qword [rdi + 0x4870]
test rcx, rcx
je 0x14001337c
mov qword [rdi + 0x4868], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x14001336f
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4870], r12
mov rcx, qword [rdi + 0x4880]
test rcx, rcx
je 0x1400133ae
mov qword [rdi + 0x4878], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400133a1
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4880], r12
mov rcx, qword [rdi + 0x48c0]
test rcx, rcx
je 0x1400133e0
mov qword [rdi + 0x48b8], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400133d3
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x48c0], r12
mov rcx, qword [rdi + 0x48d0]
test rcx, rcx
je 0x140013412
mov qword [rdi + 0x48c8], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x140013405
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x48d0], r12
mov ebp, r12d
cmp dword [rdi + 0x48e0], r12d
jle 0x1400134e6
mov r14, r12
nop word [rax + rax]
mov rax, qword [rdi + 0x48e8]
mov rbx, qword [r14 + rax]
test rbx, rbx
je 0x1400134d4
mov rsi, qword [rbx + 0x38]
test rsi, rsi
je 0x140013470
mov rcx, rsi
call fcn.14000eed0
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x140013467
dec dword [rax + 0xec]
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov rsi, qword [rbx + 0x40]
test rsi, rsi
je 0x14001349d
mov rcx, rsi
call fcn.14000eed0
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x140013493
dec dword [rax + 0xec]
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
nop
lea rcx, [rbx + 0x78]
lea r9, [0x140027750]
mov edx, 0x10
mov r8d, 2
call fcn.140046834
nop
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400134cb
dec dword [rax + 0xec]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
inc ebp
add r14, 8
cmp ebp, dword [rdi + 0x48e0]
jl 0x140013430
mov rcx, qword [rdi + 0x48e8]
test rcx, rcx
je 0x140013518
mov qword [rdi + 0x48e0], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x14001350b
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x48e8], r12
lea rcx, [rdi + 0x4bd8]
call fcn.140027780
mov rcx, qword [rdi + 0x4c08]
test rcx, rcx
je 0x140013556
mov qword [rdi + 0x4c00], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x140013549
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4c08], r12
mov rcx, qword [rdi + 0x4c18]
test rcx, rcx
je 0x140013588
mov qword [rdi + 0x4c10], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x14001357b
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4c18], r12
mov ebx, r12d
cmp dword [rdi + 0x4b58], r12d
jle 0x1400135d8
mov rsi, r12
nop word [rax + rax]
mov rax, qword [rdi + 0x4b60]
mov rcx, qword [rsi + rax + 0x20]
test rcx, rcx
je 0x1400135ca
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400135c3
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
nop
inc ebx
add rsi, 0x28
cmp ebx, dword [rdi + 0x4b58]
jl 0x1400135a0
mov rcx, qword [rdi + 0x4b60]
test rcx, rcx
je 0x14001360a
mov qword [rdi + 0x4b58], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400135fd
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4b60], r12
lea rcx, [rdi + 0x4b88]
call fcn.140027900
mov esi, r12d
cmp dword [rdi + 0x4b78], r12d
jle 0x140013675
mov rbp, r12
nop word [rax + rax]
mov rbx, qword [rdi + 0x4b80]
lea rcx, [rbx + 0x10]
add rcx, rbp
call fcn.140035890
nop
mov rcx, qword [rbx + rbp + 0x20]
test rcx, rcx
je 0x140013667
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x140013660
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
nop
inc esi
add rbp, 0x70
cmp esi, dword [rdi + 0x4b78]
jl 0x140013630
mov rcx, qword [rdi + 0x4b80]
test rcx, rcx
je 0x1400136a7
mov qword [rdi + 0x4b78], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x14001369a
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4b80], r12
mov rcx, qword [rdi + 0x4bc8]
test rcx, rcx
je 0x1400136d9
mov qword [rdi + 0x4bc0], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400136cc
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4bc8], r12
mov rcx, qword [rdi + 0x5bf0]
test rcx, rcx
je 0x14001370b
mov qword [rdi + 0x5be8], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400136fe
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x5bf0], r12
mov rcx, qword [rdi + 0x5c00]
test rcx, rcx
je 0x14001373d
mov qword [rdi + 0x5bf8], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x140013730
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x5c00], r12
mov rcx, qword [rdi + 0x4c68]
test rcx, rcx
je 0x14001376f
mov qword [rdi + 0x4c60], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x140013762
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4c68], r12
mov rcx, qword [rdi + 0x4c78]
test rcx, rcx
je 0x1400137a1
mov qword [rdi + 0x4c70], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x140013794
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4c78], r12
mov rcx, qword [rdi + 0x4c88]
test rcx, rcx
je 0x1400137d3
mov qword [rdi + 0x4c80], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400137c6
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4c88], r12
mov dword [rdi + 0x5ad8], r12d
mov rcx, qword [rdi + 0x5ae8]
test rcx, rcx
je 0x14001380c
mov qword [rdi + 0x5ae0], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400137ff
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x5ae8], r12
mov rcx, qword [rdi + 0x5c58]
test rcx, rcx
je 0x14001383e
mov qword [rdi + 0x5c50], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x140013831
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x5c58], r12
mov rcx, qword [rdi + 0x5c48]
test rcx, rcx
je 0x140013870
mov qword [rdi + 0x5c40], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x140013863
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x5c48], r12
cmp qword [rdi + 0x5cd0], 0
je 0x1400138a1
mov rbx, qword [rdi + 0x5cd0]
mov ecx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
cmp rbx, rax
je 0x14001389a
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov qword [rdi + 0x5cd0], r12
mov rcx, qword [rdi + 0x5ce0]
test rcx, rcx
je 0x1400138d3
mov qword [rdi + 0x5cd8], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400138c6
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x5ce0], r12
mov rcx, qword [rdi + 0x5d18]
test rcx, rcx
je 0x140013905
mov qword [rdi + 0x5d10], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x1400138f8
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x5d18], r12
mov rcx, qword [rdi + 0x5d28]
test rcx, rcx
je 0x140013937
mov qword [rdi + 0x5d20], r12
mov rax, qword [0x1400cd1d8]
test rax, rax
je 0x14001392a
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x5d28], r12
mov dword [rdi + 0x5d30], r12d
mov byte [rdi], 0
mov rbx, qword [rsp + 0x58]
mov rbp, qword [rsp + 0x60]
add rsp, 0x20
pop r15
pop r14
pop r12
pop rdi
pop rsi
ret