Function at 0x481210
Capabilities:
Set current directory

Disassembly:
push ebp
mov eax, 0x110c
push edi
push esi
push ebx
call fcn.004e6390
sub esp, eax
mov edi, dword [esp + 0x1120]
mov ebx, dword [esp + 0x1124]
mov eax, dword [esp + 0x1128]
movzx edx, byte [edi]
test ebx, ebx
je 0x481348
cmp dl, 0x2f
je 0x4812b0
test eax, eax
jne 0x4813ba
test dl, dl
je 0x4817b1
mov eax, edi
mov ebx, 0xffffffff
lea esi, [esi]
add eax, 1
mov ecx, edx
movzx edx, byte [eax]
cmp cl, 0x2f
je 0x48129f
test dl, dl
jne 0x481260
add ebx, 1
mov eax, dword [esp + 0x1124]
mov dword [eax + 4], ebx
mov dword [esp], edi
call sym.zsh.exe_zchdir
add esp, 0x110c
pop ebx
pop esi
pop edi
pop ebp
ret
movzx edx, byte [eax + 1]
add eax, 1
cmp dl, 0x2f
je 0x481298
add ebx, 1
test dl, dl
jne 0x481260
jmp 0x481274
test eax, eax
je 0x481255
lea eax, [esp + 0x20]
mov esi, 0xffffffff
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x1124]
mov eax, dword [eax]
test eax, eax
jns 0x481568
mov dword [esp + 4], 0x8000
mov dword [esp], 0x4f9cbc
call sub.cygwin1.dll__open64
mov ecx, dword [esp + 0x1124]
mov byte [esp + 0x1f], 1
mov dword [ecx], eax
test eax, eax
jns 0x4813ec
mov dword [esp], ecx
call sym.zsh.exe_zgetdir
test eax, eax
je 0x4813ec
mov eax, dword [esp + 0x1124]
mov eax, dword [eax + 8]
cmp byte [eax], 0x2f
je 0x4813ec
mov dword [esp + 4], 0x8000
mov dword [esp], 0x4fa59e
call sub.cygwin1.dll__open64
mov ecx, dword [esp + 0x1124]
mov dword [ecx], eax
jmp 0x4813ec
mov dword [esp + 0x2c], 0
mov dword [esp + 0x30], 0
mov dword [esp + 0x34], 0
mov dword [esp + 0x28], 0
mov dword [esp + 0x24], 0xffffffff
mov dword [esp + 0x20], 0xffffffff
cmp dl, 0x2f
je 0x481589
test eax, eax
jne 0x4816a8
lea eax, [esp + 0x38]
mov dword [esp], 0x4f9cbc
mov dword [esp + 4], eax
call sub.cygwin1.dll__stat64
mov eax, dword [esp + 0x38]
mov edx, dword [esp + 0x44]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 0x34], edx
mov dword [esp + 0x30], eax
jmp 0x48127e
mov eax, dword [esp + 0x1124]
mov edx, dword [eax + 0xc]
test edx, edx
je 0x481681
lea eax, [esp + 0x20]
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x1124]
mov ecx, dword [eax]
test ecx, ecx
js 0x4817dd
mov byte [esp + 0x1f], 0
xor esi, esi
movzx edx, byte [edi]
cmp dl, 0x2f
je 0x48156d
lea ebp, [esp + 0xff]
cmp dl, 0x2f
je 0x4814fa
lea esi, [esi]
nop
test dl, dl
je 0x4816f0
mov ebx, edi
jmp 0x481424
cmp al, 0x2f
je 0x48142f
movzx eax, byte [ebx + 1]
add ebx, 1
test al, al
jne 0x481420
mov ecx, ebx
sub ecx, edi
cmp ecx, 0x1000
jg 0x481726
cmp edi, ebx
je 0x481500
xor eax, eax
jmp 0x481454
movzx edx, byte [edi + eax]
mov byte [ebp + eax], dl
add eax, 1
cmp ecx, eax
jne 0x481450
add ecx, ebp
lea eax, [esp + 0x38]
mov byte [ecx], 0
mov dword [esp + 4], eax
mov dword [esp], ebp
call fcn.004e5fe8
test eax, eax
jne 0x481507
mov eax, dword [esp + 0x48]
and eax, 0xf000
cmp eax, 0x4000
jne 0x481561
mov dword [esp], ebp
call fcn.004e5da0
test eax, eax
jne 0x481507
xor eax, eax
cmp esi, 0xffffffff
mov dword [esp], 0x4f9cbc
setne al
add esi, eax
lea eax, [esp + 0x98]
mov dword [esp + 4], eax
call fcn.004e5fe8
test eax, eax
jne 0x481507
mov eax, dword [esp + 0x98]
cmp dword [esp + 0x38], eax
jne 0x481561
mov edx, dword [esp + 0x40]
mov eax, dword [esp + 0x44]
xor edx, dword [esp + 0xa0]
xor eax, dword [esp + 0xa4]
or eax, edx
jne 0x481561
movzx edx, byte [ebx]
mov edi, ebx
cmp dl, 0x2f
jne 0x481410
lea ebx, [edi + 1]
jmp 0x4814ec
mov ecx, ebp
jmp 0x481461
call sub.cygwin1.dll___errno
mov ebx, dword [eax]
mov eax, dword [esp + 0x1124]
mov dword [esp], eax
call sym.zsh.exe_restoredir
test eax, eax
jne 0x4815c1
mov eax, dword [esp + 0x18]
cmp dword [esp + 0x1124], eax
je 0x481730
mov eax, dword [esp + 0x1124]
mov eax, dword [eax]
test eax, eax
js 0x48154a
cmp byte [esp + 0x1f], 0
jne 0x4815aa
call sub.cygwin1.dll___errno
mov dword [eax], ebx
add esp, 0x110c
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, 0x14
jmp 0x48150e
mov byte [esp + 0x1f], 0
mov dword [esp], 0x4f9f27
call fcn.004e5da0
test eax, eax
js 0x481795
movzx edx, byte [edi]
jmp 0x4813f8
test eax, eax
je 0x481389
lea eax, [esp + 0x20]
mov esi, 0xffffffff
mov dword [esp + 0x18], eax
mov dword [esp + 0x1124], eax
jmp 0x4812d2
mov dword [esp], eax
call fcn.004e5db0
mov eax, dword [esp + 0x1124]
mov dword [eax], 0xffffffff
jmp 0x48154a
call sub.cygwin1.dll___errno
mov edi, dword [sym.zsh.exe_home]
mov esi, dword [eax]
test edi, edi
je 0x4815fc
mov eax, dword [sym.zsh.exe_pwd]
mov dword [esp], eax
call sym.zsh.exe_zsfree
mov dword [esp], edi
call sym.zsh.exe_ztrdup
mov dword [esp], eax
mov dword [sym.zsh.exe_pwd], eax
call fcn.004e5da0
test eax, eax
je 0x481741
mov eax, dword [sym.zsh.exe_pwd]
mov dword [esp], eax
call sym.zsh.exe_zsfree
mov dword [esp], 0x4f9f27
call sym.zsh.exe_ztrdup
mov dword [esp], eax
mov dword [sym.zsh.exe_pwd], eax
call fcn.004e5da0
test eax, eax
je 0x481741
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], str.lost_current_directory__failed_to_cd_to__:__e
mov dword [esp + 4], eax
call sym.zsh.exe_zerr
mov eax, dword [esp + 0x18]
cmp dword [esp + 0x1124], eax
je 0x4817bb
mov eax, dword [esp + 0x1124]
mov eax, dword [eax]
test eax, eax
js 0x48166a
cmp byte [esp + 0x1f], 0
jne 0x48175f
call sub.cygwin1.dll___errno
mov dword [eax], ebx
add esp, 0x110c
mov eax, 0xfffffffe
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x1124]
mov esi, dword [esp + 0x1124]
mov eax, dword [eax + 0x14]
or eax, dword [esi + 0x10]
jne 0x4813cc
lea eax, [esp + 0x20]
mov dword [esp + 0x18], eax
jmp 0x4816b7
lea eax, [esp + 0x20]
mov dword [esp + 0x18], eax
mov dword [esp + 0x1124], eax
lea eax, [esp + 0x38]
mov dword [esp], 0x4f9cbc
mov dword [esp + 4], eax
call sub.cygwin1.dll__stat64
mov esi, dword [esp + 0x1124]
mov eax, dword [esp + 0x38]
mov edx, dword [esp + 0x44]
mov dword [esi + 0xc], eax
mov eax, dword [esp + 0x40]
mov dword [esi + 0x14], edx
mov dword [esi + 0x10], eax
jmp 0x4813d4
mov eax, dword [esp + 0x18]
cmp dword [esp + 0x1124], eax
je 0x4817cc
mov eax, dword [esp + 0x1124]
mov dword [eax + 4], esi
mov eax, dword [esp + 0x1124]
mov eax, dword [eax]
test eax, eax
js 0x48171f
cmp byte [esp + 0x1f], 0
jne 0x481779
xor eax, eax
jmp 0x481286
mov ebx, 0x5b
jmp 0x48150e
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sym.zsh.exe_zsfree
jmp 0x481536
mov eax, dword [sym.zsh.exe_pwd]
mov dword [esp + 4], esi
mov dword [esp], str.lost_current_directory:__e:_changed_to___s
mov dword [esp + 8], eax
call sym.zsh.exe_zerr
jmp 0x481641
mov dword [esp], eax
call fcn.004e5db0
mov eax, dword [esp + 0x1124]
mov dword [eax], 0xffffffff
jmp 0x48166a
mov dword [esp], eax
call fcn.004e5db0
mov eax, dword [esp + 0x1124]
mov dword [eax], 0xffffffff
xor eax, eax
jmp 0x481286
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], str.failed_to_chdir___:__e
mov dword [esp + 4], eax
call sym.zsh.exe_zwarn
jmp 0x481581
mov ebx, 0xffffffff
jmp 0x481274
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sym.zsh.exe_zsfree
jmp 0x481652
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sym.zsh.exe_zsfree
jmp 0x48170b
xor esi, esi
jmp 0x4812d2