Function at 0x140016040
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 [0x140057d60]
mov rax, qword [rdi + 0x50]
test rax, rax
je 0x14001609c
cmp byte [rdi + 1], 0
je 0x14001609c
mov byte [rax + 0x18], 0
mov rbx, qword [rdi + 0x50]
test rbx, rbx
je 0x14001609c
mov rcx, rbx
call fcn.1400315e0
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016093
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 + 0x50], r12
cmp byte [rdi], r12b
je 0x14001688f
cmp byte [rdi + 0x5361], r12b
je 0x140016114
mov rbx, qword [rdi + 0x20]
test rbx, rbx
je 0x140016114
mov rax, qword [0x140057d60]
mov dword [rax + 0x5364], r12d
mov qword [rsp + 0x50], r12
lea rcx, [rsp + 0x50]
call fcn.140024010
mov rsi, rax
lea rdx, [0x14004ef48]
mov rcx, rbx
call fcn.140010630
mov rbx, rax
test rax, rax
je 0x140016114
mov r9, rax
mov r8, qword [rsp + 0x50]
lea edx, [r12 + 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 + 0x53a8], r12d
jle 0x140016160
mov rsi, r12
nop dword [rax]
nop word [rax + rax]
mov rcx, qword [rdi + 0x53b0]
cmp dword [rsi + rcx + 4], 6
jne 0x140016152
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 + 0x53a8]
jl 0x140016130
mov esi, r12d
cmp dword [rdi + 0x3e28], r12d
jle 0x1400161b1
mov r14, r12
nop
mov rax, qword [rdi + 0x3e30]
mov rbx, qword [r14 + rax]
test rbx, rbx
je 0x1400161a3
mov rcx, rbx
call fcn.140012bb0
mov rax, qword [0x140057d60]
test rax, rax
je 0x14001619a
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 + 0x3e28]
jl 0x140016170
mov rcx, qword [rdi + 0x3e30]
test rcx, rcx
je 0x1400161e3
mov qword [rdi + 0x3e28], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x1400161d6
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x3e30], r12
mov rcx, qword [rdi + 0x3e40]
test rcx, rcx
je 0x140016215
mov qword [rdi + 0x3e38], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016208
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x3e40], r12
mov rcx, qword [rdi + 0x3e50]
test rcx, rcx
je 0x140016247
mov qword [rdi + 0x3e48], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x14001623a
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x3e50], r12
mov qword [rdi + 0x3e88], r12
mov rcx, qword [rdi + 0x3e60]
test rcx, rcx
je 0x140016280
mov qword [rdi + 0x3e58], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016273
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x3e60], r12
mov rcx, qword [rdi + 0x3e70]
test rcx, rcx
je 0x1400162b2
mov qword [rdi + 0x3e68], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x1400162a5
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x3e70], r12
mov qword [rdi + 0x4090], r12
mov qword [rdi + 0x3e98], r12
mov qword [rdi + 0x3e90], r12
mov qword [rdi + 0x3f08], r12
mov qword [rdi + 0x3ef0], r12
mov qword [rdi + 0x3ea0], r12
mov rcx, qword [rdi + 0x4000]
test rcx, rcx
je 0x14001630e
mov qword [rdi + 0x3ff8], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016301
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4000], r12
mov rcx, qword [rdi + 0x4010]
test rcx, rcx
je 0x140016340
mov qword [rdi + 0x4008], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016333
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4010], r12
mov rcx, qword [rdi + 0x4020]
test rcx, rcx
je 0x140016372
mov qword [rdi + 0x4018], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016365
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4020], r12
mov rcx, qword [rdi + 0x4060]
test rcx, rcx
je 0x1400163a4
mov qword [rdi + 0x4058], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016397
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4060], r12
mov rcx, qword [rdi + 0x4070]
test rcx, rcx
je 0x1400163d6
mov qword [rdi + 0x4068], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x1400163c9
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4070], r12
mov ebp, r12d
cmp dword [rdi + 0x4080], r12d
jle 0x1400164a4
mov r14, r12
nop dword [rax]
mov rax, qword [rdi + 0x4088]
mov rbx, qword [r14 + rax]
test rbx, rbx
je 0x140016492
mov rsi, qword [rbx + 0x38]
test rsi, rsi
je 0x140016430
mov rcx, rsi
call fcn.14000edf0
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016427
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 0x14001645d
mov rcx, rsi
call fcn.14000edf0
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016453
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, [0x140024d40]
mov edx, 0x10
lea r8d, [rdx - 0xe]
call fcn.1400474f8
nop
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016489
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 + 0x4080]
jl 0x1400163f0
mov rcx, qword [rdi + 0x4088]
test rcx, rcx
je 0x1400164d6
mov qword [rdi + 0x4080], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x1400164c9
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4088], r12
lea rcx, [rdi + 0x4360]
call fcn.140024d70
mov rcx, qword [rdi + 0x4390]
test rcx, rcx
je 0x140016514
mov qword [rdi + 0x4388], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016507
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4390], r12
mov rcx, qword [rdi + 0x43a0]
test rcx, rcx
je 0x140016546
mov qword [rdi + 0x4398], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016539
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x43a0], r12
mov ebx, r12d
cmp dword [rdi + 0x42e0], r12d
jle 0x140016598
mov rsi, r12
nop word [rax + rax]
mov rax, qword [rdi + 0x42e8]
mov rcx, qword [rsi + rax + 0x20]
test rcx, rcx
je 0x14001658a
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016583
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 + 0x42e0]
jl 0x140016560
mov rcx, qword [rdi + 0x42e8]
test rcx, rcx
je 0x1400165ca
mov qword [rdi + 0x42e0], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x1400165bd
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x42e8], r12
lea rcx, [rdi + 0x4310]
call fcn.140024ee0
mov esi, r12d
cmp dword [rdi + 0x4300], r12d
jle 0x140016635
mov rbp, r12
nop word [rax + rax]
mov rbx, qword [rdi + 0x4308]
lea rcx, [rbx + 0x10]
add rcx, rbp
call fcn.140031030
nop
mov rcx, qword [rbx + rbp + 0x20]
test rcx, rcx
je 0x140016627
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016620
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 + 0x4300]
jl 0x1400165f0
mov rcx, qword [rdi + 0x4308]
test rcx, rcx
je 0x140016667
mov qword [rdi + 0x4300], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x14001665a
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4308], r12
mov rcx, qword [rdi + 0x4350]
test rcx, rcx
je 0x140016699
mov qword [rdi + 0x4348], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x14001668c
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x4350], r12
mov rcx, qword [rdi + 0x5328]
test rcx, rcx
je 0x1400166cb
mov qword [rdi + 0x5320], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x1400166be
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x5328], r12
mov rcx, qword [rdi + 0x5338]
test rcx, rcx
je 0x1400166fd
mov qword [rdi + 0x5330], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x1400166f0
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x5338], r12
mov rcx, qword [rdi + 0x43c8]
test rcx, rcx
je 0x14001672f
mov qword [rdi + 0x43c0], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016722
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x43c8], r12
mov rcx, qword [rdi + 0x43d8]
test rcx, rcx
je 0x140016761
mov qword [rdi + 0x43d0], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016754
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x43d8], r12
mov rcx, qword [rdi + 0x43e8]
test rcx, rcx
je 0x140016793
mov qword [rdi + 0x43e0], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x140016786
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x43e8], r12
mov rcx, qword [rdi + 0x5390]
test rcx, rcx
je 0x1400167c5
mov qword [rdi + 0x5388], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x1400167b8
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x5390], r12
mov rcx, qword [rdi + 0x5380]
test rcx, rcx
je 0x1400167f7
mov qword [rdi + 0x5378], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x1400167ea
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x5380], r12
cmp qword [rdi + 0x53c8], 0
je 0x140016828
mov rbx, qword [rdi + 0x53c8]
mov ecx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
cmp rbx, rax
je 0x140016821
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov qword [rdi + 0x53c8], r12
mov rcx, qword [rdi + 0x53d8]
test rcx, rcx
je 0x14001685a
mov qword [rdi + 0x53d0], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x14001684d
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x53d8], r12
mov rcx, qword [rdi + 0x5410]
test rcx, rcx
je 0x14001688c
mov qword [rdi + 0x5408], r12
mov rax, qword [0x140057d60]
test rax, rax
je 0x14001687f
dec dword [rax + 0xec]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rdi + 0x5410], r12
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