Function at 0x402560
Capabilities:
Read file on windows

Disassembly:
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x50
movzx esi, byte [rcx + 0x86]
mov rbx, rcx
mov byte [rcx + 0x86], 0
lea rcx, [rcx + 0x7c]
mov edi, edx
mov ebp, r8d
xor edx, edx
mov r8d, 0xa
call sub.msvcrt.dll_strtoul
test eax, eax
mov byte [rbx + 0x86], sil
js 0x4026f5
lea esi, [rax + 1]
mov eax, dword [rbx + 0x40]
and esi, 0xfffffffe
test ebp, ebp
lea eax, [rsi + rax + 0x3c]
mov dword [rbx + 0x40], eax
je 0x402621
cmp edi, 8
ja 0x402670
cmp esi, edi
jb 0x402610
lea r12, [rsp + 0x48]
mov r9, qword [rbx + 8]
mov ebp, edi
mov r8, rbp
mov edx, 1
mov rcx, r12
call sub.msvcrt.dll_fread
cmp rbp, rax
je 0x4026b4
mov rdx, qword [rbx]
lea rcx, str._s:_failed_to_read_archive_index_n
call fcn.004023d0
xor eax, eax
add rsp, 0x50
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov rdx, qword [rbx]
lea rcx, str._s:_the_archive_index_is_empty_n
call fcn.004023d0
jmp 0x4025f8
mov rcx, qword [rbx + 8]
mov r8d, 1
mov edx, esi
call sub.msvcrt.dll_fseek
test eax, eax
jne 0x402710
mov r9, qword [rbx + 8]
lea rcx, [rbx + 0x4c]
mov r8d, 0x3c
mov edx, 1
call sub.msvcrt.dll_fread
cmp rax, 0x3c
je 0x4026a0
test rax, rax
je 0x4026a0
mov rdx, qword [rbx]
lea rcx, str._s:_failed_to_read_archive_header_following_archive_index_n
call fcn.004023d0
xor eax, eax
jmp 0x4025fa
lea rdx, str._builds_idf_crosstool_NG_.build_HOST_x86_64_w64_mingw32_riscv32_esp_elf_src_binutils_binutils_elfcomm.c
lea rcx, str.sizeof_ar_index___sizeof_integer_buffer
mov r8d, 0x1fd
call fcn.00406550
cmp esi, edi
jae 0x4025c5
jmp 0x402610
mov eax, 1
add rsp, 0x50
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov rcx, r12
sub esi, edi
mov edx, edi
call fcn.00402450
mov rcx, rbp
mov r8, rax
mov qword [rbx + 0x10], rax
mov eax, esi
imul rcx, r8
cmp r8, rax
ja 0x4026da
cmp rax, rcx
jae 0x402730
mov rdx, qword [rbx]
lea rcx, str._s:_the_archive_index_is_supposed_to_have_0x_lx_entries_of__d_bytes__but_the_size_is_only_0x_lx_n
mov dword [rsp + 0x20], esi
mov r9d, edi
call fcn.004023d0
jmp 0x4025f8
mov rdx, qword [rbx]
lea rcx, str._s:_invalid_archive_header_size:__ld_n
mov r8d, eax
call fcn.004023d0
xor eax, eax
jmp 0x4025fa
mov rdx, qword [rbx]
lea rcx, str._s:_failed_to_skip_archive_symbol_table_n
call fcn.004023d0
xor eax, eax
jmp 0x4025fa
mov qword [rsp + 0x38], r8
call sub.msvcrt.dll_malloc
test rax, rax
mov r12, rax
mov r8, qword [rsp + 0x38]
je 0x4027e7
mov r9, qword [rbx + 8]
mov rdx, rbp
mov rcx, rax
call sub.msvcrt.dll_fread
cmp rax, qword [rbx + 0x10]
mov rbp, rax
je 0x402770
mov rcx, r12
call sub.msvcrt.dll_free
jmp 0x4025e9
mov eax, edi
lea rcx, [rbp*8]
imul eax, ebp
sub esi, eax
call sub.msvcrt.dll_malloc
test rax, rax
mov qword [rbx + 0x18], rax
je 0x40283f
test rbp, rbp
je 0x4027c7
xor r13d, r13d
xor edx, edx
xor ebp, ebp
jmp 0x4027a4
mov rax, qword [rbx + 0x18]
lea r14, [rax + rdx*8]
mov ecx, r13d
mov edx, edi
add rcx, r12
add r13d, edi
call fcn.00402450
lea edx, [rbp + 1]
mov qword [r14], rax
cmp rdx, qword [rbx + 0x10]
mov rbp, rdx
jb 0x4027a0
mov rcx, r12
call sub.msvcrt.dll_free
test esi, esi
jne 0x4027f8
mov rdx, qword [rbx]
lea rcx, str._s:_the_archive_has_an_index_but_no_symbols_n
call fcn.004023d0
jmp 0x4025f8
lea rcx, str.Out_of_memory_whilst_trying_to_read_archive_symbol_index_n
call fcn.004023d0
jmp 0x4025f8
mov edi, esi
mov rcx, rdi
call sub.msvcrt.dll_malloc
test rax, rax
mov qword [rbx + 0x20], rax
je 0x402858
mov r9, qword [rbx + 8]
mov dword [rbx + 0x28], esi
mov r8, rdi
mov edx, 1
mov rcx, rax
call sub.msvcrt.dll_fread
cmp rdi, rax
je 0x40263a
mov rdx, qword [rbx]
lea rcx, str._s:_failed_to_read_archive_index_symbol_table_n
call fcn.004023d0
jmp 0x4025f8
mov rcx, r12
call sub.msvcrt.dll_free
lea rcx, str.Out_of_memory_whilst_trying_to_convert_the_archive_symbol_index_n
call fcn.004023d0
jmp 0x4025f8
lea rcx, str.Out_of_memory_whilst_trying_to_read_archive_index_symbol_table_n
call fcn.004023d0
jmp 0x4025f8