Function at 0x100412070
Capabilities:
Set current directory

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x20
mov rbx, qword [rcx]
mov rsi, rcx
test rbx, rbx
je 0x1004121a6
mov edx, dword [rcx + 0x48]
test dh, 0x20
jne 0x1004121a6
movzx eax, word [rbx + 0x6c]
mov edi, 3
mov word [rbx + 0x6c], di
cmp ax, 1
je 0x100412440
movzx ecx, word [rbx + 0x68]
cmp ax, 2
je 0x1004121b0
cmp cx, 1
jne 0x1004120ec
jmp 0x100412220
mov qword [rsi], rbx
mov rcx, rdi
call fcn.100410780
cmp qword [rbx + 0x58], 0
je 0x1004122a0
movzx eax, word [rbx + 0x6c]
cmp ax, 4
jne 0x100412368
mov rdi, rbx
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x1004120c8
mov rbx, qword [rdi + 8]
cmp qword [rbx + 0x18], 0
jne 0x1004125be
mov qword [rsi], rbx
mov rcx, rdi
call fcn.100410780
cmp qword [rbx + 0x58], 0xffffffffffffffff
je 0x10041257a
cmp word [rbx + 0x68], 0xb
je 0x1004328ec
mov rdx, qword [rsi + 0x20]
mov rax, qword [rbx + 0x48]
mov byte [rdx + rax], 0
cmp qword [rbx + 0x58], 0
je 0x10041259b
movzx eax, word [rbx + 0x6a]
test al, 2
je 0x1004124b8
mov eax, dword [rsi + 0x48]
mov ecx, dword [rbx + 0x44]
test al, 4
jne 0x100412171
test ah, 2
je 0x100412669
mov edx, ecx
mov r8d, 1
mov rcx, rsi
call fcn.100410cd0
mov ecx, dword [rbx + 0x44]
call sub.msys_2.0.dll_close
cmp word [rbx + 0x68], 2
je 0x10041219c
mov ecx, dword [rbx + 0x40]
test ecx, ecx
jne 0x1004125b0
mov edx, 6
mov rcx, rsi
mov word [rbx + 0x68], dx
mov rdx, rbx
call fcn.100410d50
test byte [rsi + 0x49], 0x20
je 0x100412290
xor ebx, ebx
jmp 0x100412290
lea eax, [rcx - 0xc]
cmp ax, 1
jbe 0x1004123ef
cmp cx, 1
jne 0x1004120ec
test dl, 0x40
je 0x1004121d4
mov eax, dword [rsi + 0x18]
cmp dword [rbx + 0x70], eax
jne 0x100412226
mov rdi, qword [rsi + 8]
test rdi, rdi
je 0x10041249a
test dh, 0x10
jne 0x100412454
mov r9, qword [rbx + 0x30]
mov r8d, 0xffffffff
mov rdx, rbx
mov rcx, rsi
call fcn.100410e70
test eax, eax
jne 0x10041253b
mov rbx, qword [rsi + 8]
mov qword [rsi + 8], 0
jmp 0x100412372
cmp ax, 4
jne 0x1004121c7
test byte [rbx + 0x6a], 2
jne 0x100412603
mov rdi, qword [rsi + 8]
test rdi, rdi
je 0x10041227a
call sub.msys_2.0.dll___errno
mov r12d, dword [rax]
nop dword [rax]
mov rbp, rdi
mov rdi, qword [rdi + 0x10]
mov rcx, qword [rbp + 0x18]
test rcx, rcx
je 0x10041225d
call sub.msys_2.0.dll_closedir
mov rcx, rbp
call fcn.100410780
test rdi, rdi
jne 0x100412248
call sub.msys_2.0.dll___errno
mov dword [rax], r12d
mov qword [rsi + 8], 0
mov r11d, 6
mov rdx, rbx
mov rcx, rsi
mov word [rbx + 0x68], r11w
call fcn.100410d50
mov rax, rbx
add rsp, 0x20
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
mov rcx, rsi
call fcn.100410de0
test eax, eax
jne 0x1004125f5
test dword [rsi + 0x48], 0x102
mov rcx, qword [rsi + 0x58]
je 0x100412610
test rcx, rcx
je 0x1004122cb
call fcn.1004134a0
mov rax, qword [rbx + 0x60]
mov rcx, qword [rsi + 0x20]
lea rbp, [rbx + 0xf0]
mov rdx, rbp
mov qword [rbx + 0x48], rax
lea r8, [rax + 1]
call sub.msys_2.0.dll_memmove
mov edx, 0x2f
mov rcx, rbp
call sub.msys_2.0.dll_strrchr
test rax, rax
je 0x100412327
cmp rbp, rax
je 0x1004124f7
lea rdi, [rax + 1]
mov rcx, rdi
call sub.msys_2.0.dll_strlen
mov rdx, rdi
mov rcx, rbp
mov r12, rax
lea r8, [rax + 1]
call sub.msys_2.0.dll_memmove
mov qword [rbx + 0x60], r12
movddup xmm0, qword [rsi + 0x20]
mov rcx, rsi
movups xmmword [rbx + 0x30], xmm0
call fcn.100410ba0
test al, al
jne 0x1004123aa
test dword [rsi + 0x48], 0x102
mov rcx, qword [rsi + 0x58]
je 0x1004126d2
test rcx, rcx
je 0x1004121a6
call fcn.1004134a0
xor ebx, ebx
jmp 0x100412290
cmp ax, 2
je 0x10041261a
mov rax, qword [rbx + 8]
mov rcx, qword [rax + 0x48]
mov rax, qword [rax + 0x38]
lea rdx, [rcx - 1]
cmp byte [rax + rcx - 1], 0x2f
cmove rcx, rdx
add rcx, qword [rsi + 0x20]
lea rdx, [rbx + 0xf0]
mov byte [rcx], 0x2f
mov rax, qword [rbx + 0x60]
add rcx, 1
lea r8, [rax + 1]
call sub.msys_2.0.dll_memmove
movzx eax, word [rbx + 0x68]
mov qword [rsi], rbx
cmp ax, 0xb
je 0x100412420
cmp ax, 1
jne 0x100412290
cmp qword [rbx + 0x58], 0
jne 0x1004123ce
mov eax, dword [rbx + 0x70]
mov dword [rsi + 0x18], eax
mov rdx, rbx
mov rcx, rsi
call fcn.100410c20
test al, al
je 0x1004121a6
mov rax, rbx
add rsp, 0x20
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
mov r8d, 1
mov rdx, rbx
mov rcx, rsi
call fcn.100410890
mov word [rbx + 0x68], ax
cmp ax, 1
je 0x10041267a
mov qword [rsi], rbx
cmp ax, 0xb
jne 0x100412290
nop dword [rax + rax]
mov rax, qword [rbx + 0x98]
cmp rax, 2
je 0x100412645
cmp rax, 1
je 0x100412290
jmp 0x1004328ec
xor r8d, r8d
mov rdx, rbx
call fcn.100410890
mov word [rbx + 0x68], ax
jmp 0x100412290
and dh, 0xef
mov dword [rsi + 0x48], edx
call sub.msys_2.0.dll___errno
mov r12d, dword [rax]
nop word [rax + rax]
mov rbp, rdi
mov rdi, qword [rdi + 0x10]
mov rcx, qword [rbp + 0x18]
test rcx, rcx
je 0x10041247d
call sub.msys_2.0.dll_closedir
mov rcx, rbp
call fcn.100410780
test rdi, rdi
jne 0x100412468
call sub.msys_2.0.dll___errno
mov dword [rax], r12d
mov qword [rsi + 8], 0
mov edx, 3
mov rcx, rsi
call fcn.1004110b0
mov qword [rsi + 8], rax
test rax, rax
je 0x100412506
mov rbx, rax
jmp 0x10041220b
test al, 1
jne 0x100412176
mov rdx, qword [rbx + 8]
lea r9, [0x1004394e0]
mov r8d, 0xffffffff
mov rcx, rsi
call fcn.100410e70
test eax, eax
je 0x100412176
call sub.msys_2.0.dll___errno
mov eax, dword [rax]
mov dword [rbx + 0x40], eax
or dword [rsi + 0x48], 0x2000
jmp 0x100412176
cmp byte [rbp + 1], 0
je 0x100412327
jmp 0x100412305
test byte [rsi + 0x49], 0x20
jne 0x1004121a6
mov r10d, dword [rbx + 0x40]
test r10d, r10d
je 0x10041252b
cmp word [rbx + 0x68], 4
je 0x10041252b
mov r9d, 7
mov word [rbx + 0x68], r9w
mov rdx, rbx
mov rcx, rsi
call fcn.100410d50
jmp 0x100412290
call sub.msys_2.0.dll___errno
mov eax, dword [rax]
or word [rbx + 0x6a], 1
mov dword [rbx + 0x40], eax
mov rbx, qword [rsi + 8]
test rbx, rbx
je 0x10041220b
mov rax, rbx
nop word [rax + rax]
mov rdx, qword [rax + 8]
mov rdx, qword [rdx + 0x30]
mov qword [rax + 0x30], rdx
mov rax, qword [rax + 0x10]
test rax, rax
jne 0x100412560
jmp 0x10041220b
mov rcx, rbx
xor ebx, ebx
call fcn.100410780
call sub.msys_2.0.dll___errno
mov dword [rax], 0
mov qword [rsi], 0
jmp 0x100412290
mov rcx, rsi
call fcn.100410de0
test eax, eax
je 0x100412176
jmp 0x1004124e1
mov eax, 7
mov word [rbx + 0x68], ax
jmp 0x10041219c
mov rdx, qword [rsi + 0x20]
mov rax, qword [rbx + 0x48]
mov qword [rsi], rbx
mov rcx, rsi
mov byte [rdx + rax], 0
mov edx, 3
call fcn.1004110b0
mov rbx, rax
test rax, rax
jne 0x10041265c
test byte [rsi + 0x49], 0x20
jne 0x1004121a6
mov rbx, qword [rdi + 8]
jmp 0x100412107
or dword [rsi + 0x48], 0x2000
xor ebx, ebx
jmp 0x100412290
mov ecx, dword [rbx + 0x44]
call sub.msys_2.0.dll_close
jmp 0x100412230
call fcn.100410780
jmp 0x1004122cb
mov r8d, 1
mov rdx, rbx
mov rcx, rsi
call fcn.100410890
mov word [rbx + 0x68], ax
cmp ax, 1
je 0x100412689
mov r8d, 3
mov word [rbx + 0x6c], r8w
jmp 0x100412372
xor r8d, r8d
mov rdx, rbx
mov rcx, rsi
call fcn.100410890
mov word [rbx + 0x68], ax
jmp 0x1004123b7
mov rcx, rdi
call fcn.100410780
jmp 0x100412372
call fcn.100431a10
test eax, eax
jne 0x1004126de
mov ecx, dword [rbx + 0x44]
jmp 0x100412171
mov eax, dword [rsi + 0x48]
test al, 4
je 0x1004126f1
mov qword [rsi], rbx
jmp 0x1004123c1
mov eax, dword [rsi + 0x48]
test al, 4
jne 0x100412635
mov r8d, eax
mov ecx, dword [rsi + 0x2c]
shl r8d, 0x10
and r8d, 0x100000
or r8d, 0x64c000
test ah, 2
je 0x100412740
lea rdx, [0x1004394e4]
call fcn.100417360
mov dword [rbx + 0x44], eax
test eax, eax
js 0x10041276c
or word [rbx + 0x6a], 2
jmp 0x100412635
call fcn.100410780
xor ebx, ebx
jmp 0x100412290
call sub.msys_2.0.dll___errno
mov eax, dword [rax]
mov dword [rbx + 0x40], eax
or dword [rsi + 0x48], 0x2000
jmp 0x100412672
mov r8d, eax
mov ecx, dword [rsi + 0x2c]
shl r8d, 0x10
and r8d, 0x100000
or r8d, 0x64c000
test ah, 2
je 0x10041272f
lea rdx, [0x1004394e4]
call fcn.100417360
mov dword [rbx + 0x44], eax
test eax, eax
js 0x100412754
or word [rbx + 0x6a], 2
movzx eax, word [rbx + 0x68]
jmp 0x1004123ae
mov edx, r8d
lea rcx, [0x1004394e4]
call fcn.1004104f0
jmp 0x10041271a
mov edx, r8d
lea rcx, [0x1004394e4]
call fcn.1004104f0
jmp 0x1004126bd
call sub.msys_2.0.dll___errno
mov eax, dword [rax]
mov word [rbx + 0x68], 7
mov dword [rbx + 0x40], eax
mov qword [rsi], rbx
jmp 0x100412290
call sub.msys_2.0.dll___errno
mov eax, dword [rax]
mov word [rbx + 0x68], 7
mov dword [rbx + 0x40], eax
jmp 0x100412635
call sub.msys_2.0.dll_abort
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
call sub.msys_2.0.dll_abort
nop
call sub.msys_2.0.dll_abort
nop
call sub.msys_2.0.dll_abort
nop
call sub.msys_2.0.dll_abort
nop
call sub.msys_2.0.dll_abort
nop
call sub.msys_2.0.dll_abort
nop