Function at 0x140004fc5
Capabilities:
Read file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
mov rbx, rcx
mov rbp, rdx
mov rsi, r8
test rcx, rcx
je 0x140005077
test r8, r8
je 0x1400050aa
cmp qword [rdx], 0
je 0x140005000
cmp qword [r8], 0
je 0x1400050dd
lea rdx, [0x140011b6e]
mov rcx, rbx
call sub.msvcrt.dll_fopen
mov r12, rax
test rax, rax
je 0x140005110
mov r8d, 2
mov edx, 0
mov rcx, rax
call sub.msvcrt.dll_fseek
test eax, eax
je 0x1400051e3
mov rdi, qword [sym.imp.msvcrt.dll__errno]
call rdi
mov r9d, dword [rax]
mov r8, rbx
lea rdx, str.fs_file_read
lea rcx, str._E____s_____fseek_SEEK_END__failed_path_s_errno_d__n
call fcn.140002ef2
call rdi
mov eax, dword [rax]
cmp eax, 0x29
ja case.0x140005075.3
mov eax, eax
lea rdx, [0x140011d10]
movsxd rax, dword [rdx + rax*4]
add rax, rdx
jmp rax
mov dword [rsp + 0x20], 0x2bd
lea r9, str.C:_Projects_rdp_bot_codebase_fs.c
lea r8, str._path___NULL_
lea rdx, str.fs_file_read
lea rcx, [0x1400113e0]
call fcn.140002ef2
mov edi, 0x40000004
jmp 0x140005529
mov dword [rsp + 0x20], 0x2be
lea r9, str.C:_Projects_rdp_bot_codebase_fs.c
lea r8, str._buf_sz___NULL_
lea rdx, str.fs_file_read
lea rcx, [0x1400113e0]
call fcn.140002ef2
mov edi, 0x40000004
jmp 0x140005529
mov dword [rsp + 0x20], 0x2bf
lea r9, str.C:_Projects_rdp_bot_codebase_fs.c
lea r8, str.___buf___NULL_____buf_sz____0__
lea rdx, str.fs_file_read
lea rcx, [0x1400113e0]
call fcn.140002ef2
mov edi, 0x40000004
jmp 0x140005529
mov rdi, qword [sym.imp.msvcrt.dll__errno]
call rdi
mov r9d, dword [rax]
mov r8, rbx
lea rdx, str.fs_file_read
lea rcx, str._E____s_____fopen_failed_path_s_errno_d__n
call fcn.140002ef2
call rdi
mov eax, dword [rax]
cmp eax, 0x29
ja case.0x14000514b.3
mov eax, eax
lea rdx, [0x140011db8]
movsxd rax, dword [rdx + rax*4]
add rax, rdx
jmp rax
mov edi, 0
jmp 0x140005518
mov edi, 0x40000009
jmp 0x140005518
mov edi, 0x40000002
jmp 0x140005518
mov edi, 0x40000007
jmp 0x140005518
mov edi, 0x4000000d
jmp 0x140005518
call qword [sym.imp.msvcrt.dll__errno]
mov edi, dword [rax]
and edi, 0x1fffffff
or edi, 0x60000000
jmp 0x140005518
mov edi, 0
jmp 0x140005518
mov edi, 0x40000009
jmp 0x140005518
mov edi, 0x40000002
jmp 0x140005518
mov edi, 0x40000007
jmp 0x140005518
mov edi, 0x4000000d
jmp 0x140005518
call qword [sym.imp.msvcrt.dll__errno]
mov edi, dword [rax]
and edi, 0x1fffffff
or edi, 0x60000000
jmp 0x140005518
mov rcx, r12
call sub.msvcrt.dll_ftell
mov r13d, eax
test eax, eax
js 0x14000521b
je 0x140005513
cmp qword [rbp], 0
je 0x1400052a3
cdqe
cmp qword [rsi], rax
jae 0x1400052a3
mov qword [rsi], rax
mov edi, 0x4000000b
jmp 0x140005518
mov rdi, qword [sym.imp.msvcrt.dll__errno]
call rdi
mov r9d, dword [rax]
mov r8, rbx
lea rdx, str.fs_file_read
lea rcx, str._E____s_____ftell_failed_path_s_errno_d__n
call fcn.140002ef2
call rdi
mov eax, dword [rax]
cmp eax, 0x29
ja case.0x140005256.3
mov eax, eax
lea rdx, [0x140011e60]
movsxd rax, dword [rdx + rax*4]
add rax, rdx
jmp rax
mov edi, 0
jmp 0x140005518
mov edi, 0x40000009
jmp 0x140005518
mov edi, 0x40000002
jmp 0x140005518
mov edi, 0x40000007
jmp 0x140005518
mov edi, 0x4000000d
jmp 0x140005518
call qword [sym.imp.msvcrt.dll__errno]
mov edi, dword [rax]
and edi, 0x1fffffff
or edi, 0x60000000
jmp 0x140005518
mov r8d, 0
mov edx, 0
mov rcx, r12
call sub.msvcrt.dll_fseek
mov r14d, eax
test eax, eax
jne 0x140005331
mov rax, qword [rbp]
mov qword [rsp + 0x38], rax
test rax, rax
je 0x1400053b9
cmp qword [rsp + 0x38], 0
je 0x140005582
mov edi, 0
test edi, edi
sete r15b
cmp r14d, r13d
setl al
test r15b, r15b
je 0x14000548e
test al, al
je 0x14000548e
mov r8d, r13d
sub r8d, r14d
movsxd rcx, r14d
mov rax, qword [rsp + 0x38]
add rcx, rax
mov r9, r12
movsxd r8, r8d
mov edx, 1
call sub.msvcrt.dll_fread
test eax, eax
je 0x14000548e
js 0x1400053fc
add r14d, eax
jmp 0x1400052e0
mov rdi, qword [sym.imp.msvcrt.dll__errno]
call rdi
mov r9d, dword [rax]
mov r8, rbx
lea rdx, str.fs_file_read
lea rcx, str._E____s_____fseek_SEEK_SET__failed_path_s_errno_d__n
call fcn.140002ef2
call rdi
mov eax, dword [rax]
cmp eax, 0x29
ja case.0x14000536c.3
mov eax, eax
lea rdx, [0x140011f08]
movsxd rax, dword [rdx + rax*4]
add rax, rdx
jmp rax
mov edi, 0
jmp 0x140005518
mov edi, 0x40000009
jmp 0x140005518
mov edi, 0x40000002
jmp 0x140005518
mov edi, 0x40000007
jmp 0x140005518
mov edi, 0x4000000d
jmp 0x140005518
call qword [sym.imp.msvcrt.dll__errno]
mov edi, dword [rax]
and edi, 0x1fffffff
or edi, 0x60000000
jmp 0x140005518
movsxd rdi, r13d
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
mov r8, rdi
mov edx, 8
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x38], rax
test rax, rax
jne 0x1400052cf
mov r8, rdi
lea rdx, [0x140011c46]
lea rcx, [0x140011c50]
call fcn.140002ef2
jmp 0x1400052cf
mov rdi, qword [sym.imp.msvcrt.dll__errno]
call rdi
mov r9d, dword [rax]
mov r8, rbx
lea rdx, str.fs_file_read
lea rcx, str._E____s_____fread_failed_path_s_errno_d__n
call fcn.140002ef2
call rdi
mov eax, dword [rax]
cmp eax, 0x29
ja case.0x140005437.3
mov eax, eax
lea rdx, [0x140011fb0]
movsxd rax, dword [rdx + rax*4]
add rax, rdx
jmp rax
mov edi, 0
jmp 0x1400052e0
mov edi, 0x40000009
jmp 0x1400052e0
mov edi, 0x40000002
jmp 0x1400052e0
mov edi, 0x40000007
jmp 0x1400052e0
mov edi, 0x4000000d
jmp 0x1400052e0
call qword [sym.imp.msvcrt.dll__errno]
mov edi, dword [rax]
and edi, 0x1fffffff
or edi, 0x60000000
jmp 0x1400052e0
mov edi, 0x40000003
jmp 0x1400052e0
cmp r14d, r13d
setne al
test r15b, al
jne 0x1400054bf
test edi, edi
je 0x1400054e4
cmp qword [rbp], 0
jne 0x140005518
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
mov r8, qword [rsp + 0x38]
mov edx, 0
call qword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x140005518
mov dword [rsp + 0x20], r14d
mov r9d, r13d
mov r8, rbx
lea rdx, str.fs_file_read
lea rcx, str._E____s_____fread_undone_path_s_l_ld_n_ld__n
call fcn.140002ef2
mov edi, 0x40000001
jmp 0x14000549d
cmp qword [rbp], 0
je 0x1400054f3
movsxd r13, r13d
mov qword [rsi], r13
jmp 0x140005518
mov rax, qword [rsp + 0x38]
mov qword [rbp], rax
jmp 0x1400054eb
mov edi, 0x40000003
jmp 0x140005518
mov edi, 0x40000003
jmp 0x140005518
mov edi, 0x40000003
jmp 0x140005518
mov edi, 0
test r12, r12
je 0x140005525
mov rcx, r12
call sub.msvcrt.dll_fclose
test edi, edi
je 0x140005592
cmp edi, 0x4000000b
setne al
test rsi, rsi
setne dl
test dl, al
je 0x140005543
mov qword [rsi], 0
mov r9d, edi
and r9d, 0x3fffffff
test rbx, rbx
je 0x140005589
mov r8, rbx
lea rdx, str.fs_file_read
lea rcx, str._E____s_____Failed_path_s_err_08x__n
call fcn.140002ef2
mov eax, edi
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov edi, 0x40000003
jmp 0x140005518
mov edi, 0x40000002
jmp 0x140005518
lea rbx, [0x14001139b]
jmp 0x140005552
mov r9, qword [rsi]
mov r8, rbx
lea rdx, str.fs_file_read
lea rcx, str._I____s_____Done_path_s_buf_sz_llu__n
call fcn.140002ef2
jmp 0x140005568