Function at 0x3bc1c6a55
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 0x3bc1c6b07
test r8, r8
je 0x3bc1c6b3a
cmp qword [rdx], 0
je 0x3bc1c6a90
cmp qword [r8], 0
je 0x3bc1c6b6d
lea rdx, [0x3bc1d683e]
mov rcx, rbx
call sub.msvcrt.dll_fopen
mov r12, rax
test rax, rax
je 0x3bc1c6ba0
mov r8d, 2
mov edx, 0
mov rcx, rax
call sub.msvcrt.dll_fseek
test eax, eax
je 0x3bc1c6cb8
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.3bc1c1292
call rdi
mov eax, dword [rax]
cmp eax, 0x29
ja case.0x3bc1c6b05.3
mov eax, eax
lea rdx, [0x3bc1d69e0]
movsxd rax, dword [rdx + rax*4]
add rax, rdx
jmp rax
mov dword [rsp + 0x20], 0x2bd
lea r9, str.H:_Projects_rdp_bot_codebase_fs.c
lea r8, [0x3bc1d6092]
lea rdx, str.fs_file_read
lea rcx, [0x3bc1d60b0]
call fcn.3bc1c1292
mov edi, 0x40000004
jmp 0x3bc1c6c62
mov dword [rsp + 0x20], 0x2be
lea r9, str.H:_Projects_rdp_bot_codebase_fs.c
lea r8, [0x3bc1d6805]
lea rdx, str.fs_file_read
lea rcx, [0x3bc1d60b0]
call fcn.3bc1c1292
mov edi, 0x40000004
jmp 0x3bc1c6c62
mov dword [rsp + 0x20], 0x2bf
lea r9, str.H:_Projects_rdp_bot_codebase_fs.c
lea r8, str.___buf___NULL_____buf_sz____0__
lea rdx, str.fs_file_read
lea rcx, [0x3bc1d60b0]
call fcn.3bc1c1292
mov edi, 0x40000004
jmp 0x3bc1c6c62
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.3bc1c1292
call rdi
mov eax, dword [rax]
cmp eax, 0x29
ja case.0x3bc1c6bdb.3
mov eax, eax
lea rdx, [0x3bc1d6a88]
movsxd rax, dword [rdx + rax*4]
add rax, rdx
jmp rax
mov edi, 0
jmp 0x3bc1c6c4d
mov edi, 0x40000009
jmp 0x3bc1c6c4d
mov edi, 0x40000002
jmp 0x3bc1c6c4d
mov edi, 0x40000007
jmp 0x3bc1c6c4d
mov edi, 0x4000000d
jmp 0x3bc1c6c4d
call qword [sym.imp.msvcrt.dll__errno]
mov edi, dword [rax]
and edi, 0x1fffffff
or edi, 0x60000000
jmp 0x3bc1c6c4d
mov edi, 0
jmp 0x3bc1c6c4d
mov edi, 0x40000009
jmp 0x3bc1c6c4d
mov edi, 0x40000002
jmp 0x3bc1c6c4d
mov edi, 0x40000007
jmp 0x3bc1c6c4d
mov edi, 0x4000000d
jmp 0x3bc1c6c4d
call qword [sym.imp.msvcrt.dll__errno]
mov edi, dword [rax]
and edi, 0x1fffffff
or edi, 0x60000000
test r12, r12
je 0x3bc1c6c5a
mov rcx, r12
call sub.msvcrt.dll_fclose
test edi, edi
je 0x3bc1c7007
cmp edi, 0x4000000b
setne al
test rsi, rsi
setne dl
test dl, al
je 0x3bc1c6c7c
mov qword [rsi], 0
mov r9d, edi
and r9d, 0x3fffffff
test rbx, rbx
je 0x3bc1c6ffb
mov r8, rbx
lea rdx, str.fs_file_read
lea rcx, [0x3bc1d6130]
call fcn.3bc1c1292
mov eax, edi
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rcx, r12
call sub.msvcrt.dll_ftell
mov r13d, eax
test eax, eax
js 0x3bc1c6cf0
je 0x3bc1c6fdd
cmp qword [rbp], 0
je 0x3bc1c6d78
cdqe
cmp qword [rsi], rax
jae 0x3bc1c6d78
mov qword [rsi], rax
mov edi, 0x4000000b
jmp 0x3bc1c6c4d
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.3bc1c1292
call rdi
mov eax, dword [rax]
cmp eax, 0x29
ja case.0x3bc1c6d2b.3
mov eax, eax
lea rdx, [0x3bc1d6b30]
movsxd rax, dword [rdx + rax*4]
add rax, rdx
jmp rax
mov edi, 0
jmp 0x3bc1c6c4d
mov edi, 0x40000009
jmp 0x3bc1c6c4d
mov edi, 0x40000002
jmp 0x3bc1c6c4d
mov edi, 0x40000007
jmp 0x3bc1c6c4d
mov edi, 0x4000000d
jmp 0x3bc1c6c4d
call qword [sym.imp.msvcrt.dll__errno]
mov edi, dword [rax]
and edi, 0x1fffffff
or edi, 0x60000000
jmp 0x3bc1c6c4d
mov r8d, 0
mov edx, 0
mov rcx, r12
call sub.msvcrt.dll_fseek
mov r14d, eax
test eax, eax
jne 0x3bc1c6dba
mov rax, qword [rbp]
mov qword [rsp + 0x38], rax
test rax, rax
je 0x3bc1c6e42
cmp qword [rsp + 0x38], 0
je 0x3bc1c6ff1
mov edi, 0
jmp 0x3bc1c6ef9
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.3bc1c1292
call rdi
mov eax, dword [rax]
cmp eax, 0x29
ja case.0x3bc1c6df5.3
mov eax, eax
lea rdx, [0x3bc1d6bd8]
movsxd rax, dword [rdx + rax*4]
add rax, rdx
jmp rax
mov edi, 0
jmp 0x3bc1c6c4d
mov edi, 0x40000009
jmp 0x3bc1c6c4d
mov edi, 0x40000002
jmp 0x3bc1c6c4d
mov edi, 0x40000007
jmp 0x3bc1c6c4d
mov edi, 0x4000000d
jmp 0x3bc1c6c4d
call qword [sym.imp.msvcrt.dll__errno]
mov edi, dword [rax]
and edi, 0x1fffffff
or edi, 0x60000000
jmp 0x3bc1c6c4d
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 0x3bc1c6da4
mov r8, rdi
lea rdx, [0x3bc1d6916]
lea rcx, [0x3bc1d6920]
call fcn.3bc1c1292
jmp 0x3bc1c6da4
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.3bc1c1292
call rdi
mov eax, dword [rax]
cmp eax, 0x29
ja case.0x3bc1c6ec0.3
mov eax, eax
lea rdx, [0x3bc1d6c80]
movsxd rax, dword [rdx + rax*4]
add rax, rdx
jmp rax
mov edi, 0
jmp 0x3bc1c6ef9
mov edi, 0x40000009
jmp 0x3bc1c6ef9
mov edi, 0x40000002
jmp 0x3bc1c6ef9
mov edi, 0x40000007
jmp 0x3bc1c6ef9
mov edi, 0x4000000d
jmp 0x3bc1c6ef9
call qword [sym.imp.msvcrt.dll__errno]
mov edi, dword [rax]
and edi, 0x1fffffff
or edi, 0x60000000
test edi, edi
sete r15b
cmp r14d, r13d
setl al
test r15b, r15b
je 0x3bc1c6f45
test al, al
je 0x3bc1c6f45
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 0x3bc1c6f45
js 0x3bc1c6e85
add r14d, eax
jmp 0x3bc1c6ef9
mov edi, 0x40000003
jmp 0x3bc1c6ef9
cmp r14d, r13d
setne al
test r15b, al
jne 0x3bc1c6f7d
test edi, edi
je 0x3bc1c6fa2
cmp qword [rbp], 0
jne 0x3bc1c6c4d
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 0x3bc1c6c4d
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.3bc1c1292
mov edi, 0x40000001
jmp 0x3bc1c6f54
cmp qword [rbp], 0
je 0x3bc1c6fb4
movsxd r13, r13d
mov qword [rsi], r13
jmp 0x3bc1c6c4d
mov rax, qword [rsp + 0x38]
mov qword [rbp], rax
jmp 0x3bc1c6fa9
mov edi, 0x40000003
jmp 0x3bc1c6c4d
mov edi, 0x40000003
jmp 0x3bc1c6c4d
mov edi, 0x40000003
jmp 0x3bc1c6c4d
mov edi, 0
jmp 0x3bc1c6c4d
mov edi, 0x40000003
jmp 0x3bc1c6c4d
mov edi, 0x40000002
jmp 0x3bc1c6c4d
lea rbx, [0x3bc1d606b]
jmp 0x3bc1c6c8f
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.3bc1c1292
jmp 0x3bc1c6ca5