Function at 0x1400017f0
Capabilities:
Read file on windows

Disassembly:
mov qword [rsp + 8], rcx
push rbx
push rbp
push rsi
sub rsp, 0x60
mov r9d, edx
xor ebx, ebx
mov rsi, rcx
lea rax, [r9 + r8]
mov ebp, edx
mov qword [rsp + 0x30], 0
cmp rax, qword [0x140008f78]
mov dword [rsp + 0x90], ebx
mov qword [rsp + 0x28], r9
jle 0x140001832
xor eax, eax
add rsp, 0x60
pop rsi
pop rbp
pop rbx
ret
movzx ecx, byte [0x140008f64]
mov rax, qword [0x140008f68]
mov rdx, r8
sar rdx, cl
mov ecx, dword [0x140008f60]
mov qword [rsp + 0x58], rdi
lea rdx, [rax + rdx*4]
lea r10d, [rcx - 1]
and r10d, r8d
mov qword [rsp + 0x20], rdx
lea eax, [r10 + r9]
mov dword [rsp + 0x98], r10d
cmp eax, ecx
jbe 0x140001891
mov ebp, ecx
mov ebx, r9d
sub ebp, r10d
mov eax, ebp
sub ebx, ebp
mov qword [rsp + 0x28], rax
add rax, r8
mov dword [rsp + 0x90], ebx
mov qword [rsp + 0x30], rax
lea edi, [rbp + 7]
shr edi, 3
cmp byte [0x140008914], 0
je 0x1400018c3
mov rcx, qword [0x140008908]
mov r9, rdx
lea rdx, [rsp + 0x88]
mov r8d, 4
call qword [0x140008f80]
mov r11d, eax
jmp 0x140001928
mov esi, dword [0x140008320]
xor r8d, r8d
mov ecx, esi
call qword [sym.imp.msvcrt.dll__lseeki64]
cmp rax, qword [rsp + 0x20]
je 0x1400018e1
or r11d, 0xffffffff
jmp 0x140001920
lea rdx, [rsp + 0x88]
mov r8d, 4
mov ecx, esi
call qword [sym.imp.msvcrt.dll__read]
movsxd r11, eax
cmp r11d, 3
ja 0x140001920
mov eax, 4
lea rcx, [rsp + r11 + 0x88]
xor edx, edx
sub eax, r11d
movsxd r8, eax
call sub.msvcrt.dll_memset
mov r11d, 4
mov rsi, qword [rsp + 0x80]
cmp r11d, 4
je 0x140001945
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.vhd_write:_Error_reading_block_table:__m_n
add rcx, 0x60
jmp 0x140001cb2
mov ecx, dword [rsp + 0x88]
cmp ecx, 0xffffffff
jne 0x140001ba9
mov rcx, rsi
lea rdx, [rsi + rdi*8]
nop dword [rax]
cmp rcx, rdx
jb 0x140001977
xor eax, eax
cmp qword [rcx], rax
sete al
test eax, eax
je 0x140001977
add rcx, 8
jmp 0x140001960
cmp rcx, rdx
jb 0x1400019ae
test ebx, ebx
je 0x14000199f
mov rcx, qword [rsp + 0x28]
mov r8, qword [rsp + 0x30]
mov edx, ebx
add rcx, rsi
call fcn.1400017f0
cmp eax, 0xffffffff
je 0x140001cce
add ebp, eax
mov eax, ebp
mov rdi, qword [rsp + 0x58]
add rsp, 0x60
pop rsi
pop rbp
pop rbx
ret
mov ecx, dword [0x140008f60]
mov eax, dword [0x140008334]
add ecx, eax
add rcx, 0x200
call qword [sym.imp.msvcrt.dll_malloc]
mov rbx, rax
mov qword [rsp + 0x38], rax
test rax, rax
jne 0x1400019fd
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.vhd_write:_Error_allocating_memory_buffer_for_new_block:__m_n
add rcx, 0x60
call section..text
mov rdi, qword [rsp + 0x58]
or eax, 0xffffffff
add rsp, 0x60
pop rsi
pop rbp
pop rbx
ret
mov ecx, dword [0x140008320]
mov rdx, 0xfffffffffffffe00
mov r8d, 2
call qword [sym.imp.msvcrt.dll__lseeki64]
mov qword [rsp + 0x40], rax
cmp rax, 0xffffffffffffffff
jne 0x140001a51
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.vhd_write:_Error_moving_file_pointer_to_last_block:__m_n
add rcx, 0x60
call section..text
mov rcx, rbx
call qword [sym.imp.msvcrt.dll_free]
mov rdi, qword [rsp + 0x58]
or eax, 0xffffffff
add rsp, 0x60
pop rsi
pop rbp
pop rbx
ret
movzx ecx, byte [0x140008f70]
sar rax, cl
mov ecx, eax
call qword [sym.imp.WS2_32.dll_htonl]
cmp byte [0x140008914], 0
mov dword [rsp + 0x88], eax
je 0x140001a95
mov r9, qword [rsp + 0x20]
mov rcx, qword [0x140008908]
lea rdx, [rsp + 0x88]
mov r8d, 4
call qword [0x140008f88]
jmp 0x140001ab3
mov r9, qword [rsp + 0x20]
mov ecx, dword [0x140008320]
lea rdx, [rsp + 0x88]
mov r8d, 4
call fcn.140001100
cmp eax, 4
je 0x140001add
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.vhd_write:_Error_updating_BAT:__m_n
add rcx, 0x60
call section..text
mov rcx, rbx
call qword [sym.imp.msvcrt.dll_free]
jmp 0x140001cb7
mov ebx, dword [0x140008334]
mov edi, dword [0x140008f60]
mov rcx, qword [rsp + 0x38]
lea esi, [rbx + rdi]
xor edx, edx
mov r8d, esi
call sub.msvcrt.dll_memset
mov r11, rbx
mov rbx, qword [rsp + 0x38]
lea rcx, [rbx + r11]
lea rdx, [0x140008960]
mov r8d, 0x200
add rcx, rdi
call sub.msvcrt.dll_memcpy
cmp byte [0x140008914], 0
lea r8d, [rsi + 0x200]
je 0x140001b46
mov r9, qword [rsp + 0x40]
mov rcx, qword [0x140008908]
mov rdx, rbx
call qword [0x140008f88]
mov r11d, eax
jmp 0x140001b5c
mov r9, qword [rsp + 0x40]
mov ecx, dword [0x140008320]
mov rdx, rbx
call fcn.140001100
mov r11d, eax
mov ecx, dword [0x140008f60]
mov eax, dword [0x140008334]
lea ecx, [rax + rcx + 0x200]
cmp r11d, ecx
je 0x140001b99
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.vhd_write:_Error_writing_new_block:__m_n
add rcx, 0x60
call section..text
mov rcx, rbx
call qword [sym.imp.msvcrt.dll_free]
jmp 0x140001cb7
mov rcx, rbx
call qword [sym.imp.msvcrt.dll_free]
mov ecx, dword [rsp + 0x88]
call qword [sym.imp.WS2_32.dll_ntohl]
movzx ecx, byte [0x140008f70]
mov esi, dword [rsp + 0x98]
mov r9d, dword [0x140008334]
mov dword [rsp + 0x88], eax
mov eax, eax
shl rax, cl
add rax, rsi
add r9, rax
cmp byte [0x140008914], 0
je 0x140001bfb
mov rdx, qword [rsp + 0x80]
mov rcx, qword [0x140008908]
mov r8d, ebp
call qword [0x140008f88]
mov ebx, eax
jmp 0x140001c13
mov rdx, qword [rsp + 0x80]
mov ecx, dword [0x140008320]
mov r8d, ebp
call fcn.140001100
mov ebx, eax
cmp ebx, 0xffffffff
je 0x140001cce
movsx eax, word [0x140008f70]
movzx ecx, al
mov edx, eax
mov eax, dword [rsp + 0x88]
shr rsi, cl
mov ecx, edx
mov edx, 0xff
shl rax, cl
shr rsi, 3
add rsi, rax
mov eax, dword [0x140008334]
lea edi, [rax + rbp - 1]
mov rbp, qword [0x140008938]
shr edi, cl
mov rcx, rbp
add edi, 7
shr edi, 3
mov r8d, edi
call sub.msvcrt.dll_memset
cmp byte [0x140008914], 0
je 0x140001c88
mov rcx, qword [0x140008908]
mov r9, rsi
mov r8d, edi
mov rdx, rbp
call qword [0x140008f88]
jmp 0x140001c9c
mov ecx, dword [0x140008320]
mov r9, rsi
mov r8d, edi
mov rdx, rbp
call fcn.140001100
cmp eax, edi
je 0x140001cde
mov rcx, qword [sym.imp.msvcrt.dll__iob]
lea rdx, str.vhd_write:_Error_updating_block_bitmap:__m_n
add rcx, 0x60
call section..text
call qword [sym.imp.msvcrt.dll__errno]
cmp dword [rax], 0
jne 0x140001cce
call qword [sym.imp.msvcrt.dll__errno]
mov dword [rax], 7
or eax, 0xffffffff
mov rdi, qword [rsp + 0x58]
add rsp, 0x60
pop rsi
pop rbp
pop rbx
ret
mov edx, dword [rsp + 0x90]
test edx, edx
je 0x140001d0a
mov rax, qword [rsp + 0x80]
mov rcx, qword [rsp + 0x28]
mov r8, qword [rsp + 0x30]
add rcx, rax
call fcn.1400017f0
cmp eax, 0xffffffff
je 0x140001cce
add ebx, eax
mov eax, ebx
mov rdi, qword [rsp + 0x58]
add rsp, 0x60
pop rsi
pop rbp
pop rbx
ret