Function at 0x1004b00c0
Capabilities:
Read file on windows

Disassembly:
push r15
mov eax, 0x80a8
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
call fcn.1004d2960
sub rsp, rax
mov qword [rcx], 0
mov rbx, rcx
mov r12, rdx
mov ebp, r8d
mov qword [rcx + 8], 0
mov qword [rcx + 0x10], 0
mov qword [rcx + 0x18], 0
mov qword [rcx + 0x20], 0
mov qword [rcx + 0x28], 0
mov qword [rcx + 0x30], 0
mov qword [rcx + 0x38], 0
mov qword [rcx + 0x40], 0
cmp r8d, 0xb
jle 0x1004b0160
mov dword [rsp + 0x8c], 0xc
mov rax, qword [rdx]
mov edx, dword [rdx + 8]
mov qword [rsp + 0x90], rax
mov dword [rsp + 0x98], edx
movzx edx, ax
cmp ax, 0x11a
je 0x1004b0180
cmp edx, 0x21e
je 0x1004b0180
xor eax, eax
add rsp, 0x80a8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
cmp edx, 0x21e
mov eax, 0x1000
mov edx, 0x8000
movzx r13d, byte [rsp + 0x93]
movzx r14d, byte [rsp + 0x99]
cmove eax, edx
sete r11b
lea rdx, [0x1004afe60]
movzx r10d, byte [rsp + 0x9b]
movzx r11d, r11b
mov dword [rsp + 0x50], eax
mov esi, eax
lea rax, [0x1004afe00]
lea r11d, [r11 + r11 + 2]
cmove rax, rdx
shl r13d, 8
movzx edx, byte [rsp + 0x94]
mov dword [rsp + 0x34], r11d
shl r14d, 8
mov qword [rsp + 0x38], rax
movzx eax, byte [rsp + 0x92]
shl r10d, 8
add r13d, eax
movzx eax, byte [rsp + 0x95]
shl eax, 8
lea edi, [rax + rdx]
movzx eax, byte [rsp + 0x97]
movzx edx, byte [rsp + 0x96]
mov word [rsp + 0x74], di
shl eax, 8
lea r15d, [rax + rdx]
movzx eax, byte [rsp + 0x98]
add r14d, eax
movzx eax, byte [rsp + 0x9a]
add r10d, eax
mov eax, edi
or eax, r13d
or eax, r15d
or eax, r14d
or ax, r10w
js 0x1004b0160
movsx eax, r14w
mov dword [rsp + 0x54], eax
add eax, eax
mov dword [rsp + 0x58], eax
cmp eax, esi
jge 0x1004b0160
movsx eax, r10w
movsx r13d, r13w
mov dword [rsp + 0x5c], r10d
lea ecx, [r13 + rax + 1]
mov dword [rsp + 0x64], eax
movsxd rcx, ecx
call fcn.1004d2f30
mov qword [rsp + 0x48], rax
mov rsi, rax
test rax, rax
je 0x1004b0160
mov eax, 0x200
mov edx, ebp
mov qword [rbx + 8], rsi
mov r10d, dword [rsp + 0x5c]
cmp r13d, eax
mov qword [rbx], rsi
mov r11d, dword [rsp + 0x34]
cmovbe eax, r13d
mov dword [rsp + 0x40], eax
mov edi, eax
xor eax, eax
sub edx, 0xc
je 0x1004b0305
cmp edx, edi
jl 0x1004b0630
mov eax, edi
lea edx, [rdi + 0xc]
lea rsi, [r12 + 0xc]
cmp eax, 8
jae 0x1004b0610
test al, 4
jne 0x1004b082c
test eax, eax
je 0x1004b02fe
movzx ecx, byte [r12 + 0xc]
mov rdi, qword [rsp + 0x48]
mov byte [rdi], cl
test al, 2
jne 0x1004b0a56
mov dword [rsp + 0x8c], edx
mov edi, dword [rsp + 0x40]
cmp edi, eax
jne 0x1004b05c8
movsx eax, word [rsp + 0x74]
mov rdi, qword [rsp + 0x48]
mov edx, 1
mov dword [rsp + 0x60], r11d
mov dword [rsp + 0x5c], r10d
mov esi, eax
mov dword [rsp + 0x34], eax
mov eax, dword [rsp + 0x40]
mov byte [rdi + rax], 0
mov eax, 0x2c
cmp si, ax
cmovge eax, esi
movsx rcx, ax
call sub.msys_2.0.dll_calloc
mov r10d, dword [rsp + 0x5c]
mov r11d, dword [rsp + 0x60]
test rax, rax
mov qword [rbx + 0x10], rax
mov rcx, rax
je 0x1004b0160
movsxd rax, dword [rsp + 0x8c]
mov esi, ebp
sub esi, eax
test esi, esi
jle 0x1004b05f8
mov edi, dword [rsp + 0x34]
cmp edi, esi
jg 0x1004b0600
mov esi, edi
mov r8d, edi
lea edi, [rdi + rax]
lea rdx, [r12 + rax]
mov dword [rsp + 0x60], r11d
mov dword [rsp + 0x5c], r10d
call fcn.1004d2fe0
mov r10d, dword [rsp + 0x5c]
mov r11d, dword [rsp + 0x60]
mov dword [rsp + 0x8c], edi
mov eax, dword [rsp + 0x34]
cmp eax, esi
jg 0x1004b0160
add r13d, eax
and r13d, 1
jne 0x1004b0640
mov eax, 0x27
mov edx, 4
mov dword [rsp + 0x60], r11d
movsx r13d, r15w
cmp r15w, ax
mov dword [rsp + 0x5c], r10d
cmovge eax, r15d
movsx rcx, ax
call sub.msys_2.0.dll_calloc
mov qword [rbx + 0x18], rax
mov rsi, rax
test rax, rax
je 0x1004b0160
mov edx, ebp
xor edi, edi
mov r10d, dword [rsp + 0x5c]
mov r11d, dword [rsp + 0x60]
movsxd rax, dword [rsp + 0x8c]
sub edx, eax
test edx, edx
jle 0x1004b0473
mov r8d, r13d
imul r8d, r11d
mov edi, r8d
lea r9d, [rax + r8]
cmp edx, r8d
jge 0x1004b043c
mov r8d, edx
mov r9d, ebp
mov edi, r8d
lea rcx, [rsp + 0x90]
lea rdx, [r12 + rax]
mov dword [rsp + 0x68], r11d
mov dword [rsp + 0x60], r9d
mov dword [rsp + 0x5c], r10d
call fcn.1004d2fe0
mov r9d, dword [rsp + 0x60]
mov r11d, dword [rsp + 0x68]
mov r10d, dword [rsp + 0x5c]
mov dword [rsp + 0x8c], r9d
mov eax, r11d
mov dword [rsp + 0x60], r10d
imul eax, r13d
mov dword [rsp + 0x5c], r11d
cmp eax, edi
jne 0x1004b0160
lea rax, [rsp + 0x90]
mov r8d, r13d
mov rdx, rsi
mov qword [rsp + 0x68], rax
mov rcx, rax
mov rax, qword [rsp + 0x38]
call rax
mov edi, dword [rsp + 0x54]
mov r11d, dword [rsp + 0x5c]
mov r10d, dword [rsp + 0x60]
cmp edi, 0x19e
mov dword [rsp + 0x60], r11d
mov dword [rsp + 0x5c], r10d
jg 0x1004b066d
mov edx, 8
mov ecx, 0x19e
call sub.msys_2.0.dll_calloc
mov qword [rbx + 0x20], rax
mov rsi, rax
test rax, rax
je 0x1004b0160
test edi, edi
mov r10d, dword [rsp + 0x5c]
mov r11d, dword [rsp + 0x60]
jne 0x1004b0695
mov eax, 0x19e
and r10d, 1
mov dword [rbx + 0x38], 0x27002c
mov word [rbx + 0x3c], ax
mov rax, qword [sym.bash.exe__nc_user_definable]
movzx eax, byte [rax]
jne 0x1004b07a5
test al, al
jne 0x1004b07c3
cmp dword [rsp + 0x34], 0x2b
jg 0x1004b0564
movsx rdx, word [rsp + 0x74]
mov r8d, 0x2b
sub r8d, dword [rsp + 0x34]
lea rax, [rdx + 1]
add r8, rax
jmp 0x1004b0554
add rax, 1
mov rcx, qword [rbx + 0x10]
mov byte [rcx + rdx], 0
mov rdx, rax
cmp rax, r8
jne 0x1004b0550
cmp r13d, 0x26
jg 0x1004b058d
mov rax, qword [rbx + 0x18]
mov r8d, 0x27
movsx rdx, r15w
sub r8d, r13d
lea rcx, [rax + rdx*4]
shl r8, 2
mov edx, 0xff
call fcn.1004d3000
cmp dword [rsp + 0x54], 0x19d
jg 0x1004b05b9
mov rax, qword [rbx + 0x20]
mov r8d, 0x19e
movsx r14, r14w
xor edx, edx
sub r8d, dword [rsp + 0x54]
lea rcx, [rax + r14*8]
shl r8, 3
call fcn.1004d3000
mov eax, 1
jmp 0x1004b0162
mov r8d, edi
mov ecx, eax
xor edx, edx
add rcx, qword [rsp + 0x48]
sub r8d, eax
mov dword [rsp + 0x5c], r11d
mov dword [rsp + 0x34], r10d
call fcn.1004d3000
mov r10d, dword [rsp + 0x34]
mov r11d, dword [rsp + 0x5c]
jmp 0x1004b0311
xor esi, esi
jmp 0x1004b03b2
mov r8d, esi
mov edi, ebp
jmp 0x1004b038e
mov ecx, eax
mov rdi, qword [rsp + 0x48]
mov r8, qword [rsi + rcx - 8]
mov qword [rdi + rcx - 8], r8
lea ecx, [rax - 1]
shr ecx, 3
rep movsq qword [rdi], qword [rsi]
jmp 0x1004b02fe
mov eax, edx
mov edx, ebp
jmp 0x1004b02cf
mov eax, dword [rsp + 0x8c]
cmp ebp, eax
jle 0x1004b03cb
movsxd rdx, eax
add eax, 1
movzx edx, byte [r12 + rdx]
mov dword [rsp + 0x8c], eax
mov byte [rsp + 0x90], dl
jmp 0x1004b03cb
movsx rcx, r14w
mov edx, 8
call sub.msys_2.0.dll_calloc
mov r10d, dword [rsp + 0x5c]
mov r11d, dword [rsp + 0x60]
test rax, rax
mov qword [rbx + 0x20], rax
mov rsi, rax
je 0x1004b0160
mov eax, dword [rsp + 0x40]
mov edi, ebp
add eax, 1
add rax, qword [rsp + 0x48]
mov qword [rsp + 0x40], rax
movsxd rax, dword [rsp + 0x8c]
sub edi, eax
test edi, edi
jle 0x1004b0160
mov ecx, dword [rsp + 0x54]
lea r9d, [rcx + rcx]
cmp r9d, edi
jg 0x1004b07ef
mov rcx, qword [rsp + 0x68]
lea edi, [rax + r9]
mov r8d, r9d
lea rdx, [r12 + rax]
mov dword [rsp + 0x70], r11d
mov dword [rsp + 0x60], r10d
mov dword [rsp + 0x5c], r9d
mov dword [rsp + 0x48], edi
call fcn.1004d2fe0
mov r9d, dword [rsp + 0x5c]
cmp dword [rsp + 0x58], r9d
mov dword [rsp + 0x8c], edi
mov r10d, dword [rsp + 0x60]
mov r11d, dword [rsp + 0x70]
jne 0x1004b0160
mov edi, ebp
sub edi, dword [rsp + 0x48]
test edi, edi
jle 0x1004b0825
mov eax, dword [rsp + 0x64]
movsxd rdx, dword [rsp + 0x48]
mov dword [rsp + 0x5c], r11d
mov rcx, qword [rsp + 0x40]
mov dword [rsp + 0x58], r10d
cmp eax, edi
cmovle edi, eax
add rdx, r12
mov r8d, edi
call fcn.1004d2fe0
mov eax, dword [rsp + 0x48]
mov r11d, dword [rsp + 0x5c]
mov r10d, dword [rsp + 0x58]
add eax, edi
mov dword [rsp + 0x8c], eax
cmp dword [rsp + 0x64], edi
jne 0x1004b0160
mov rax, qword [rsp + 0x40]
mov r9d, dword [rsp + 0x64]
mov rdx, rsi
mov dword [rsp + 0x58], r11d
mov r8d, dword [rsp + 0x54]
mov rcx, qword [rsp + 0x68]
mov dword [rsp + 0x48], r10d
mov qword [rsp + 0x20], rax
call fcn.1004afeb0
mov r11d, dword [rsp + 0x58]
mov r10d, dword [rsp + 0x48]
jmp 0x1004b04fe
mov edx, dword [rsp + 0x8c]
cmp ebp, edx
jle 0x1004b052a
add edx, 1
mov dword [rsp + 0x8c], edx
jmp 0x1004b0522
mov edx, dword [rsp + 0x8c]
mov eax, ebp
sub eax, edx
test eax, eax
jle 0x1004b052a
movsxd rsi, edx
add rsi, r12
cmp eax, 9
jg 0x1004b0849
mov rdi, qword [rsp + 0x68]
mov ecx, eax
rep movsb byte [rdi], byte [rsi]
jmp 0x1004b052a
mov rcx, qword [rsp + 0x68]
lea rdx, [r12 + rax]
movsxd r8, edi
mov dword [rsp + 0x5c], r11d
mov dword [rsp + 0x48], r10d
call fcn.1004d2fe0
cmp dword [rsp + 0x58], edi
mov r10d, dword [rsp + 0x48]
mov dword [rsp + 0x8c], ebp
mov r11d, dword [rsp + 0x5c]
jne 0x1004b0160
xor edi, edi
jmp 0x1004b0761
mov ecx, dword [r12 + 0xc]
mov rdi, qword [rsp + 0x48]
mov dword [rdi], ecx
mov ecx, eax
mov r8d, dword [rsi + rcx - 4]
mov dword [rdi + rcx - 4], r8d
jmp 0x1004b02fe
mov rax, qword [rsi]
add edx, 0xa
lea r8, [rsp + 0x9a]
mov dword [rsp + 0x8c], edx
mov rdx, qword [rsp + 0x68]
mov qword [rsp + 0x90], rax
movzx eax, word [rsi + 8]
mov word [rsp + 0x98], ax
jmp 0x1004b088d
add rdx, 2
cmp r8, rdx
je 0x1004b052a
movzx eax, byte [rdx + 1]
movzx ecx, byte [rdx]
shl eax, 8
add eax, ecx
test ax, ax
jle 0x1004b0880
movzx eax, byte [rsp + 0x91]
movzx edx, byte [rsp + 0x90]
movzx ecx, byte [rsp + 0x96]
movzx r9d, byte [rsp + 0x99]
shl eax, 8
add eax, edx
movzx edx, byte [rsp + 0x92]
movsx edi, ax
mov word [rsp + 0x40], ax
movzx eax, byte [rsp + 0x93]
mov dword [rsp + 0x64], edi
shl eax, 8
add eax, edx
movzx edx, byte [rsp + 0x94]
movsx r10d, ax
mov word [rsp + 0x48], ax
movzx eax, byte [rsp + 0x95]
add edi, r10d
mov dword [rsp + 0x70], r10d
shl eax, 8
add eax, edx
movzx edx, byte [rsp + 0x98]
movsx esi, ax
mov word [rsp + 0x58], ax
movzx eax, byte [rsp + 0x97]
lea r10d, [rdi + rsi]
mov edi, dword [rsp + 0x50]
mov dword [rsp + 0x5c], r10d
sar edi, 1
mov dword [rsp + 0x60], edi
cmp r10d, edi
jge 0x1004b0160
shl eax, 8
add ecx, eax
mov eax, r9d
shl eax, 8
add edx, eax
movsx eax, cx
movsx edi, dx
mov word [rsp + 0x76], dx
cmp eax, edi
cmovl eax, edi
cmp dword [rsp + 0x50], eax
jle 0x1004b0160
movzx eax, word [rsp + 0x40]
or eax, dword [rsp + 0x48]
or eax, dword [rsp + 0x58]
or eax, ecx
or ax, dx
js 0x1004b0160
movzx ecx, word [rsp + 0x48]
movzx eax, word [rsp + 0x40]
mov dword [rsp + 0x50], r11d
lea edx, [rcx + 0x27]
movzx ecx, word [rsp + 0x58]
add eax, 0x2c
mov word [rbx + 0x3a], dx
lea edx, [rcx + 0x19e]
mov word [rbx + 0x38], ax
mov rcx, qword [rbx + 0x10]
mov word [rbx + 0x3c], dx
movzx edx, ax
call sym.bash.exe__nc_doalloc
mov r11d, dword [rsp + 0x50]
test rax, rax
mov qword [rbx + 0x10], rax
je 0x1004b0c8e
movzx edx, word [rbx + 0x3a]
mov rcx, qword [rbx + 0x18]
mov dword [rsp + 0x50], r11d
shl rdx, 2
call sym.bash.exe__nc_doalloc
mov qword [rbx + 0x18], rax
test rax, rax
je 0x1004b0c8e
movzx edx, word [rbx + 0x3c]
mov rcx, qword [rbx + 0x20]
shl rdx, 3
call sym.bash.exe__nc_doalloc
mov qword [rbx + 0x20], rax
test rax, rax
je 0x1004b0c8e
movzx eax, word [rsp + 0x40]
mov r11d, dword [rsp + 0x50]
test ax, ax
mov word [rbx + 0x3e], ax
jne 0x1004b0c25
movzx eax, word [rsp + 0x48]
mov word [rbx + 0x40], ax
test ax, ax
jne 0x1004b0bce
mov ecx, dword [rsp + 0x5c]
lea eax, [rcx + rsi]
cmp dword [rsp + 0x60], eax
jle 0x1004b0160
or ecx, esi
jne 0x1004b0a6e
test edi, edi
jne 0x1004b0aa6
mov word [rbx + 0x42], 0
jmp 0x1004b052a
mov ecx, eax
mov rdi, qword [rsp + 0x48]
movzx r8d, word [rsi + rcx - 2]
mov word [rdi + rcx - 2], r8w
jmp 0x1004b02fe
lea r10d, [rax + rax]
mov r9, qword [rsp + 0x68]
mov r8d, ebp
mov rcx, r12
mov dword [rsp + 0x20], r10d
lea rdx, [rsp + 0x8c]
mov dword [rsp + 0x38], r10d
call fcn.1004aff70
mov r10d, dword [rsp + 0x38]
cmp eax, r10d
jne 0x1004b0160
test edi, edi
je 0x1004b0ae0
movsx rcx, word [rsp + 0x76]
call fcn.1004d2f30
mov qword [rbx + 0x28], rax
mov r9, rax
test rax, rax
je 0x1004b0160
mov dword [rsp + 0x20], edi
lea rdx, [rsp + 0x8c]
mov r8d, ebp
mov rcx, r12
call fcn.1004aff70
cmp eax, edi
jne 0x1004b0160
movzx eax, word [rsp + 0x58]
xor r12d, r12d
mov word [rbx + 0x42], ax
test ax, ax
je 0x1004b0b75
mov rcx, qword [rbx + 0x20]
movsx rax, r14w
mov r9d, edi
mov r8d, esi
xor r12d, r12d
lea rbp, [rcx + rax*8]
mov rax, qword [rbx + 0x28]
mov qword [rsp + 0x38], rcx
mov rcx, qword [rsp + 0x68]
mov rdx, rbp
mov qword [rsp + 0x20], rax
call fcn.1004afeb0
lea edx, [rsi - 1]
mov dword [rsp + 0x50], r13d
mov r13d, edi
movsxd rdx, edx
mov rdi, rbx
mov rbx, rdx
jmp 0x1004b0b65
mov rcx, qword [rbp + rbx*8]
mov rax, qword [rsp + 0x38]
mov qword [rax + rbx*8 + 0xcf0], rcx
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x1004b0b61
call sub.msys_2.0.dll_strlen
lea r12d, [r12 + rax + 1]
sub rbx, 1
cmp ebx, 0xffffffff
jne 0x1004b0b3b
mov rbx, rdi
mov edi, r13d
mov r13d, dword [rsp + 0x50]
mov ebp, dword [rsp + 0x5c]
test ebp, ebp
je 0x1004b052a
cmp dword [rsp + 0x60], esi
jle 0x1004b0160
mov edx, 8
mov ecx, ebp
call sub.msys_2.0.dll_calloc
mov qword [rbx + 0x30], rax
mov rdx, rax
test rax, rax
je 0x1004b0160
movsxd rax, r12d
add rax, qword [rbx + 0x28]
lea ecx, [rsi + rsi]
mov r9d, edi
mov qword [rsp + 0x20], rax
movsxd rcx, ecx
mov r8d, ebp
add rcx, qword [rsp + 0x68]
call fcn.1004afeb0
jmp 0x1004b052a
imul r11d, dword [rsp + 0x70]
mov r9, qword [rsp + 0x68]
mov r8d, ebp
mov rcx, r12
lea rdx, [rsp + 0x8c]
mov dword [rsp + 0x20], r11d
mov dword [rsp + 0x50], r11d
call fcn.1004aff70
mov r11d, dword [rsp + 0x50]
cmp eax, r11d
jne 0x1004b0160
mov rdx, qword [rbx + 0x18]
mov r8d, dword [rsp + 0x70]
mov rcx, qword [rsp + 0x68]
mov rax, qword [rsp + 0x38]
add rdx, 0x9c
call rax
jmp 0x1004b0a32
mov ecx, dword [rsp + 0x64]
mov rax, qword [rbx + 0x10]
lea rdx, [rsp + 0x8c]
mov r8d, ebp
mov qword [rsp + 0x78], rdx
mov dword [rsp + 0x20], ecx
lea r9, [rax + 0x2c]
mov rcx, r12
call fcn.1004aff70
cmp eax, dword [rsp + 0x64]
jne 0x1004b0160
test byte [rsp + 0x40], 1
mov r11d, dword [rsp + 0x50]
je 0x1004b0a20
mov r9, qword [rsp + 0x68]
mov rdx, qword [rsp + 0x78]
mov r8d, ebp
mov rcx, r12
mov dword [rsp + 0x20], 1
call fcn.1004aff70
mov r11d, dword [rsp + 0x50]
jmp 0x1004b0a20
lea rcx, [0x1004fc960]
call sym.bash.exe__nc_err_abort
nop
nop dword [rax + rax]