Function at 0x1004b83c0
Capabilities:
Get file attributes

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x128
mov dword [sym.bash.exe_history_lines_written_to_file], 0
mov edi, edx
call fcn.1004b7980
mov rbp, rax
test rax, rax
je 0x1004b85b0
mov r8d, 0x1b6
mov edx, 0x10000
mov rcx, rax
call sub.msys_2.0.dll_open
mov ebx, eax
cmp eax, 0xffffffff
je 0x1004b84e8
lea rdx, [rsp + 0x20]
mov ecx, eax
call sub.msys_2.0.dll_fstat
cmp eax, 0xffffffff
je 0x1004b8570
mov rax, qword [rsp + 0x38]
mov qword [rsp + 0xb8], rax
mov eax, dword [rsp + 0x30]
and eax, 0xf000
cmp eax, 0x8000
jne 0x1004b86e8
mov rsi, qword [rsp + 0x48]
cmp rsi, 0xffffffffffffffff
je 0x1004b8750
lea rcx, [rsi + 1]
call sub.msys_2.0.dll_malloc
mov r13, rax
test rax, rax
je 0x1004b88a8
mov ecx, ebx
mov r8, rsi
mov rdx, rax
call fcn.1005144e0
mov ecx, ebx
mov r12, rax
call fcn.100513da0
test r12d, r12d
jle 0x1004b87e0
movsxd r12, r12d
lea r15, [r13 + r12 - 1]
mov rsi, r15
test edi, edi
je 0x1004b8828
cmp r13, r15
jae 0x1004b8828
mov rdx, qword [sym.bash.exe_history_comment_char]
mov r14d, edi
jmp 0x1004b84cc
lea rbx, [rsi - 1]
mov r15, rsi
test r14d, r14d
je 0x1004b85d0
cmp r13, rbx
jae 0x1004b85d0
mov rsi, rbx
cmp byte [rsi], 0xa
jne 0x1004b84b0
movzx eax, byte [rdx]
cmp byte [r15], al
je 0x1004b8728
sub r14d, 1
jmp 0x1004b84b0
call sub.msys_2.0.dll___errno
neg edi
mov eax, dword [rax]
mov dword [sym.bash.exe_history_lines_written_to_file], edi
test eax, eax
je 0x1004b858e
xor edi, edi
call sub.msys_2.0.dll___errno
mov ebx, dword [rax]
nop dword [rax + rax]
mov dword [sym.bash.exe_history_lines_written_to_file], 0
test ebx, ebx
jne 0x1004b889b
test dil, dil
je 0x1004b889b
mov rax, qword [rsp + 0x38]
cmp qword [rsp + 0xb8], rax
je 0x1004b858e
xor esi, esi
mov r8d, dword [rsp + 0x3c]
mov edx, dword [rsp + 0x38]
mov rcx, rbp
call sub.msys_2.0.dll_chown
mov rcx, rbp
call sym.bash.exe_xfree
test rsi, rsi
je 0x1004b8596
xor ebx, ebx
mov rcx, rsi
call sub.msys_2.0.dll_free
jmp 0x1004b8598
call sub.msys_2.0.dll___errno
neg edi
mov ecx, ebx
mov esi, dword [rax]
call fcn.100513da0
mov dword [sym.bash.exe_history_lines_written_to_file], edi
test esi, esi
jne 0x1004b84ff
mov rcx, rbp
call sym.bash.exe_xfree
xor ebx, ebx
mov eax, ebx
add rsp, 0x128
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
call sub.msys_2.0.dll___errno
neg edi
mov eax, dword [rax]
mov dword [sym.bash.exe_history_lines_written_to_file], edi
test eax, eax
jne 0x1004b84ff
xor ecx, ecx
call sym.bash.exe_xfree
jmp 0x1004b8596
sub edi, r14d
cmp r13, rbx
jae 0x1004b8710
mov r14, qword [sym.bash.exe_history_comment_char]
jmp 0x1004b85fb
lea rax, [rbx - 1]
mov rsi, rbx
cmp r13, rax
je 0x1004b8710
mov rbx, rax
cmp byte [rbx], 0xa
jne 0x1004b85e8
movzx eax, byte [r14]
cmp byte [rsi], al
jne 0x1004b8618
call sub.msys_2.0.dll___locale_ctype_ptr
movzx edx, byte [rsi + 1]
test byte [rdx + rax + 1], 4
jne 0x1004b85e8
add rbx, 1
cmp r13, rbx
jae 0x1004b8710
mov rcx, rbp
call fcn.1004b7790
mov r8d, 0x180
mov edx, 0x10601
mov rcx, rax
mov rsi, rax
call sub.msys_2.0.dll_open
mov r14d, eax
cmp eax, 0xffffffff
je 0x1004b8768
mov rax, rbx
mov r8, r12
mov rdx, rbx
mov ecx, r14d
sub rax, r13
sub r8, rax
call sub.msys_2.0.dll_write
test rax, rax
js 0x1004b8868
lea rdx, [rsp + 0xa0]
mov ecx, r14d
call sub.msys_2.0.dll_fstat
test eax, eax
js 0x1004b8832
mov ecx, r14d
call fcn.100513da0
test eax, eax
js 0x1004b8768
mov rcx, r13
call sub.msys_2.0.dll_free
mov dword [sym.bash.exe_history_lines_written_to_file], edi
test rsi, rsi
je 0x1004b852b
mov rdx, rbp
mov rcx, rsi
call fcn.1004b7910
mov ebx, eax
test eax, eax
jne 0x1004b87b0
mov rax, qword [rsp + 0x38]
cmp qword [rsp + 0xb8], rax
jne 0x1004b853c
mov rcx, rbp
call sym.bash.exe_xfree
jmp 0x1004b855c
mov ecx, ebx
call fcn.100513da0
neg edi
mov dword [sym.bash.exe_history_lines_written_to_file], edi
mov edi, 1
call sub.msys_2.0.dll___errno
mov ebx, dword [rax]
jmp 0x1004b8510
mov rcx, r13
call sub.msys_2.0.dll_free
mov dword [sym.bash.exe_history_lines_written_to_file], edi
jmp 0x1004b852b
call sub.msys_2.0.dll___locale_ctype_ptr
movzx ecx, byte [r15 + 1]
mov rdx, qword [sym.bash.exe_history_comment_char]
test byte [rcx + rax + 1], 4
je 0x1004b84dd
jmp 0x1004b84b0
mov ecx, ebx
call fcn.100513da0
call sub.msys_2.0.dll___errno
mov dword [rax], 0x1b
jmp 0x1004b86ef
call sub.msys_2.0.dll___errno
mov r12d, dword [rax]
test r12d, r12d
mov rcx, r13
sete bl
call sub.msys_2.0.dll_free
mov dword [sym.bash.exe_history_lines_written_to_file], edi
test bl, bl
jne 0x1004b86a5
test r12d, r12d
jne 0x1004b880a
mov rax, qword [rsp + 0xb8]
cmp qword [rsp + 0x38], rax
je 0x1004b854d
jmp 0x1004b853c
call sub.msys_2.0.dll___errno
mov ebx, dword [rax]
mov rcx, rsi
call sub.msys_2.0.dll_unlink
mov dword [sym.bash.exe_history_lines_written_to_file], 0
test ebx, ebx
je 0x1004b86c3
jmp 0x1004b86d6
neg edi
test r12d, r12d
je 0x1004b8710
call sub.msys_2.0.dll___errno
mov rcx, r13
mov ebx, dword [rax]
call sub.msys_2.0.dll_free
mov dword [sym.bash.exe_history_lines_written_to_file], edi
test ebx, ebx
je 0x1004b852b
xor esi, esi
call sub.msys_2.0.dll___errno
mov edi, 1
mov ebx, dword [rax]
test rsi, rsi
je 0x1004b8510
jmp 0x1004b87b7
mov rbx, rsi
xor edi, edi
jmp 0x1004b85d3
call sub.msys_2.0.dll___errno
mov r12d, dword [rax]
mov ecx, r14d
call fcn.100513da0
test eax, eax
jns 0x1004b8770
test r12d, r12d
je 0x1004b8768
mov rcx, r13
call sub.msys_2.0.dll_free
mov dword [sym.bash.exe_history_lines_written_to_file], edi
jmp 0x1004b880a
call sub.msys_2.0.dll___errno
lea rdx, [rsp + 0xa0]
mov ecx, r14d
mov r12d, dword [rax]
call sub.msys_2.0.dll_fstat
test eax, eax
jns 0x1004b883a
test r12d, r12d
je 0x1004b8832
mov ecx, r14d
call fcn.100513da0
mov rcx, r13
call sub.msys_2.0.dll_free
jmp 0x1004b885b
mov rcx, rbp
call sym.bash.exe_xfree
jmp 0x1004b8598
call sub.msys_2.0.dll___errno
neg edi
mov ecx, ebx
mov esi, dword [rax]
call fcn.100513da0
mov dword [sym.bash.exe_history_lines_written_to_file], edi
mov edi, 1
test esi, esi
jne 0x1004b8501
jmp 0x1004b852b