Function at 0x140167840
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
lea rcx, [0x14048d6c2]
call fcn.140289ea0
mov rdi, qword [0x140466678]
mov rax, qword [rdi + 0x38]
test rax, rax
je 0x1401678c6
cmp byte [rdi + 1], 0
je 0x1401678c6
mov byte [rax + 0x18], 0
mov rbx, qword [rdi + 0x38]
test rbx, rbx
je 0x1401678c6
mov rcx, rbx
call fcn.140185290
nop
mov rcx, qword [rbx + 0x80]
test rcx, rcx
je 0x1401678a0
call fcn.140168ee0
nop
mov rcx, qword [rbx + 0x70]
test rcx, rcx
je 0x1401678af
call fcn.140168ee0
nop
mov rcx, qword [rbx + 0x60]
test rcx, rcx
je 0x1401678be
call fcn.140168ee0
nop
mov rcx, rbx
call fcn.140168ee0
xor r12d, r12d
mov qword [rdi + 0x38], r12
mov rcx, qword [rdi + 0x3da0]
test rcx, rcx
je 0x1401678ec
mov qword [rdi + 0x3d98], r12
call fcn.140168ee0
mov qword [rdi + 0x3da0], r12
cmp byte [rdi], r12b
je 0x140167ee7
cmp byte [rdi + 0x5f18], r12b
je 0x14016795d
mov rbx, qword [rdi + 0x20]
test rbx, rbx
je 0x14016795d
mov rax, qword [0x140466678]
mov dword [rax + 0x5f1c], r12d
mov qword [rsp + 0x50], r12
lea rcx, [rsp + 0x50]
call fcn.14017ca40
mov rsi, rax
lea rdx, [0x1403bb484]
mov rcx, rbx
call fcn.1401647c0
mov rbx, rax
test rax, rax
je 0x14016795d
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 rbx, qword [rdi + 0x5f68]
movsxd rsi, dword [rdi + 0x5f60]
shl rsi, 5
add rsi, rbx
cmp rbx, rsi
je 0x140167992
cmp dword [rbx + 4], 6
jne 0x140167989
mov rax, qword [rbx + 0x10]
mov rdx, rbx
mov rcx, rdi
call rax
add rbx, 0x20
cmp rbx, rsi
jne 0x140167977
mov ebx, r12d
cmp dword [rdi + 0x3fd8], r12d
jle 0x1401679de
mov r14, r12
nop dword [rax]
nop word [rax + rax]
mov rax, qword [rdi + 0x3fe0]
mov rsi, qword [r14 + rax]
test rsi, rsi
je 0x1401679d0
mov rcx, rsi
call fcn.140168390
mov rcx, rsi
call fcn.140168ee0
inc ebx
add r14, 8
cmp ebx, dword [rdi + 0x3fd8]
jl 0x1401679b0
mov rcx, qword [rdi + 0x3fe0]
test rcx, rcx
je 0x1401679fd
mov qword [rdi + 0x3fd8], r12
call fcn.140168ee0
mov qword [rdi + 0x3fe0], r12
mov rcx, qword [rdi + 0x3ff0]
test rcx, rcx
je 0x140167a1c
mov qword [rdi + 0x3fe8], r12
call fcn.140168ee0
mov qword [rdi + 0x3ff0], r12
mov rcx, qword [rdi + 0x4000]
test rcx, rcx
je 0x140167a3b
mov qword [rdi + 0x3ff8], r12
call fcn.140168ee0
mov qword [rdi + 0x4000], r12
mov qword [rdi + 0x4038], r12
mov rcx, qword [rdi + 0x4010]
test rcx, rcx
je 0x140167a61
mov qword [rdi + 0x4008], r12
call fcn.140168ee0
mov qword [rdi + 0x4010], r12
mov rcx, qword [rdi + 0x4020]
test rcx, rcx
je 0x140167a80
mov qword [rdi + 0x4018], r12
call fcn.140168ee0
mov qword [rdi + 0x4020], r12
mov qword [rdi + 0x4b08], r12
mov qword [rdi + 0x4048], r12
mov qword [rdi + 0x4040], r12
mov qword [rdi + 0x40d0], r12
mov qword [rdi + 0x40b8], r12
mov qword [rdi + 0x4050], r12
lea rcx, [rdi + 0x4818]
call fcn.140162610
mov rcx, qword [rdi + 0x4a68]
test rcx, rcx
je 0x140167ad5
mov qword [rdi + 0x4a60], r12
call fcn.140168ee0
mov qword [rdi + 0x4a68], r12
mov rcx, qword [rdi + 0x4a78]
test rcx, rcx
je 0x140167af4
mov qword [rdi + 0x4a70], r12
call fcn.140168ee0
mov qword [rdi + 0x4a78], r12
mov rcx, qword [rdi + 0x4a88]
test rcx, rcx
je 0x140167b13
mov qword [rdi + 0x4a80], r12
call fcn.140168ee0
mov qword [rdi + 0x4a88], r12
mov rcx, qword [rdi + 0x4ac8]
test rcx, rcx
je 0x140167b32
mov qword [rdi + 0x4ac0], r12
call fcn.140168ee0
mov qword [rdi + 0x4ac8], r12
mov rcx, qword [rdi + 0x4ad8]
test rcx, rcx
je 0x140167b51
mov qword [rdi + 0x4ad0], r12
call fcn.140168ee0
mov qword [rdi + 0x4ad8], r12
mov rcx, qword [rdi + 0x4ae8]
test rcx, rcx
je 0x140167b70
mov qword [rdi + 0x4ae0], r12
call fcn.140168ee0
mov qword [rdi + 0x4ae8], r12
mov ebp, r12d
cmp dword [rdi + 0x4af8], r12d
jle 0x140167bfa
mov r14, r12
nop
mov rax, qword [rdi + 0x4b00]
mov rbx, qword [r14 + rax]
test rbx, rbx
je 0x140167bec
mov rsi, qword [rbx + 0x38]
test rsi, rsi
je 0x140167ba9
mov rcx, rsi
call fcn.140162430
mov rcx, rsi
call fcn.140168ee0
mov rsi, qword [rbx + 0x40]
test rsi, rsi
je 0x140167bc3
mov rcx, rsi
call fcn.140162430
mov rcx, rsi
call fcn.140168ee0
nop
mov rcx, qword [rbx + 0xa0]
test rcx, rcx
je 0x140167bd5
call fcn.140168ee0
nop
mov rcx, qword [rbx + 0x60]
test rcx, rcx
je 0x140167be4
call fcn.140168ee0
nop
mov rcx, rbx
call fcn.140168ee0
inc ebp
add r14, 8
cmp ebp, dword [rdi + 0x4af8]
jl 0x140167b80
mov rcx, qword [rdi + 0x4b00]
test rcx, rcx
je 0x140167c19
mov qword [rdi + 0x4af8], r12
call fcn.140168ee0
mov qword [rdi + 0x4b00], r12
lea rcx, [rdi + 0x4e48]
call fcn.14017dba0
mov rcx, qword [rdi + 0x4e78]
test rcx, rcx
je 0x140167c44
mov qword [rdi + 0x4e70], r12
call fcn.140168ee0
mov qword [rdi + 0x4e78], r12
mov rcx, qword [rdi + 0x4e88]
test rcx, rcx
je 0x140167c63
mov qword [rdi + 0x4e80], r12
call fcn.140168ee0
mov qword [rdi + 0x4e88], r12
mov ebx, r12d
cmp dword [rdi + 0x4dc8], r12d
jle 0x140167ca5
mov rsi, r12
nop dword [rax]
nop word [rax + rax]
mov rax, qword [rdi + 0x4dd0]
mov rcx, qword [rsi + rax + 0x20]
test rcx, rcx
je 0x140167c97
call fcn.140168ee0
nop
inc ebx
add rsi, 0x28
cmp ebx, dword [rdi + 0x4dc8]
jl 0x140167c80
mov rcx, qword [rdi + 0x4dd0]
test rcx, rcx
je 0x140167cc4
mov qword [rdi + 0x4dc8], r12
call fcn.140168ee0
mov qword [rdi + 0x4dd0], r12
lea rcx, [rdi + 0x4df8]
call fcn.14017dcd0
mov esi, r12d
cmp dword [rdi + 0x4de8], r12d
jle 0x140167d12
mov rbp, r12
nop
mov rbx, qword [rdi + 0x4df0]
lea rcx, [rbx + 0x18]
add rcx, rbp
call fcn.1401847e0
nop
mov rcx, qword [rbx + rbp + 0x28]
test rcx, rcx
je 0x140167d04
call fcn.140168ee0
nop
inc esi
add rbp, 0x78
cmp esi, dword [rdi + 0x4de8]
jl 0x140167ce0
mov rcx, qword [rdi + 0x4df0]
test rcx, rcx
je 0x140167d31
mov qword [rdi + 0x4de8], r12
call fcn.140168ee0
mov qword [rdi + 0x4df0], r12
mov rcx, qword [rdi + 0x4e38]
test rcx, rcx
je 0x140167d50
mov qword [rdi + 0x4e30], r12
call fcn.140168ee0
mov qword [rdi + 0x4e38], r12
mov rcx, qword [rdi + 0x5e78]
test rcx, rcx
je 0x140167d6f
mov qword [rdi + 0x5e70], r12
call fcn.140168ee0
mov qword [rdi + 0x5e78], r12
mov rcx, qword [rdi + 0x5e88]
test rcx, rcx
je 0x140167d8e
mov qword [rdi + 0x5e80], r12
call fcn.140168ee0
mov qword [rdi + 0x5e88], r12
mov rcx, qword [rdi + 0x4ed8]
test rcx, rcx
je 0x140167dad
mov qword [rdi + 0x4ed0], r12
call fcn.140168ee0
mov qword [rdi + 0x4ed8], r12
mov rcx, qword [rdi + 0x4ee8]
test rcx, rcx
je 0x140167dcc
mov qword [rdi + 0x4ee0], r12
call fcn.140168ee0
mov qword [rdi + 0x4ee8], r12
mov rcx, qword [rdi + 0x4ef8]
test rcx, rcx
je 0x140167deb
mov qword [rdi + 0x4ef0], r12
call fcn.140168ee0
mov qword [rdi + 0x4ef8], r12
mov dword [rdi + 0x5d48], r12d
mov rcx, qword [rdi + 0x5d58]
test rcx, rcx
je 0x140167e11
mov qword [rdi + 0x5d50], r12
call fcn.140168ee0
mov qword [rdi + 0x5d58], r12
mov rcx, qword [rdi + 0x5f48]
test rcx, rcx
je 0x140167e30
mov qword [rdi + 0x5f40], r12
call fcn.140168ee0
mov qword [rdi + 0x5f48], r12
mov rcx, qword [rdi + 0x5f38]
test rcx, rcx
je 0x140167e4f
mov qword [rdi + 0x5f30], r12
call fcn.140168ee0
mov qword [rdi + 0x5f38], r12
cmp qword [rdi + 0x5fc0], 0
je 0x140167e80
mov rbx, qword [rdi + 0x5fc0]
mov ecx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
cmp rbx, rax
je 0x140167e79
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov qword [rdi + 0x5fc0], r12
mov rcx, qword [rdi + 0x5fd0]
test rcx, rcx
je 0x140167e9f
mov qword [rdi + 0x5fc8], r12
call fcn.140168ee0
mov qword [rdi + 0x5fd0], r12
mov rcx, qword [rdi + 0x6008]
test rcx, rcx
je 0x140167ebe
mov qword [rdi + 0x6000], r12
call fcn.140168ee0
mov qword [rdi + 0x6008], r12
mov rcx, qword [rdi + 0x6018]
test rcx, rcx
je 0x140167edd
mov qword [rdi + 0x6010], r12
call fcn.140168ee0
mov qword [rdi + 0x6018], r12
mov dword [rdi + 0x6020], 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