Function at 0x1004a7ae0
Capabilities:
Get file attributes

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x138
lea rbp, [rsp + 0x80]
mov dword [sym.bash.exe_history_lines_written_to_file], 0
mov esi, edx
call fcn.1004a7100
mov r13, rax
test rax, rax
je 0x1004a7ce0
mov r8d, 0x1b6
mov edx, 0x10000
mov rcx, rax
call sub.msys_2.0.dll_open
mov r12d, eax
cmp eax, 0xffffffff
je 0x1004a7f70
lea rdx, [rbp - 0x50]
mov ecx, eax
call sub.msys_2.0.dll_fstat
cmp eax, 0xffffffff
je 0x1004a7c10
mov rax, qword [rbp - 0x38]
mov qword [rbp + 0x48], rax
mov eax, dword [rbp - 0x40]
and eax, 0xf000
cmp eax, 0x8000
jne 0x1004a7e20
mov rbx, qword [rbp - 0x28]
cmp rbx, 0xffffffffffffffff
je 0x1004a7e80
lea rcx, [rbx + 1]
call fcn.1004d2f30
mov r15, rax
test rax, rax
je 0x1004a7fbf
mov ecx, r12d
mov r8, rbx
mov rdx, rax
call sub.msys_2.0.dll_read
mov ecx, r12d
mov rdi, rax
call fcn.1004d2aa0
test edi, edi
jle 0x1004a7c90
movsxd rdi, edi
lea rdx, [r15 + rdi - 1]
mov r12, rdx
test esi, esi
je 0x1004a7f96
cmp r15, rdx
jae 0x1004a7f96
mov rcx, qword [sym.bash.exe_history_comment_char]
mov r14d, esi
jmp 0x1004a7bf5
lea rbx, [r12 - 1]
mov rdx, r12
test r14d, r14d
je 0x1004a7d08
cmp r15, rbx
jae 0x1004a7d08
mov r12, rbx
cmp byte [r12], 0xa
jne 0x1004a7bd8
movzx eax, byte [rcx]
cmp byte [rdx], al
je 0x1004a7e48
sub r14d, 1
jmp 0x1004a7bd8
call sub.msys_2.0.dll___errno
mov ecx, r12d
mov r14d, dword [rax]
call fcn.1004d2aa0
neg esi
mov dword [sym.bash.exe_history_lines_written_to_file], esi
xor esi, esi
test r14d, r14d
je 0x1004a7cd0
call sub.msys_2.0.dll___errno
mov r14d, dword [rax]
mov dword [sym.bash.exe_history_lines_written_to_file], 0
test r14d, r14d
jne 0x1004a7cd0
xor ebx, ebx
test sil, sil
je 0x1004a7cd0
mov rax, qword [rbp + 0x48]
xor r14d, r14d
cmp qword [rbp - 0x38], rax
jne 0x1004a7cb8
mov rcx, r13
call sym.bash.exe_xfree
test rbx, rbx
je 0x1004a7c77
mov rcx, rbx
call fcn.1004d2c80
mov eax, r14d
add rsp, 0x138
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
neg esi
test edi, edi
jne 0x1004a7e95
mov rcx, r15
call fcn.1004d2c80
mov dword [sym.bash.exe_history_lines_written_to_file], esi
mov rax, qword [rbp + 0x48]
cmp qword [rbp - 0x38], rax
je 0x1004a7e70
xor ebx, ebx
mov r8d, dword [rbp - 0x34]
mov edx, dword [rbp - 0x38]
mov rcx, r13
xor r14d, r14d
call sub.msys_2.0.dll_chown
jmp 0x1004a7c62
mov rcx, r13
call sym.bash.exe_xfree
jmp 0x1004a7c77
call sub.msys_2.0.dll___errno
neg esi
mov r14d, dword [rax]
mov dword [sym.bash.exe_history_lines_written_to_file], esi
test r14d, r14d
jne 0x1004a7f7d
xor ecx, ecx
call sym.bash.exe_xfree
jmp 0x1004a7c77
sub esi, r14d
cmp r15, rbx
jae 0x1004a7c9a
mov r14, qword [sym.bash.exe_history_comment_char]
jmp 0x1004a7d33
lea rax, [rbx - 1]
mov r12, rbx
cmp r15, rax
je 0x1004a7c9a
mov rbx, rax
cmp byte [rbx], 0xa
jne 0x1004a7d20
movzx eax, byte [r14]
cmp byte [r12], al
jne 0x1004a7d54
call sub.msys_2.0.dll___locale_ctype_ptr
movzx edx, byte [r12 + 1]
test byte [rdx + rax + 1], 4
jne 0x1004a7d20
lea r12, [rbx + 1]
cmp r15, r12
jae 0x1004a7c9a
mov rcx, r13
call fcn.1004a6ef0
mov r8d, 0x180
mov edx, 0x10601
mov rcx, rax
mov rbx, rax
call sub.msys_2.0.dll_open
mov r14d, eax
cmp eax, 0xffffffff
je 0x1004a7f40
mov rax, r12
mov rdx, r12
mov ecx, r14d
sub rax, r15
sub rdi, rax
mov r8, rdi
call sub.msys_2.0.dll_write
test rax, rax
js 0x1004a7ef0
lea rdx, [rbp + 0x30]
mov ecx, r14d
call sub.msys_2.0.dll_fstat
test eax, eax
js 0x1004a7fa0
mov ecx, r14d
call fcn.1004d2aa0
test eax, eax
js 0x1004a7f40
mov rcx, r15
call fcn.1004d2c80
mov dword [sym.bash.exe_history_lines_written_to_file], esi
test rbx, rbx
je 0x1004a7ca8
mov rdx, r13
mov rcx, rbx
call fcn.1004a7080
mov r14d, eax
test eax, eax
jne 0x1004a7f30
mov rax, qword [rbp - 0x38]
cmp qword [rbp + 0x48], rax
jne 0x1004a7cb8
mov rcx, r13
call sym.bash.exe_xfree
jmp 0x1004a7c6f
mov ecx, r12d
call fcn.1004d2aa0
neg esi
mov dword [sym.bash.exe_history_lines_written_to_file], esi
mov esi, 1
call sub.msys_2.0.dll___errno
mov r14d, dword [rax]
jmp 0x1004a7c3b
mov qword [rbp - 0x58], rdx
call sub.msys_2.0.dll___locale_ctype_ptr
mov rdx, qword [rbp - 0x58]
mov rcx, qword [sym.bash.exe_history_comment_char]
movzx edx, byte [rdx + 1]
test byte [rdx + rax + 1], 4
je 0x1004a7c07
jmp 0x1004a7bd8
mov rcx, r13
xor r14d, r14d
call sym.bash.exe_xfree
jmp 0x1004a7c77
mov ecx, r12d
call fcn.1004d2aa0
call sub.msys_2.0.dll___errno
mov dword [rax], 0x1b
jmp 0x1004a7e28
call sub.msys_2.0.dll___errno
mov rcx, r15
mov r12d, dword [rax]
call fcn.1004d2c80
mov dword [sym.bash.exe_history_lines_written_to_file], esi
test r12d, r12d
je 0x1004a7ca8
xor ebx, ebx
test r12d, r12d
je 0x1004a7c55
call sub.msys_2.0.dll___errno
mov r14d, dword [rax]
test rbx, rbx
je 0x1004a7fe8
mov rcx, rbx
call sub.msys_2.0.dll_unlink
mov dword [sym.bash.exe_history_lines_written_to_file], 0
test r14d, r14d
je 0x1004a7c55
jmp 0x1004a7e0a
call sub.msys_2.0.dll___errno
lea rdx, [rbp + 0x30]
mov ecx, r14d
mov r12d, dword [rax]
call sub.msys_2.0.dll_fstat
test eax, eax
js 0x1004a7fad
mov ecx, r14d
call fcn.1004d2aa0
test eax, eax
jns 0x1004a7f48
test r12d, r12d
je 0x1004a7f40
mov rcx, r15
call fcn.1004d2c80
mov dword [sym.bash.exe_history_lines_written_to_file], esi
jmp 0x1004a7ebf
call sub.msys_2.0.dll___errno
mov r14d, dword [rax]
jmp 0x1004a7ed0
call sub.msys_2.0.dll___errno
mov r12d, dword [rax]
test r12d, r12d
mov rcx, r15
sete dil
call fcn.1004d2c80
mov dword [sym.bash.exe_history_lines_written_to_file], esi
test dil, dil
jne 0x1004a7ddd
jmp 0x1004a7eb6
call sub.msys_2.0.dll___errno
mov r14d, dword [rax]
jmp 0x1004a7c20
call sub.msys_2.0.dll___errno
xor ebx, ebx
mov r14d, dword [rax]
mov dword [sym.bash.exe_history_lines_written_to_file], 0
jmp 0x1004a7c62
mov rbx, r12
xor esi, esi
jmp 0x1004a7d0b
call sub.msys_2.0.dll___errno
mov r12d, dword [rax]
jmp 0x1004a7f0c
test r12d, r12d
je 0x1004a7fa0
mov ecx, r14d
call fcn.1004d2aa0
jmp 0x1004a7f1d
call sub.msys_2.0.dll___errno
neg esi
mov ecx, r12d
mov ebx, dword [rax]
call fcn.1004d2aa0
mov dword [sym.bash.exe_history_lines_written_to_file], esi
test ebx, ebx
je 0x1004a7ca8
mov esi, 1
jmp 0x1004a7c33
mov esi, 1
jmp 0x1004a7c3b