Function at 0x140005170
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
push r14
push r15
sub rsp, 0x20
mov rdi, qword [0x1401dbbe0]
mov rax, qword [rdi + 0x58]
test rax, rax
je 0x1400051d4
cmp byte [rdi + 1], 0
je 0x1400051d4
mov byte [rax + 0x18], 0
mov rbx, qword [rdi + 0x58]
test rbx, rbx
je 0x1400051d4
mov rcx, rbx
call fcn.140020af0
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x1400051c5
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
mov rcx, rbx
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
xor r15d, r15d
mov qword [rdi + 0x58], r15
mov rcx, qword [rdi + 0x3c80]
test rcx, rcx
je 0x140005213
mov qword [rdi + 0x3c78], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005200
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x3c80], r15
cmp byte [rdi], r15b
je 0x140005af7
cmp byte [rdi + 0x5bd1], r15b
je 0x140005284
mov rbx, qword [rdi + 0x20]
test rbx, rbx
je 0x140005284
mov rax, qword [0x1401dbbe0]
mov dword [rax + 0x5bd4], r15d
mov qword [rsp + 0x40], r15
lea rcx, [rsp + 0x40]
call fcn.140017eb0
mov rsi, rax
lea rdx, [0x1400c558c]
mov rcx, rbx
call fcn.1400034c0
mov rbx, rax
test rax, rax
je 0x140005284
mov r9, rax
mov r8, qword [rsp + 0x40]
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, r15d
cmp dword [rdi + 0x5c18], r15d
jle 0x1400052d0
mov rsi, r15
nop dword [rax]
nop word [rax + rax]
mov rcx, qword [rdi + 0x5c20]
cmp dword [rsi + rcx + 4], 6
jne 0x1400052c2
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 + 0x5c18]
jl 0x1400052a0
mov esi, r15d
cmp dword [rdi + 0x3e90], r15d
jle 0x140005327
mov r14, r15
nop
mov rax, qword [rdi + 0x3e98]
mov rbx, qword [r14 + rax]
test rbx, rbx
je 0x140005319
mov rcx, rbx
call fcn.140006000
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x14000530a
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
mov rcx, rbx
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
inc esi
add r14, 8
cmp esi, dword [rdi + 0x3e90]
jl 0x1400052e0
mov rcx, qword [rdi + 0x3e98]
test rcx, rcx
je 0x14000535f
mov qword [rdi + 0x3e90], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x14000534c
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x3e98], r15
mov rcx, qword [rdi + 0x3ea8]
test rcx, rcx
je 0x140005397
mov qword [rdi + 0x3ea0], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005384
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x3ea8], r15
mov rcx, qword [rdi + 0x3eb8]
test rcx, rcx
je 0x1400053cf
mov qword [rdi + 0x3eb0], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x1400053bc
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x3eb8], r15
mov qword [rdi + 0x3ef0], r15
mov rcx, qword [rdi + 0x3ec8]
test rcx, rcx
je 0x14000540e
mov qword [rdi + 0x3ec0], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x1400053fb
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x3ec8], r15
mov rcx, qword [rdi + 0x3ed8]
test rcx, rcx
je 0x140005446
mov qword [rdi + 0x3ed0], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005433
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x3ed8], r15
mov qword [rdi + 0x48d8], r15
mov qword [rdi + 0x3f00], r15
mov qword [rdi + 0x3ef8], r15
mov qword [rdi + 0x3f88], r15
mov qword [rdi + 0x3f70], r15
mov qword [rdi + 0x3f08], r15
lea rcx, [rdi + 0x4628]
call fcn.140001780
mov rcx, qword [rdi + 0x4848]
test rcx, rcx
je 0x1400054b4
mov qword [rdi + 0x4840], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x1400054a1
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x4848], r15
mov rcx, qword [rdi + 0x4858]
test rcx, rcx
je 0x1400054ec
mov qword [rdi + 0x4850], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x1400054d9
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x4858], r15
mov rcx, qword [rdi + 0x4868]
test rcx, rcx
je 0x140005524
mov qword [rdi + 0x4860], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005511
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x4868], r15
mov rcx, qword [rdi + 0x48a8]
test rcx, rcx
je 0x14000555c
mov qword [rdi + 0x48a0], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005549
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x48a8], r15
mov rcx, qword [rdi + 0x48b8]
test rcx, rcx
je 0x140005594
mov qword [rdi + 0x48b0], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005581
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x48b8], r15
mov ebp, r15d
cmp dword [rdi + 0x48c8], r15d
jle 0x140005676
mov r14, r15
nop word [rax + rax]
mov rax, qword [rdi + 0x48d0]
mov rbx, qword [r14 + rax]
test rbx, rbx
je 0x140005664
mov rsi, qword [rbx + 0x38]
test rsi, rsi
je 0x1400055f6
mov rcx, rsi
call fcn.140001550
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x1400055e7
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
mov rcx, rsi
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov rsi, qword [rbx + 0x40]
test rsi, rsi
je 0x140005629
mov rcx, rsi
call fcn.140001550
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005619
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
mov rcx, rsi
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
nop
lea rcx, [rbx + 0x78]
lea r9, [0x140018f40]
mov edx, 0x10
lea r8d, [rdx - 0xe]
call fcn.1400a50a0
nop
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005655
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
mov rcx, rbx
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
inc ebp
add r14, 8
cmp ebp, dword [rdi + 0x48c8]
jl 0x1400055b0
mov rcx, qword [rdi + 0x48d0]
test rcx, rcx
je 0x1400056ae
mov qword [rdi + 0x48c8], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x14000569b
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x48d0], r15
lea rcx, [rdi + 0x4ba8]
call fcn.140018f80
mov rcx, qword [rdi + 0x4bd8]
test rcx, rcx
je 0x1400056f2
mov qword [rdi + 0x4bd0], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x1400056df
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x4bd8], r15
mov rcx, qword [rdi + 0x4be8]
test rcx, rcx
je 0x14000572a
mov qword [rdi + 0x4be0], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005717
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x4be8], r15
mov ebx, r15d
cmp dword [rdi + 0x4b28], r15d
jle 0x14000577e
mov rsi, r15
nop dword [rax]
mov rax, qword [rdi + 0x4b30]
mov rcx, qword [rsi + rax + 0x20]
test rcx, rcx
je 0x140005770
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005763
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
nop
inc ebx
add rsi, 0x28
cmp ebx, dword [rdi + 0x4b28]
jl 0x140005740
mov rcx, qword [rdi + 0x4b30]
test rcx, rcx
je 0x1400057b6
mov qword [rdi + 0x4b28], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x1400057a3
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x4b30], r15
lea rcx, [rdi + 0x4b58]
call fcn.140019120
mov esi, r15d
cmp dword [rdi + 0x4b48], r15d
jle 0x14000581c
mov rbp, r15
mov rbx, qword [rdi + 0x4b50]
lea rcx, [rbx + 0x10]
add rcx, rbp
call fcn.14001ffa0
nop
mov rcx, qword [rbx + rbp + 0x20]
test rcx, rcx
je 0x14000580e
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005801
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
nop
inc esi
add rbp, 0x70
cmp esi, dword [rdi + 0x4b48]
jl 0x1400057d1
mov rcx, qword [rdi + 0x4b50]
test rcx, rcx
je 0x140005854
mov qword [rdi + 0x4b48], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005841
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x4b50], r15
mov rcx, qword [rdi + 0x4b98]
test rcx, rcx
je 0x14000588c
mov qword [rdi + 0x4b90], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005879
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x4b98], r15
mov rcx, qword [rdi + 0x5b98]
test rcx, rcx
je 0x1400058c4
mov qword [rdi + 0x5b90], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x1400058b1
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x5b98], r15
mov rcx, qword [rdi + 0x5ba8]
test rcx, rcx
je 0x1400058fc
mov qword [rdi + 0x5ba0], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x1400058e9
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x5ba8], r15
mov rcx, qword [rdi + 0x4c28]
test rcx, rcx
je 0x140005934
mov qword [rdi + 0x4c20], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005921
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x4c28], r15
mov rcx, qword [rdi + 0x4c38]
test rcx, rcx
je 0x14000596c
mov qword [rdi + 0x4c30], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005959
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x4c38], r15
mov rcx, qword [rdi + 0x4c48]
test rcx, rcx
je 0x1400059a4
mov qword [rdi + 0x4c40], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005991
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x4c48], r15
mov rcx, qword [rdi + 0x5c00]
test rcx, rcx
je 0x1400059dc
mov qword [rdi + 0x5bf8], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x1400059c9
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x5c00], r15
mov rcx, qword [rdi + 0x5bf0]
test rcx, rcx
je 0x140005a14
mov qword [rdi + 0x5be8], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005a01
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x5bf0], r15
cmp qword [rdi + 0x5c70], 0
je 0x140005a45
mov rbx, qword [rdi + 0x5c70]
mov ecx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
cmp rbx, rax
je 0x140005a3e
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov qword [rdi + 0x5c70], r15
mov rcx, qword [rdi + 0x5c80]
test rcx, rcx
je 0x140005a7d
mov qword [rdi + 0x5c78], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005a6a
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x5c80], r15
mov rcx, qword [rdi + 0x5cb8]
test rcx, rcx
je 0x140005ab5
mov qword [rdi + 0x5cb0], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005aa2
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x5cb8], r15
mov rcx, qword [rdi + 0x5cc8]
test rcx, rcx
je 0x140005aed
mov qword [rdi + 0x5cc0], r15
mov rax, qword [0x1401dbbe0]
test rax, rax
je 0x140005ada
dec dword [rax + 0xf4]
mov rdx, qword [0x1401dbbd0]
call sub.api_ms_win_crt_heap_l1_1_0.dll_free
mov qword [rdi + 0x5cc8], r15
mov dword [rdi + 0x5cd0], r15d
mov byte [rdi], 0
mov rbx, qword [rsp + 0x48]
mov rbp, qword [rsp + 0x50]
mov rsi, qword [rsp + 0x58]
add rsp, 0x20
pop r15
pop r14
pop rdi
ret