Function at 0x140052140
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x30
xor r12d, r12d
mov r15, r9
mov qword [rsp + 0x20], r12
mov r13, r8
mov rdi, rdx
mov rbp, rcx
mov esi, r12d
lea r14d, [r12 + 0x5a]
test rdx, rdx
jne 0x14005217f
xor eax, eax
jmp 0x14005250d
mov qword [rsp + 0x60], rbx
test r13, r13
je 0x140052505
test r15, r15
je 0x140052505
mov r8d, 8
lea rdx, [0x1401e9080]
mov rcx, rdi
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncmp]
test eax, eax
jne 0x14005232e
mov rax, qword [0x140464280]
mov qword [rsp + 0x28], r12
mov qword [rsp + 0x68], r12
cmp qword [rax + 0xb8], rsi
je 0x140052505
mov ecx, 0x20
call qword [sub.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rsi, rax
test rax, rax
je 0x140052279
mov r8, rax
mov r9d, 0x20
mov rax, qword [0x140464280]
mov rdx, r15
mov rcx, r13
call qword [rax + 0xb8]
mov ebx, eax
test eax, eax
jne 0x140052222
lea r9, [rsp + 0x28]
mov rcx, rsi
lea r8, [rsp + 0x68]
lea edx, [rax + 0x20]
call fcn.140072ac0
mov ebx, eax
mov rcx, rsi
call qword [fcn.1401e168a]
test ebx, ebx
je 0x140052236
mov eax, ebx
jmp 0x140052508
mov r8, qword [rsp + 0x68]
lea rdx, [0x1401e9090]
mov rcx, rbp
call fcn.140059250
mov rbx, 0xffffffffffffffff
cmp byte [rdi + rbx + 1], r12b
lea rbx, [rbx + 1]
jne 0x140052251
lea rcx, [rbx + 1]
call qword [sub.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rsi, rax
test rax, rax
jne 0x140052283
mov rcx, qword [rsp + 0x68]
call qword [fcn.1401e168a]
mov eax, 0x1b
jmp 0x140052508
lea r8, [rbx + 1]
mov rdx, rdi
mov rcx, rsi
call sub.VCRUNTIME140.dll_memcpy
mov rdi, rsi
nop word [rax + rax]
lea rdx, [0x1401e90b0]
mov rcx, rdi
call sub.VCRUNTIME140.dll_strstr
mov rbx, rax
test rax, rax
je 0x1400522ba
mov byte [rax], r12b
lea rdx, [rdi + 8]
mov rax, 0xffffffffffffffff
inc rax
cmp byte [rdx + rax], r12b
jne 0x1400522c5
mov r8, qword [rsp + 0x28]
mov rdi, qword [rsp + 0x68]
cmp r8, rax
jne 0x1400522e9
mov rcx, rdi
call sub.VCRUNTIME140.dll_memcmp
test eax, eax
je 0x140052329
test rbx, rbx
je 0x14005230d
lea rdx, [0x1401e9080]
mov byte [rbx], 0x3b
mov rcx, rbx
call sub.VCRUNTIME140.dll_strstr
mov rdi, rax
test rax, rax
jne 0x1400522a0
mov rdi, qword [rsp + 0x68]
mov rcx, rdi
call qword [fcn.1401e168a]
mov rcx, rsi
mov qword [rsp + 0x68], r12
call qword [fcn.1401e168a]
jmp 0x140052505
mov r14d, r12d
jmp 0x14005230d
lea rdx, [0x1401e8738]
mov rcx, rdi
call fcn.14006cb50
mov r12, rax
test rax, rax
je 0x140052505
xor edx, edx
mov rcx, rax
lea r8d, [rdx + 2]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
test eax, eax
jne 0x1400524e1
mov rcx, r12
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
xor r8d, r8d
xor edx, edx
mov rcx, r12
movsxd rbx, eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
test eax, eax
jne 0x1400524e1
cmp ebx, 0x100000
ja 0x1400524e1
mov rcx, rbx
call fcn.14001c070
mov rbx, rax
cmp r15, rax
ja 0x1400524e1
lea rcx, [rax + 1]
call qword [sub.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rsi, rax
test rax, rax
je 0x1400524e1
mov r9, r12
mov r8d, 1
mov rdx, rbx
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
cmp eax, 1
jne 0x1400524e1
cmp r15, rbx
jne 0x1400523f9
mov r8, r15
mov rdx, rsi
mov rcx, r13
call sub.VCRUNTIME140.dll_memcmp
test eax, eax
jne 0x1400524e1
xor r14d, r14d
jmp 0x1400524e1
lea rdx, [0x1401e9040]
mov byte [rbx + rsi], 0
mov rcx, rsi
xor edi, edi
call sub.VCRUNTIME140.dll_strstr
test rax, rax
je 0x1400524e1
mov rbx, rax
sub rbx, rsi
je 0x140052429
cmp byte [rax - 1], 0xa
jne 0x1400524e1
add rbx, 0x1a
lea rdx, [0x1401e9060]
lea rcx, [rbx + rsi]
call sub.VCRUNTIME140.dll_strstr
mov rbp, rax
test rax, rax
je 0x1400524e1
sub rbp, rsi
mov rcx, rbp
sub rcx, rbx
inc rcx
call qword [sub.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov r14, rax
test rax, rax
je 0x1400524db
cmp rbx, rbp
jae 0x14005248c
nop dword [rax + rax]
movzx ecx, byte [rbx + rsi]
cmp cl, 0xa
je 0x140052484
cmp cl, 0xd
je 0x140052484
mov byte [rax + rdi], cl
inc rdi
inc rbx
cmp rbx, rbp
jb 0x140052470
lea r8, [rsp + 0x68]
mov byte [rax + rdi], 0
lea rdx, [rsp + 0x20]
mov rcx, r14
call fcn.140072820
mov rcx, r14
mov ebx, eax
call qword [fcn.1401e168a]
test ebx, ebx
jne 0x1400524db
cmp r15, qword [rsp + 0x68]
jne 0x1400524db
mov rdx, qword [rsp + 0x20]
mov r8, r15
mov rcx, r13
call sub.VCRUNTIME140.dll_memcmp
test eax, eax
mov r14d, 0x5a
mov eax, 0
cmove r14d, eax
jmp 0x1400524e1
mov r14d, 0x5a
mov rcx, rsi
call qword [fcn.1401e168a]
mov rcx, qword [rsp + 0x20]
call qword [fcn.1401e168a]
xor eax, eax
mov rcx, r12
mov qword [rsp + 0x20], rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov eax, r14d
mov rbx, qword [rsp + 0x60]
mov rbp, qword [rsp + 0x70]
mov rsi, qword [rsp + 0x78]
add rsp, 0x30
pop r15
pop r14
pop r13
pop r12
pop rdi
ret