Function at 0x140022820
Capabilities:
Write file on windows

Disassembly:
push rbx
push r12
sub rsp, 0x38
mov rbx, qword [0x1400db270]
mov rax, qword [rbx + 0x38]
test rax, rax
je 0x14002284b
cmp byte [rbx + 1], 0
je 0x14002284b
mov byte [rax + 0x18], 0
mov rcx, qword [rbx + 0x38]
call fcn.14003bf00
xor r12d, r12d
lea rcx, [rbx + 0x3e00]
mov qword [rbx + 0x38], r12
call fcn.14001be90
cmp byte [rbx], r12b
je 0x140023109
mov qword [rsp + 0x58], rbp
mov qword [rsp + 0x60], rsi
mov qword [rsp + 0x30], rdi
mov qword [rsp + 0x20], r15
cmp byte [rbx + 0x52a0], r12b
je 0x1400228e3
mov rdi, qword [rbx + 0x20]
test rdi, rdi
je 0x1400228e3
mov rax, qword [0x1400db270]
lea rcx, [rsp + 0x50]
mov qword [rsp + 0x50], r12
mov dword [rax + 0x52a4], r12d
call fcn.1400391e0
lea rdx, [0x1400c9cc4]
mov rcx, rdi
mov rsi, rax
call fcn.14001e7c0
mov rdi, rax
test rax, rax
je 0x1400228e3
mov r8, qword [rsp + 0x50]
mov r9, rax
mov edx, 1
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov rdi, qword [rbx + 0x52f0]
movsxd rsi, dword [rbx + 0x52e8]
shl rsi, 5
add rsi, rdi
cmp rdi, rsi
je 0x140022918
nop dword [rax]
cmp dword [rdi + 4], 6
jne 0x14002290f
mov rdx, rdi
mov rcx, rbx
call qword [rdi + 0x10]
add rdi, 0x20
cmp rdi, rsi
jne 0x140022900
mov ebp, r12d
cmp dword [rbx + 0x4040], r12d
jle 0x1400229d2
mov qword [rsp + 0x28], r14
mov r14, r12
mov rax, qword [rbx + 0x4048]
mov rsi, qword [r14 + rax]
test rsi, rsi
je 0x1400229bb
mov rcx, rsi
call fcn.140023740
mov rdi, qword [0x1400db270]
test rdi, rdi
je 0x1400229b2
movsx rdx, word [rdi + 0x5438]
lea rcx, [rdi + 0x543c]
mov r8d, dword [rdi + 0x3fe8]
lea rcx, [rcx + rdx*8]
cmp dword [rcx], r8d
je 0x1400229a8
lea ecx, [rdx + 1]
mov eax, 0x2aaaaaab
imul ecx
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*2]
add eax, eax
sub ecx, eax
mov word [rdi + 0x5438], cx
movsx rax, cx
lea rcx, [rdi + 0x543c]
lea rcx, [rcx + rax*8]
mov dword [rcx], r8d
mov dword [rcx + 4], r12d
inc word [rcx + 6]
inc dword [rdi + 0x5434]
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
inc ebp
add r14, 8
cmp ebp, dword [rbx + 0x4040]
jl 0x140022930
mov r14, qword [rsp + 0x28]
lea rcx, [rbx + 0x4040]
call fcn.14001be90
lea rcx, [rbx + 0x4050]
call fcn.14001be90
lea rcx, [rbx + 0x4060]
call fcn.14001be90
mov r15, qword [rsp + 0x20]
mov rbp, qword [rsp + 0x58]
mov qword [rbx + 0x40a0], r12
mov r8, qword [rbx + 0x4078]
test r8, r8
je 0x140022a98
mov rdi, qword [0x1400db270]
mov qword [rbx + 0x4070], r12
test rdi, rdi
je 0x140022a88
movsx rdx, word [rdi + 0x5438]
lea rcx, [rdi + 0x543c]
mov r9d, dword [rdi + 0x3fe8]
lea rcx, [rcx + rdx*8]
cmp dword [rcx], r9d
je 0x140022a7e
lea ecx, [rdx + 1]
mov eax, 0x2aaaaaab
imul ecx
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*2]
add eax, eax
sub ecx, eax
mov word [rdi + 0x5438], cx
movsx rax, cx
lea rcx, [rdi + 0x543c]
lea rcx, [rcx + rax*8]
mov dword [rcx], r9d
mov dword [rcx + 4], r12d
inc word [rcx + 6]
inc dword [rdi + 0x5434]
mov rcx, r8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx + 0x4078], r12
lea rcx, [rbx + 0x4080]
call fcn.14001be90
mov qword [rbx + 0x4bd8], r12
lea rdi, [rbx + 0x48c8]
mov qword [rbx + 0x40b0], r12
mov eax, 0xffffffff
movsx rax, ax
mov ecx, 0x9a
mov qword [rbx + 0x40a8], r12
mov qword [rbx + 0x4150], r12
mov qword [rbx + 0x4138], r12
mov qword [rbx + 0x40c0], r12
rep stosw word [rdi], ax
lea rcx, [rbx + 0x4a00]
call fcn.14001be90
lea rcx, [rbx + 0x4a10]
call fcn.14001be90
mov r8, qword [rbx + 0x4b40]
test r8, r8
je 0x140022b8f
mov rdi, qword [0x1400db270]
mov qword [rbx + 0x4b38], r12
test rdi, rdi
je 0x140022b7f
movsx rdx, word [rdi + 0x5438]
lea rcx, [rdi + 0x543c]
mov r9d, dword [rdi + 0x3fe8]
lea rcx, [rcx + rdx*8]
cmp dword [rcx], r9d
je 0x140022b75
lea ecx, [rdx + 1]
mov eax, 0x2aaaaaab
imul ecx
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*2]
add eax, eax
sub ecx, eax
mov word [rdi + 0x5438], cx
movsx rax, cx
lea rcx, [rdi + 0x543c]
lea rcx, [rcx + rax*8]
mov dword [rcx], r9d
mov dword [rcx + 4], r12d
inc word [rcx + 6]
inc dword [rdi + 0x5434]
mov rcx, r8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx + 0x4b40], r12
mov r8, qword [rbx + 0x4b50]
test r8, r8
je 0x140022c20
mov rdi, qword [0x1400db270]
mov qword [rbx + 0x4b48], r12
test rdi, rdi
je 0x140022c10
movsx rdx, word [rdi + 0x5438]
lea rcx, [rdi + 0x543c]
mov r9d, dword [rdi + 0x3fe8]
lea rcx, [rcx + rdx*8]
cmp dword [rcx], r9d
je 0x140022c06
lea ecx, [rdx + 1]
mov eax, 0x2aaaaaab
imul ecx
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*2]
add eax, eax
sub ecx, eax
mov word [rdi + 0x5438], cx
movsx rax, cx
lea rcx, [rdi + 0x543c]
lea rcx, [rcx + rax*8]
mov dword [rcx], r9d
mov dword [rcx + 4], r12d
inc word [rcx + 6]
inc dword [rdi + 0x5434]
mov rcx, r8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx + 0x4b50], r12
lea rcx, [rbx + 0x4b58]
call fcn.14001be90
lea rcx, [rbx + 0x4b98]
call fcn.14001be90
lea rcx, [rbx + 0x4ba8]
call fcn.14001be90
mov r8, qword [rbx + 0x4bc0]
test r8, r8
je 0x140022cd5
mov rdi, qword [0x1400db270]
mov qword [rbx + 0x4bb8], r12
test rdi, rdi
je 0x140022cc5
movsx rdx, word [rdi + 0x5438]
lea rcx, [rdi + 0x543c]
mov r9d, dword [rdi + 0x3fe8]
lea rcx, [rcx + rdx*8]
cmp dword [rcx], r9d
je 0x140022cbb
lea ecx, [rdx + 1]
mov eax, 0x2aaaaaab
imul ecx
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*2]
add eax, eax
sub ecx, eax
mov word [rdi + 0x5438], cx
movsx rax, cx
lea rcx, [rdi + 0x543c]
lea rcx, [rcx + rax*8]
mov dword [rcx], r9d
mov dword [rcx + 4], r12d
inc word [rcx + 6]
inc dword [rdi + 0x5434]
mov rcx, r8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx + 0x4bc0], r12
lea rcx, [rbx + 0x4bc8]
call fcn.14003ac30
lea rcx, [rbx + 0x4f30]
call fcn.14003a700
mov r8, qword [rbx + 0x4f60]
test r8, r8
je 0x140022d7e
mov rdi, qword [0x1400db270]
mov qword [rbx + 0x4f58], r12
test rdi, rdi
je 0x140022d6e
movsx rdx, word [rdi + 0x5438]
lea rcx, [rdi + 0x543c]
mov r9d, dword [rdi + 0x3fe8]
lea rcx, [rcx + rdx*8]
cmp dword [rcx], r9d
je 0x140022d64
lea ecx, [rdx + 1]
mov eax, 0x2aaaaaab
imul ecx
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*2]
add eax, eax
sub ecx, eax
mov word [rdi + 0x5438], cx
movsx rax, cx
lea rcx, [rdi + 0x543c]
lea rcx, [rcx + rax*8]
mov dword [rcx], r9d
mov dword [rcx + 4], r12d
inc word [rcx + 6]
inc dword [rdi + 0x5434]
mov rcx, r8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx + 0x4f60], r12
mov r8, qword [rbx + 0x4f70]
test r8, r8
je 0x140022e0f
mov rdi, qword [0x1400db270]
mov qword [rbx + 0x4f68], r12
test rdi, rdi
je 0x140022dff
movsx rdx, word [rdi + 0x5438]
lea rcx, [rdi + 0x543c]
mov r9d, dword [rdi + 0x3fe8]
lea rcx, [rcx + rdx*8]
cmp dword [rcx], r9d
je 0x140022df5
lea ecx, [rdx + 1]
mov eax, 0x2aaaaaab
imul ecx
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*2]
add eax, eax
sub ecx, eax
mov word [rdi + 0x5438], cx
movsx rax, cx
lea rcx, [rdi + 0x543c]
lea rcx, [rcx + rax*8]
mov dword [rcx], r9d
mov dword [rcx + 4], r12d
inc word [rcx + 6]
inc dword [rdi + 0x5434]
mov rcx, r8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx + 0x4f70], r12
mov edi, r12d
cmp dword [rbx + 0x4eb0], r12d
jle 0x140022e41
nop dword [rax + rax]
movsxd rax, edi
lea rcx, [rax + rax*4]
mov rax, qword [rbx + 0x4eb8]
lea rcx, [rax + rcx*8]
call fcn.14001f600
inc edi
cmp edi, dword [rbx + 0x4eb0]
jl 0x140022e20
mov r8, qword [rbx + 0x4eb8]
test r8, r8
je 0x140022ed2
mov rdi, qword [0x1400db270]
mov qword [rbx + 0x4eb0], r12
test rdi, rdi
je 0x140022ec2
movsx rdx, word [rdi + 0x5438]
lea rcx, [rdi + 0x543c]
mov r9d, dword [rdi + 0x3fe8]
lea rcx, [rcx + rdx*8]
cmp dword [rcx], r9d
je 0x140022eb8
lea ecx, [rdx + 1]
mov eax, 0x2aaaaaab
imul ecx
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*2]
add eax, eax
sub ecx, eax
mov word [rdi + 0x5438], cx
movsx rax, cx
lea rcx, [rdi + 0x543c]
lea rcx, [rcx + rax*8]
mov dword [rcx], r9d
mov dword [rcx + 4], r12d
inc word [rcx + 6]
inc dword [rdi + 0x5434]
mov rcx, r8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx + 0x4eb8], r12
lea rcx, [rbx + 0x4ee0]
call fcn.14003a850
mov edi, r12d
mov rsi, qword [rsp + 0x60]
cmp dword [rbx + 0x4ed0], r12d
jle 0x140022f10
nop
movsxd rax, edi
imul rcx, rax, 0x88
add rcx, qword [rbx + 0x4ed8]
call fcn.14003b790
inc edi
cmp edi, dword [rbx + 0x4ed0]
jl 0x140022ef0
mov r8, qword [rbx + 0x4ed8]
test r8, r8
je 0x140022fa1
mov rdi, qword [0x1400db270]
mov qword [rbx + 0x4ed0], r12
test rdi, rdi
je 0x140022f91
movsx rdx, word [rdi + 0x5438]
lea rcx, [rdi + 0x543c]
mov r9d, dword [rdi + 0x3fe8]
lea rcx, [rcx + rdx*8]
cmp dword [rcx], r9d
je 0x140022f87
lea ecx, [rdx + 1]
mov eax, 0x2aaaaaab
imul ecx
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*2]
add eax, eax
sub ecx, eax
mov word [rdi + 0x5438], cx
movsx rax, cx
lea rcx, [rdi + 0x543c]
lea rcx, [rcx + rax*8]
mov dword [rcx], r9d
mov dword [rcx + 4], r12d
inc word [rcx + 6]
inc dword [rdi + 0x5434]
mov rcx, r8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx + 0x4ed8], r12
lea rcx, [rbx + 0x4f18]
call fcn.14001be90
lea rcx, [rbx + 0x5000]
call fcn.14003a540
lea rcx, [rbx + 0x4ff0]
call fcn.14003a620
lea rcx, [rbx + 0x51f8]
call fcn.14001be90
lea rcx, [rbx + 0x5208]
call fcn.14001be90
lea rcx, [rbx + 0x5068]
call fcn.14001be90
lea rcx, [rbx + 0x5078]
call fcn.14001be90
lea rcx, [rbx + 0x50c8]
mov dword [rbx + 0x50c0], r12d
call fcn.14001be90
lea rcx, [rbx + 0x52c8]
call fcn.14001be90
mov r8, qword [rbx + 0x52c0]
test r8, r8
je 0x1400230a6
mov rdi, qword [0x1400db270]
mov qword [rbx + 0x52b8], r12
test rdi, rdi
je 0x140023096
movsx r10, word [rdi + 0x5438]
lea rdx, [rdi + 0x543c]
mov r9d, dword [rdi + 0x3fe8]
lea rdx, [rdx + r10*8]
cmp dword [rdx], r9d
je 0x14002308c
lea ecx, [r10 + 1]
mov eax, 0x2aaaaaab
imul ecx
mov eax, edx
shr eax, 0x1f
add edx, eax
lea eax, [rdx + rdx*2]
add eax, eax
lea rdx, [rdi + 0x543c]
sub ecx, eax
mov word [rdi + 0x5438], cx
movsx rax, cx
lea rdx, [rdx + rax*8]
mov dword [rdx], r9d
mov dword [rdx + 4], r12d
inc word [rdx + 6]
inc dword [rdi + 0x5434]
mov rcx, r8
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov qword [rbx + 0x52c0], r12
cmp qword [rbx + 0x5358], r12
je 0x1400230d6
mov rdi, qword [rbx + 0x5358]
mov ecx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
cmp rdi, rax
je 0x1400230cf
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov qword [rbx + 0x5358], r12
lea rcx, [rbx + 0x5360]
call fcn.14001be90
lea rcx, [rbx + 0x5398]
call fcn.14001be90
lea rcx, [rbx + 0x53a8]
call fcn.14001be90
mov rdi, qword [rsp + 0x30]
mov dword [rbx + 0x53b8], r12d
mov byte [rbx], r12b
add rsp, 0x38
pop r12
pop rbx
ret