Function at 0x140005c90
Capabilities:
Read file on windows

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r13
push r14
lea rbp, [rsp - 0x18]
sub rsp, 0x118
mov rax, qword [0x140014098]
xor rax, rsp
mov qword [rbp], rax
xor eax, eax
mov r13, rdx
xor edi, edi
mov qword [rbp - 0x68], rax
lea rdx, [0x1400114b8]
mov qword [rbp - 0x60], rax
mov qword [rbp - 0x58], rax
mov ebx, edi
mov qword [rbp - 0x50], rax
mov r14, rcx
mov dword [rbp - 0x48], eax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov rsi, rax
test rax, rax
jne 0x140005d09
lea ecx, [rdi + 2]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov r8, r14
lea rdx, str.Failed_to_open__s_for_reading___n
mov rcx, rax
call fcn.140002170
xor eax, eax
jmp 0x140005efc
xor r8d, r8d
xor edx, edx
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
lea rax, [rsp + 0x68]
mov rcx, rsi
mov qword [rsp + 0x50], rax
lea r9, [rsp + 0x61]
lea rax, [rbp - 0x40]
mov qword [rsp + 0x48], rax
lea r8, [rbp - 0x40]
lea rax, [rsp + 0x64]
mov qword [rsp + 0x40], rax
lea rdx, str.PG_31___t__c_c_31___t___d_31___t__d_31___t__d
lea rax, [rbp - 0x40]
mov qword [rsp + 0x38], rax
lea rax, [rsp + 0x70]
mov qword [rsp + 0x30], rax
lea rax, [rbp - 0x20]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x60]
mov qword [rsp + 0x20], rax
call fcn.140005c40
cmp eax, 9
je 0x140005da1
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
lea rdx, str.ERROR:_Failed_to_read_the_right_number_of_element_from_the_fscanf___function__n
call fcn.140002170
xor eax, eax
jmp 0x140005efc
movzx edx, byte [rbp - 0x20]
mov r14b, 0x2b
test dl, dl
je 0x140005dda
lea rcx, [rbp - 0x20]
mov r8d, 0x2d
nop word [rax + rax]
movzx eax, byte [rcx + 1]
lea rcx, [rcx + 1]
cmp dl, r8b
movzx r14d, r14b
movzx edx, al
cmove r14d, r8d
test al, al
jne 0x140005dc0
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fgetc]
movzx ecx, byte [rsp + 0x61]
movzx eax, byte [rsp + 0x60]
cmp cl, 0x4d
jne 0x140005e00
cmp al, 0x4c
jne 0x140005e00
mov dword [rsp + 0x78], 1
jmp 0x140005e15
cmp al, 0x4d
jne 0x14000612e
cmp cl, 0x4c
jne 0x14000612e
mov dword [rsp + 0x78], edi
movsxd r8, dword [rsp + 0x64]
cmp r8d, 1
jl 0x14000612e
movsxd r9, dword [rsp + 0x68]
cmp r9d, 1
jl 0x14000612e
mov ecx, dword [rsp + 0x70]
lea eax, [rcx - 1]
cmp eax, 0x1e
ja 0x14000612e
mov qword [rsp + 0x110], r15
cmp ecx, 0x10
jle 0x140005e57
mov edx, 4
jmp 0x140005e63
cmp ecx, 8
mov rdx, rdi
setg dl
inc rdx
mov r15, r8
mov qword [rsp + 0x160], r12
imul r15, r9
imul r15, rdx
cmp r15, 0x989680
jbe 0x140005f35
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
mov r12d, eax
mov rcx, rsi
mov eax, 0x7fffffff
cmp r15, rax
cmova r15, rax
xor r8d, r8d
lea edx, [r15 - 1]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
mov edx, 1
lea rcx, [rsp + 0x6c]
mov r8d, edx
mov r9, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
cmp rax, 1
je 0x140005f18
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
lea rdx, str.File_too_short_n
call fcn.140002170
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
xor eax, eax
mov r12, qword [rsp + 0x160]
mov r15, qword [rsp + 0x110]
mov rcx, qword [rbp]
xor rcx, rsp
call fcn.14000cdb0
add rsp, 0x118
pop r14
pop r13
pop rdi
pop rsi
pop rbx
pop rbp
ret
xor r8d, r8d
mov edx, r12d
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
mov r9d, dword [rsp + 0x68]
mov r8d, dword [rsp + 0x64]
mov ecx, dword [rsp + 0x70]
mov r10d, dword [r13 + 0x470c]
lea eax, [r8 - 1]
mov r11d, dword [r13 + 0x4714]
mov edx, dword [r13 + 0x4710]
imul eax, r11d
mov dword [rbp - 0x58], r10d
mov dword [rbp - 0x54], edx
inc eax
test r10d, r10d
je 0x140005f63
add eax, r10d
mov r8d, dword [r13 + 0x4718]
mov dword [rbp - 0x60], eax
lea eax, [r9 - 1]
imul eax, r8d
inc eax
test edx, edx
je 0x140005f7d
add eax, edx
mov dword [rbp - 0x5c], eax
cmp r14b, 0x2d
mov eax, edi
sete al
mov dword [rbp - 0x48], eax
cmp ecx, 8
jge 0x140005fd8
mov r14d, 8
mov r12d, ecx
sub r14d, ecx
sub r12d, r14d
mov dword [rbp - 0x80], r14d
mov dword [rsp + 0x7c], r12d
test eax, eax
je 0x140005fba
dec ecx
mov r13d, 1
shl r13d, cl
jmp 0x140005fbd
mov r13d, edi
mov ecx, 8
mov dword [rsp + 0x74], r13d
mov dword [rsp + 0x70], ecx
mov dword [rbp - 0x48], edi
mov qword [rbp - 0x78], 1
jmp 0x140005fea
mov r13d, edi
mov dword [rsp + 0x74], edi
mov dword [rsp + 0x7c], edi
mov dword [rbp - 0x80], edi
mov qword [rbp - 0x78], rdi
mov dword [rbp - 0x64], r8d
lea rdx, [rbp - 0x68]
mov r8d, 2
mov dword [rbp - 0x50], ecx
mov dword [rbp - 0x4c], ecx
mov dword [rbp - 0x68], r11d
lea ecx, [r8 - 1]
call sub.openjp2.dll_opj_image_create
mov qword [rbp - 0x70], rax
mov r15, rax
test rax, rax
je 0x140005ee1
mov eax, dword [rbp - 0x58]
mov r12d, edi
mov r14, qword [r15 + 0x18]
mov dword [r15], eax
mov eax, dword [rbp - 0x58]
mov dword [r15 + 4], eax
mov eax, dword [rbp - 0x60]
mov dword [r15 + 8], eax
mov eax, dword [rbp - 0x5c]
mov dword [r15 + 0xc], eax
mov eax, dword [rsp + 0x64]
imul eax, dword [rsp + 0x68]
test eax, eax
jle 0x140006108
mov r15, rdi
mov edi, dword [rsp + 0x78]
cmp qword [rbp - 0x78], 0
mov rcx, rsi
je 0x140006094
call fcn.140007290
mov ecx, dword [rsp + 0x7c]
movzx edx, al
mov rax, qword [r14 + 0x30]
add edx, r13d
mov r8d, edx
sar r8d, cl
mov ecx, dword [rbp - 0x80]
shl edx, cl
add r8d, edx
cmp r8d, ebx
movzx ecx, r8b
mov dword [r15 + rax], ecx
cmovle r8d, ebx
mov ebx, r8d
jmp 0x1400060e9
mov eax, dword [r14 + 0x18]
mov r13d, dword [r14 + 0x20]
cmp eax, 8
jne 0x1400060b4
call fcn.140007290
movzx edx, al
test r13d, r13d
movsx eax, dl
cmovne edx, eax
jmp 0x1400060d5
mov edx, edi
cmp eax, 0x10
ja 0x1400060ce
call fcn.1400073f0
movzx edx, ax
test r13d, r13d
movsx eax, dx
cmovne edx, eax
jmp 0x1400060d5
call fcn.1400072e0
mov edx, eax
mov rcx, qword [r14 + 0x30]
cmp edx, ebx
mov r13d, dword [rsp + 0x74]
mov dword [r15 + rcx], edx
cmovle edx, ebx
mov ebx, edx
mov eax, dword [rsp + 0x64]
inc r12d
imul eax, dword [rsp + 0x68]
add r15, 4
cmp r12d, eax
jl 0x140006055
mov r15, qword [rbp - 0x70]
xor edi, edi
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
cmp ebx, 1
jle 0x14000611f
sar ebx, 1
inc edi
cmp ebx, 1
jg 0x140006116
lea eax, [rdi + 1]
mov dword [r14 + 0x1c], eax
mov rax, r15
jmp 0x140005eec
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov ecx, 2
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov rcx, rax
lea rdx, str.Bad_pgx_header__please_check_input_file_n
call fcn.140002170
xor eax, eax
jmp 0x140005efc