Function at 0x415c20
Capabilities:
Set current directory

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x4c
mov edi, dword [esp + 0x60]
mov esi, dword [edi]
test esi, esi
je 0x415d1a
mov edx, dword [edi + 0x28]
test dh, 0x40
jne 0x415d1a
movzx eax, word [esi + 0x3e]
mov ecx, 3
mov word [esi + 0x3e], cx
cmp ax, 1
je 0x415f80
cmp ax, 2
je 0x415d30
cmp word [esi + 0x3a], 1
jne 0x415c95
jmp 0x415da0
mov dword [edi], ebx
mov dword [esp], esi
call fcn.004264dc
mov eax, dword [ebx + 0x30]
test eax, eax
je 0x415db0
movzx edx, word [ebx + 0x3e]
mov esi, ebx
cmp dx, 4
jne 0x415e90
mov ebx, dword [esi + 8]
test ebx, ebx
jne 0x415c70
mov ebp, dword [esi + 4]
mov eax, dword [ebp + 0xc]
test eax, eax
jne 0x416151
mov dword [edi], ebp
mov dword [esp], esi
call fcn.004264dc
cmp dword [ebp + 0x30], 0xffffffff
je 0x41606b
cmp word [ebp + 0x3a], 0xb
je 0x41635f
mov edx, dword [edi + 0x10]
mov eax, dword [ebp + 0x28]
mov byte [edx + eax], 0
mov ebx, dword [ebp + 0x30]
test ebx, ebx
je 0x415fdb
movzx eax, word [ebp + 0x3c]
test al, 2
je 0x415f96
mov eax, dword [edi + 0x28]
test al, 4
je 0x415fec
mov eax, dword [ebp + 0x24]
mov dword [esp], eax
call sub.cygwin1.dll_close
mov ecx, dword [ebp + 0x20]
test ecx, ecx
je 0x415f60
mov edx, 7
mov word [ebp + 0x3a], dx
test byte [edi + 0x29], 0x40
je 0x415d1c
xor ebp, ebp
add esp, 0x4c
mov eax, ebp
pop ebx
pop esi
pop edi
pop ebp
ret
movzx eax, word [esi + 0x3a]
lea ecx, [eax - 0xc]
cmp cx, 1
jbe 0x416009
cmp ax, 1
jne 0x415c95
test dl, 0x40
je 0x415f10
mov eax, dword [edi + 0xc]
cmp dword [esi + 0x40], eax
je 0x415f10
test byte [esi + 0x3c], 2
jne 0x416141
mov eax, dword [edi + 4]
test eax, eax
je 0x415d7d
call fcn.004147b0
mov dword [edi + 4], 0
mov edx, 6
mov eax, edi
mov ebp, esi
mov word [esi + 0x3a], dx
mov edx, esi
call fcn.00414da0
add esp, 0x4c
mov eax, ebp
pop ebx
pop esi
pop edi
pop ebp
ret
cmp ax, 4
jne 0x415d4b
jmp 0x415d60
mov eax, edi
call fcn.004148c0
test eax, eax
jne 0x4160cd
mov eax, edi
lea esi, [ebx + 0xa0]
call fcn.004147f0
mov eax, dword [ebx + 0x34]
mov dword [ebx + 0x28], eax
add eax, 1
mov dword [esp + 4], esi
mov dword [esp + 8], eax
mov eax, dword [edi + 0x10]
mov dword [esp], eax
call sub.cygwin1.dll_memmove
mov dword [esp + 4], 0x2f
mov dword [esp], esi
call sub.cygwin1.dll_strrchr
test eax, eax
je 0x415e2f
cmp esi, eax
je 0x4160bb
lea ebp, [eax + 1]
mov dword [esp], ebp
call sub.cygwin1.dll_strlen
mov edx, eax
lea eax, [eax + 1]
mov dword [esp + 4], ebp
mov dword [esp], esi
mov dword [esp + 0x2c], edx
mov dword [esp + 8], eax
call sub.cygwin1.dll_memmove
mov edx, dword [esp + 0x2c]
mov dword [ebx + 0x34], edx
mov eax, dword [edi + 0x10]
mov dword [ebx + 0x1c], eax
mov dword [ebx + 0x18], eax
mov eax, edi
call fcn.004149a0
movzx eax, word [ebx + 0x3a]
cmp ax, 0xb
mov dword [edi], ebx
je 0x415ee3
cmp ax, 1
mov ebp, ebx
jne 0x415d1c
mov esi, dword [ebx + 0x30]
test esi, esi
jne 0x415e68
mov eax, dword [ebx + 0x40]
mov dword [edi + 0xc], eax
mov edx, ebx
mov eax, edi
mov ebp, ebx
call fcn.00414a80
test al, al
jne 0x415d1c
call sub.cygwin1.dll___errno
xor ebp, ebp
mov dword [eax], 0xc
jmp 0x415d1c
cmp dx, 2
je 0x41617c
mov ecx, dword [ebx + 4]
mov edx, dword [ecx + 0x28]
mov ecx, dword [ecx + 0x1c]
cmp byte [ecx + edx - 1], 0x2f
lea eax, [edx - 1]
cmovne eax, edx
add eax, dword [edi + 0x10]
mov byte [eax], 0x2f
mov ecx, dword [ebx + 0x34]
add eax, 1
mov dword [esp], eax
lea edx, [ecx + 1]
mov dword [esp + 8], edx
lea edx, [ebx + 0xa0]
mov dword [esp + 4], edx
call sub.cygwin1.dll_memmove
movzx eax, word [ebx + 0x3a]
mov dword [edi], ebx
cmp ax, 0xb
jne 0x415e4f
mov eax, dword [ebx + 0x68]
mov edx, dword [ebx + 0x6c]
mov ecx, eax
xor ecx, 2
or ecx, edx
je 0x4160d9
xor eax, 1
or eax, edx
jne 0x41635f
mov ebp, ebx
jmp 0x415d1c
mov eax, dword [edi + 4]
test eax, eax
je 0x41609d
test dh, 0x20
jne 0x41608b
mov eax, dword [esi + 0x18]
lea ecx, [esi + 0x48]
lea edx, [esi + 0x40]
mov dword [esp], 0xffffffff
mov dword [esp + 4], eax
mov eax, edi
call fcn.00414b30
test eax, eax
jne 0x416038
mov ebx, dword [edi + 4]
mov dword [edi + 4], 0
jmp 0x415e9a
mov eax, 6
mov edx, ebp
mov word [ebp + 0x3a], ax
mov eax, edi
call fcn.00414da0
jmp 0x415d14
xor ecx, ecx
mov edx, esi
mov eax, edi
call fcn.004144d0
mov ebp, esi
mov word [esi + 0x3a], ax
jmp 0x415d1c
test al, 1
jne 0x415d00
mov eax, dword [ebp + 4]
mov dword [esp + 4], 0x42c120
mov dword [esp], 0xffffffff
lea ecx, [eax + 0x48]
lea edx, [eax + 0x40]
mov eax, edi
call fcn.00414b30
test eax, eax
je 0x415d00
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [ebp + 0x20], eax
or dword [edi + 0x28], 0x4000
jmp 0x415d00
mov eax, edi
call fcn.004148c0
test eax, eax
je 0x415d00
jmp 0x415fc5
test ah, 2
je 0x4161a2
mov edx, dword [ebp + 0x24]
mov ecx, 1
mov eax, edi
call fcn.00414860
jmp 0x415cf5
mov ecx, 1
mov edx, esi
mov eax, edi
call fcn.004144d0
cmp ax, 1
mov word [esi + 0x3a], ax
je 0x4161f6
cmp ax, 0xb
mov dword [edi], esi
je 0x416207
mov ebp, esi
jmp 0x415d1c
call sub.cygwin1.dll___errno
mov edx, dword [edi + 4]
mov eax, dword [eax]
or word [esi + 0x3c], 1
test edx, edx
mov dword [esi + 0x20], eax
mov ebx, edx
je 0x415f4a
mov eax, dword [ebx + 4]
mov eax, dword [eax + 0x18]
mov dword [ebx + 0x18], eax
mov ebx, dword [ebx + 8]
test ebx, ebx
jne 0x416054
mov ebx, edx
jmp 0x415f4a
mov dword [esp], ebp
xor ebp, ebp
call fcn.004264dc
call sub.cygwin1.dll___errno
mov dword [eax], 0
mov dword [edi], 0
jmp 0x415d1c
and dh, 0xdf
mov dword [edi + 0x28], edx
call fcn.004147b0
mov dword [edi + 4], 0
mov edx, 3
mov eax, edi
call fcn.00414e40
test eax, eax
mov dword [edi + 4], eax
je 0x416286
mov ebx, eax
jmp 0x415f4a
cmp byte [ebx + 0xa1], 0
jne 0x415e04
jmp 0x415e2f
or dword [edi + 0x28], 0x4000
jmp 0x415d1a
mov eax, dword [ebx + 0x30]
mov esi, dword [ebx + 4]
test eax, eax
jle 0x4160f9
cmp word [esi + 0x38], 0
jne 0x4160f9
mov eax, dword [edi + 0x28]
and eax, 0x18
cmp eax, 0x18
je 0x4162b7
xor ecx, ecx
mov edx, ebx
mov eax, edi
call fcn.004144d0
mov edx, dword [ebx + 0x50]
mov word [ebx + 0x3a], ax
and edx, 0xf000
cmp edx, 0x4000
jne 0x415e4f
mov ebp, dword [ebx + 0x30]
test ebp, ebp
je 0x41623c
movzx edx, word [esi + 0x38]
test dx, dx
je 0x41624d
sub edx, 1
mov word [esi + 0x38], dx
jmp 0x415e4f
mov eax, dword [esi + 0x24]
mov dword [esp], eax
call sub.cygwin1.dll_close
jmp 0x415d6a
mov edx, dword [edi + 0x10]
mov eax, dword [ebp + 0x28]
mov dword [edi], ebp
mov byte [edx + eax], 0
mov edx, 3
mov eax, edi
call fcn.00414e40
test eax, eax
mov ebx, eax
je 0x4161e4
mov dword [esp], esi
call fcn.004264dc
jmp 0x415e9a
mov ecx, 1
mov edx, ebx
mov eax, edi
call fcn.004144d0
cmp ax, 1
mov word [ebx + 0x3a], ax
je 0x41620e
mov eax, 3
mov word [ebx + 0x3e], ax
jmp 0x415e9a
mov eax, dword [ebp + 0x24]
mov dword [esp], eax
call sub.cygwin1.dll_fchdir
test eax, eax
je 0x415cf5
call sub.cygwin1.dll___errno
mov ebx, dword [eax]
mov eax, dword [ebp + 0x24]
mov dword [esp], eax
call sub.cygwin1.dll_close
call sub.cygwin1.dll___errno
mov dword [eax], ebx
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [ebp + 0x20], eax
or dword [edi + 0x28], 0x4000
jmp 0x415cf5
test byte [edi + 0x29], 0x40
jne 0x415d1a
mov ebp, dword [esi + 4]
jmp 0x415caa
mov edx, dword [edi + 0x28]
test dl, 4
je 0x41625e
mov dword [edi], esi
mov ebx, esi
jmp 0x415e4f
mov ebx, esi
jmp 0x415ee3
mov edx, dword [edi + 0x28]
test dl, 4
jne 0x416194
mov eax, dword [edi + 0x18]
mov ecx, 0x42c124
call fcn.00414a20
test eax, eax
mov dword [ebx + 0x24], eax
js 0x416371
or word [ebx + 0x3c], 2
jmp 0x416194
cmp ax, 1
je 0x415e62
mov ebp, ebx
jmp 0x415d1c
cmp ax, 1
je 0x415e68
mov ebp, ebx
jmp 0x415d1c
mov eax, dword [edi + 0x18]
mov ecx, 0x42c124
call fcn.00414a20
test eax, eax
mov dword [esi + 0x24], eax
js 0x416305
or word [esi + 0x3c], 2
movzx eax, word [esi + 0x3a]
mov ebx, esi
jmp 0x415e43
test byte [edi + 0x29], 0x40
jne 0x415d1a
mov eax, dword [esi + 0x20]
test eax, eax
je 0x4162a7
cmp word [esi + 0x3a], 4
je 0x4162a7
mov eax, 7
mov word [esi + 0x3a], ax
mov edx, esi
mov eax, edi
mov ebp, esi
call fcn.00414da0
jmp 0x415d1c
mov ebp, dword [esi + 0x2c]
test byte [ebp + 0x29], 2
mov edx, dword [ebp + 0x2c]
je 0x4160f9
test edx, edx
je 0x416386
mov eax, dword [esi + 0x40]
mov dword [esp], edx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x38], eax
lea eax, [esp + 0x38]
mov dword [esp + 4], eax
call fcn.0040f1e0
test eax, eax
mov edx, dword [esp + 0x2c]
je 0x41631f
cmp byte [eax + 4], 0
je 0x4160f9
movzx eax, word [ebx + 0x3a]
jmp 0x415e4f
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov word [esi + 0x3a], 7
mov dword [esi + 0x20], eax
mov eax, 7
jmp 0x4161fe
mov dword [esp], 8
mov dword [esp + 0x2c], edx
call sub.cygwin1.dll_malloc
test eax, eax
mov ebp, eax
je 0x4160f9
mov byte [eax + 4], 0
mov edx, dword [esp + 0x2c]
mov eax, dword [esi + 0x40]
mov dword [ebp], eax
mov dword [esp + 4], ebp
mov dword [esp], edx
call fcn.0040f9e0
test eax, eax
je 0x416364
cmp ebp, eax
je 0x4160f9
call sub.cygwin1.dll_abort
mov dword [esp], ebp
call fcn.004264dc
jmp 0x4160f9
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov word [ebx + 0x3a], 7
mov dword [ebx + 0x20], eax
jmp 0x416194
mov dword [esp + 0x10], fcn.004264dc
mov dword [esp + 0xc], 0x414460
mov dword [esp + 8], 0x414450
mov dword [esp + 4], 0
mov dword [esp], 0xd
call fcn.0040f410
test eax, eax
mov edx, eax
mov dword [ebp + 0x2c], eax
jne 0x4162cf
jmp 0x4160f9