Function at 0x180152860
Capabilities:
Read file on windows

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r14
sub rsp, 0x60
mov rax, qword [0x180232200]
xor rax, rsp
mov qword [rsp + 0x58], rax
mov rdi, rcx
mov ebp, r9d
add rcx, 0x148
mov r14, r8
mov rbx, rdx
call fcn.180063290
lea rcx, [rdi + 0x210]
cmp rcx, rbx
je 0x1801528b4
cmp qword [rbx + 0x18], 0xf
mov rdx, rbx
jbe 0x1801528ab
mov rdx, qword [rbx]
mov r8, qword [rbx + 0x10]
call fcn.180012bb0
cmp ebp, 2
jne 0x180152932
mov dword [rdi + 0x290], 0
mov rbp, rbx
cmp qword [rbx + 0x18], 0xf
jbe 0x1801528d0
mov rbp, qword [rbx]
mov rax, qword [rbx + 0x10]
cmp rax, 4
jb 0x180152941
lea rsi, [rax + rbp]
mov edx, 0x5f
lea r8, [rsi - 3]
mov rcx, rbp
sub r8, rbp
call sub.VCRUNTIME140.dll_memchr
test rax, rax
je 0x180152941
cmp dword [rax], 0x5f73665f
je 0x18015291d
inc rax
lea r8, [rsi - 3]
sub r8, rax
mov rcx, rax
mov edx, 0x5f
call sub.VCRUNTIME140.dll_memchr
test rax, rax
jne 0x1801528f7
jmp 0x180152941
sub rax, rbp
cmp rax, 0xffffffffffffffff
je 0x180152941
mov dword [rdi + 0x290], 1
jmp 0x180152941
cmp ebp, 1
ja 0x180152abf
mov dword [rdi + 0x290], ebp
cmp qword [rbx + 0x18], 0xf
mov rcx, rbx
jbe 0x18015294e
mov rcx, qword [rbx]
lea rdx, [rsp + 0x28]
call qword [sym.imp.api_ms_win_crt_filesystem_l1_1_0.dll__stat64i32]
mov eax, dword [rsp + 0x3c]
mov rcx, rbx
mov dword [rdi + 0x168], eax
cmp qword [rbx + 0x18], 0xf
jbe 0x180152970
mov rcx, qword [rbx]
lea rdx, [0x1801f4570]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
mov rsi, rax
test rax, rax
jne 0x1801529c1
lea rdx, str.Cannot_open_bitfile_
mov rcx, r14
call fcn.18001ba20
cmp qword [rbx + 0x18], 0xf
mov rdx, rbx
jbe 0x1801529a1
mov rdx, qword [rbx]
mov r8, qword [rbx + 0x10]
mov rcx, rax
call fcn.18001c1c0
lea rdx, [0x1801aa3c4]
mov rcx, rax
call fcn.18001ba20
jmp 0x180152af9
mov edx, dword [rdi + 0x168]
lea rcx, [rdi + 0x148]
add edx, 0x200
xor r8d, r8d
call fcn.180062bf0
test al, al
jne 0x180152a38
mov ebx, dword [rdi + 0x168]
lea rdx, str.Allocate
mov rcx, r14
call fcn.18001ba20
mov rcx, rax
lea rdx, [0x180051e70]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::ios_base____ptr64____cdecl___class_std::ios_base____ptr64_____ptr64]
mov rcx, rax
lea rdx, [0x180051ec0]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::ios_base____ptr64____cdecl___class_std::ios_base____ptr64_____ptr64]
mov rcx, rax
lea edx, [rbx + 0x200]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___unsigned_int____ptr64]
mov rcx, rax
lea rdx, str._byte_buffer_failed
call fcn.18001ba20
jmp 0x180152af9
lea rcx, [rdi + 0x148]
mov dword [rsp + 0x20], 0xffffffff
lea rdx, [rsp + 0x20]
call fcn.1801516c0
xor r8d, r8d
xor edx, edx
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
mov r8d, dword [rdi + 0x168]
mov r9, rsi
mov rcx, qword [rdi + 0x148]
mov edx, 1
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov rcx, rsi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
lea rdx, [rdi + 0x148]
mov r8, r14
lea rcx, [rdi + 0x170]
call fcn.18014a540
test al, al
je 0x180152af9
mov rcx, rdi
call fcn.180152b80
test al, al
jne 0x180152abb
lea rdx, str.Device_not_recognized
mov rcx, r14
call fcn.18001ba20
jmp 0x180152af9
mov al, 1
jmp 0x180152afb
lea rdx, str.Invalid_flash_block_ID
mov rcx, r14
call fcn.18001ba20
mov rcx, rax
lea rdx, [0x180051e70]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::ios_base____ptr64____cdecl___class_std::ios_base____ptr64_____ptr64]
mov rcx, rax
lea rdx, [0x180051ec0]
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::ios_base____ptr64____cdecl___class_std::ios_base____ptr64_____ptr64]
mov rcx, rax
mov edx, ebp
call qword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______ptr64___cdecl_std::basic_ostream_char__struct_std::char_traits_char__::operator___int____ptr64]
xor al, al
mov rcx, qword [rsp + 0x58]
xor rcx, rsp
call fcn.180187870
add rsp, 0x60
pop r14
pop rdi
pop rsi
pop rbp
pop rbx
ret