Function at 0x487069
Capabilities:
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x78
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x40]
and eax, 1
test al, al
jne 0x48708e
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
test eax, eax
jns 0x48708e
mov eax, 1
jmp 0x487093
mov eax, 0
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
je 0x4870e2
lea eax, [ebp - 0x30]
mov dword [esp], eax
call sub.cygwin1.dll_pipe
test eax, eax
jns 0x4870d9
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
test eax, eax
jle 0x4870cd
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
mov dword [esp], eax
call sub.cygwin1.dll_close
mov dword [ebp - 0x10], str.standard_input
jmp 0x487221
mov edx, dword [ebp - 0x2c]
mov eax, dword [ebp + 8]
mov dword [eax + 0x30], edx
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x40]
and eax, 2
test al, al
jne 0x48710f
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x40]
and eax, 0xffffff80
test al, al
jne 0x48710f
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
test eax, eax
jns 0x48710f
mov eax, 1
jmp 0x487114
mov eax, 0
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x487176
lea eax, [ebp - 0x38]
mov dword [esp], eax
call sub.cygwin1.dll_pipe
test eax, eax
jns 0x48716d
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0x1c], 0
je 0x487149
lea eax, [ebp - 0x30]
mov dword [esp], eax
call fcn.00486011
jmp 0x487161
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
test eax, eax
je 0x487161
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
mov dword [esp], eax
call sub.cygwin1.dll_close
mov dword [ebp - 0x10], str.standard_output
jmp 0x487221
mov edx, dword [ebp - 0x38]
mov eax, dword [ebp + 8]
mov dword [eax + 0x34], edx
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x40]
and eax, 4
test al, al
jne 0x487195
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x38]
test eax, eax
jns 0x487195
mov eax, 1
jmp 0x48719a
mov eax, 0
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
je 0x48727b
lea eax, [ebp - 0x40]
mov dword [esp], eax
call sub.cygwin1.dll_pipe
test eax, eax
jns 0x487272
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0x1c], 0
je 0x4871d7
lea eax, [ebp - 0x30]
mov dword [esp], eax
call fcn.00486011
jmp 0x4871ef
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
test eax, eax
je 0x4871ef
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
mov dword [esp], eax
call sub.cygwin1.dll_close
cmp dword [ebp - 0x20], 0
je 0x487202
lea eax, [ebp - 0x38]
mov dword [esp], eax
call fcn.00486011
jmp 0x48721a
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
test eax, eax
je 0x48721a
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
mov dword [esp], eax
call sub.cygwin1.dll_close
mov dword [ebp - 0x10], str.standard_error
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_strerror
mov edx, dword [ebp + 8]
mov edx, dword [edx]
mov edx, dword [edx]
mov dword [esp + 0xc], eax
mov dword [esp + 8], edx
mov eax, dword [ebp - 0x10]
mov dword [esp + 4], eax
mov dword [esp], str.cannot_create__s_pipe_for__s:__s
call fcn.004b5782
call fcn.00485b35
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00485d99
call sub.cygwin1.dll___errno
mov edx, dword [ebp - 0xc]
mov dword [eax], edx
mov eax, 0xffffffff
jmp 0x487930
mov edx, dword [ebp - 0x40]
mov eax, dword [ebp + 8]
mov dword [eax + 0x38], edx
mov eax, dword [ebp + 8]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x2d1
mov dword [esp], str.run_command.c
call fcn.004a16a0
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00486f46
mov dword [esp], 0
call sub.cygwin1.dll_fflush
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x40]
and eax, 0x40
test al, al
je 0x4872cb
mov eax, dword [0x61cf40]
mov eax, dword [eax + 8]
mov dword [esp], eax
call fcn.00446c36
mov dword [ebp - 0x14], 0xffffffff
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x54], 0x61d2ec
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
lea eax, [ebp - 0x54]
mov dword [esp], eax
call fcn.00486671
test eax, eax
jns 0x48734b
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
mov dword [eax + 0x18], 0xffffffff
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x40]
and eax, 0x10
test al, al
jne 0x4877d8
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [esp + 4], eax
mov dword [esp], str.cannot_run__s
call fcn.004b572d
call fcn.00485b35
jmp 0x4877d9
lea eax, [ebp - 0x48]
mov dword [esp], eax
call sub.cygwin1.dll_pipe
test eax, eax
je 0x487367
mov dword [ebp - 0x44], 0xffffffff
mov eax, dword [ebp - 0x44]
mov dword [ebp - 0x48], eax
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x40]
and eax, 1
test al, al
jne 0x487391
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x40]
and eax, 2
test al, al
jne 0x487391
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x40]
and eax, 4
test al, al
je 0x4873b3
mov dword [esp + 4], 0x40002
mov dword [esp], 0x5aed55
call fcn.004bab0e
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call fcn.00486b4c
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call fcn.00486783
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x64]
mov dword [esp], eax
call fcn.004869cc
call sub.cygwin1.dll_fork
mov edx, eax
mov eax, dword [ebp + 8]
mov dword [eax + 0x18], edx
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x18]
test eax, eax
jne 0x4876dd
mov dword [esp], 0x48650c
call fcn.004b5438
mov dword [esp], 0x486436
call fcn.004b5450
mov dword [esp], 0x4864a3
call fcn.004b5468
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
call sub.cygwin1.dll_close
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call fcn.00486b4c
mov eax, dword [ebp - 0x44]
mov dword [0x599c5c], eax
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x40]
and eax, 1
test al, al
je 0x487459
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call fcn.004863c1
jmp 0x4874ad
cmp dword [ebp - 0x1c], 0
je 0x48747f
mov eax, dword [ebp - 0x30]
mov dword [esp + 4], 0
mov dword [esp], eax
call fcn.004863c1
lea eax, [ebp - 0x30]
mov dword [esp], eax
call fcn.00486410
jmp 0x4874ad
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
test eax, eax
je 0x4874ad
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
mov dword [esp + 4], 0
mov dword [esp], eax
call fcn.004863c1
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
mov dword [esp], eax
call fcn.004863ec
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x40]
and eax, 4
test al, al
je 0x4874d0
mov dword [esp + 4], 2
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call fcn.004863c1
jmp 0x487525
cmp dword [ebp - 0x24], 0
je 0x4874f6
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], 2
mov dword [esp], eax
call fcn.004863c1
lea eax, [ebp - 0x40]
mov dword [esp], eax
call fcn.00486410
jmp 0x487525
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x38]
cmp eax, 1
jle 0x487525
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x38]
mov dword [esp + 4], 2
mov dword [esp], eax
call fcn.004863c1
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x38]
mov dword [esp], eax
call fcn.004863ec
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x40]
and eax, 2
test al, al
je 0x487548
mov dword [esp + 4], 1
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call fcn.004863c1
jmp 0x4875c1
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x40]
and eax, 0xffffff80
test al, al
je 0x48756c
mov dword [esp + 4], 1
mov dword [esp], 2
call fcn.004863c1
jmp 0x4875c1
cmp dword [ebp - 0x20], 0
je 0x487592
mov eax, dword [ebp - 0x34]
mov dword [esp + 4], 1
mov dword [esp], eax
call fcn.004863c1
lea eax, [ebp - 0x38]
mov dword [esp], eax
call fcn.00486410
jmp 0x4875c1
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
cmp eax, 1
jle 0x4875c1
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
mov dword [esp + 4], 1
mov dword [esp], eax
call fcn.004863c1
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
mov dword [esp], eax
call fcn.004863ec
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x3c]
test eax, eax
je 0x4875e9
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x3c]
mov dword [esp], eax
call sub.cygwin1.dll_chdir
test eax, eax
je 0x4875e9
mov dword [esp], 0
call fcn.00486383
mov dword [ebp - 0x18], 1
jmp 0x487621
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sub.cygwin1.dll_signal
cmp eax, 1
jne 0x48761d
mov dword [esp + 4], 1
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sub.cygwin1.dll_signal
add dword [ebp - 0x18], 1
cmp dword [ebp - 0x18], 0x20
jle 0x4875f2
mov dword [esp + 8], 0
lea eax, [ebp - 0x64]
add eax, 4
mov dword [esp + 4], eax
mov dword [esp], 0
call sub.cygwin1.dll_sigprocmask
test eax, eax
je 0x487655
mov dword [esp], 3
call fcn.00486383
mov eax, dword [ebp - 0x54]
lea ecx, [eax + 4]
mov eax, dword [ebp - 0x54]
add eax, 4
mov eax, dword [eax]
mov edx, dword [ebp - 0x28]
mov dword [esp + 8], edx
mov dword [esp + 4], ecx
mov dword [esp], eax
call sub.cygwin1.dll_execve
call sub.cygwin1.dll___errno
mov eax, dword [eax]
cmp eax, 8
jne 0x48769d
mov edx, dword [ebp - 0x54]
mov eax, dword [ebp - 0x54]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x28]
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.cygwin1.dll_execve
call sub.cygwin1.dll___errno
mov eax, dword [eax]
cmp eax, 2
jne 0x4876d1
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x40]
and eax, 0x10
test al, al
je 0x4876c3
mov dword [esp], 5
call fcn.00486383
mov dword [esp], 4
call fcn.00486383
jmp 0x4876dd
mov dword [esp], 6
call fcn.00486383
lea eax, [ebp - 0x64]
mov dword [esp], eax
call fcn.00486a98
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x18]
test eax, eax
jns 0x487710
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [esp + 4], eax
mov dword [esp], str.cannot_fork___for__s
call fcn.004b572d
call fcn.00485b35
jmp 0x487733
mov eax, dword [ebp + 8]
movzx eax, byte [eax + 0x41]
and eax, 1
test al, al
je 0x487733
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x18]
mov edx, dword [ebp + 8]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00485f5a
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call sub.cygwin1.dll_close
mov eax, dword [ebp - 0x48]
mov dword [esp + 8], 8
lea edx, [ebp - 0x5c]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.004bac5c
cmp eax, 8
jne 0x4877a4
mov eax, dword [ebp + 8]
mov eax, dword [eax]
mov edx, dword [eax]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x18]
mov dword [esp + 8], 0
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.00486b8e
lea eax, [ebp - 0x5c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.0048657c
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
mov dword [eax + 0x18], 0xffffffff
mov eax, dword [ebp - 0x48]
mov dword [esp], eax
call sub.cygwin1.dll_close
cmp dword [ebp - 0x14], 0
js 0x4877c0
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sub.cygwin1.dll_close
lea eax, [ebp - 0x54]
mov dword [esp], eax
call fcn.0049651f
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call sub.cygwin1.dll_free
jmp 0x4877d9
nop
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x18]
test eax, eax
jns 0x4878aa
mov dword [esp + 0xc], 0xffffffff
mov eax, dword [ebp + 8]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x3a9
mov dword [esp], str.run_command.c
call fcn.004a178a
cmp dword [ebp - 0x1c], 0
je 0x48781d
lea eax, [ebp - 0x30]
mov dword [esp], eax
call fcn.00486011
jmp 0x487835
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
test eax, eax
je 0x487835
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
mov dword [esp], eax
call sub.cygwin1.dll_close
cmp dword [ebp - 0x20], 0
je 0x487848
lea eax, [ebp - 0x38]
mov dword [esp], eax
call fcn.00486011
jmp 0x487860
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
test eax, eax
je 0x487860
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
mov dword [esp], eax
call sub.cygwin1.dll_close
cmp dword [ebp - 0x24], 0
je 0x487873
lea eax, [ebp - 0x40]
mov dword [esp], eax
call fcn.00486011
jmp 0x48788b
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x38]
test eax, eax
je 0x48788b
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x38]
mov dword [esp], eax
call sub.cygwin1.dll_close
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00485d99
call sub.cygwin1.dll___errno
mov edx, dword [ebp - 0xc]
mov dword [eax], edx
mov eax, 0xffffffff
jmp 0x487930
cmp dword [ebp - 0x1c], 0
je 0x4878bd
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sub.cygwin1.dll_close
jmp 0x4878d5
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
test eax, eax
je 0x4878d5
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x30]
mov dword [esp], eax
call sub.cygwin1.dll_close
cmp dword [ebp - 0x20], 0
je 0x4878e8
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call sub.cygwin1.dll_close
jmp 0x487900
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
test eax, eax
je 0x487900
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x34]
mov dword [esp], eax
call sub.cygwin1.dll_close
cmp dword [ebp - 0x24], 0
je 0x487913
mov eax, dword [ebp - 0x3c]
mov dword [esp], eax
call sub.cygwin1.dll_close
jmp 0x48792b
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x38]
test eax, eax
je 0x48792b
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x38]
mov dword [esp], eax
call sub.cygwin1.dll_close
mov eax, 0
leave
ret