brad-sp / cuckoo-modified

Modified edition of cuckoo
271 stars 98 forks source link

Windows formatting breaking scripts #204

Closed KillerInstinct closed 9 years ago

KillerInstinct commented 9 years ago

Basically any of the recent commits where there's an update like such: https://github.com/brad-accuvant/cuckoo-modified/commit/c897140353116c4e5129cff0a47153b27bcd24fe#diff-a2bdf19238a78e1bffbcaf0c73de25adR1

Appears to be breaking the script from running using the default loader (./cuckoo.py for example)

cuckoo@cuckoo:/opt/cuckoo$ ./cuckoo.py
./cuckoo.py: line 1: #!/usr/bin/env: No such file or directory
./cuckoo.py: line 6: import: command not found
./cuckoo.py: line 7: import: command not found
./cuckoo.py: line 8: import: command not found
./cuckoo.py: line 9: import: command not found
./cuckoo.py: line 11: try:: command not found
from: can't read /var/mail/lib.cuckoo.common.logo
from: can't read /var/mail/lib.cuckoo.common.config
from: can't read /var/mail/lib.cuckoo.common.constants
from: can't read /var/mail/lib.cuckoo.common.exceptions
from: can't read /var/mail/lib.cuckoo.common.exceptions
from: can't read /var/mail/lib.cuckoo.core.database
from: can't read /var/mail/lib.cuckoo.core.startup
from: can't read /var/mail/lib.cuckoo.core.startup
from: can't read /var/mail/lib.cuckoo.core.startup
from: can't read /var/mail/lib.cuckoo.core.startup
from: can't read /var/mail/lib.cuckoo.core.scheduler
from: can't read /var/mail/lib.cuckoo.core.resultserver
./cuckoo.py: line 25: import: command not found
./cuckoo.py: line 27: bson: command not found
./cuckoo.py: line 28: syntax error near unexpected token `CuckooDependencyError,'
./cuckoo.py: line 28: `except (CuckooDependencyError, ImportError) as e:'

After running dos2unix, heres my diff:

diff --git a/cuckoo.py b/cuckoo.py
index ccb1cc6..325c507 100755
--- a/cuckoo.py
+++ b/cuckoo.py
@@ -1,4 +1,4 @@
-<U+FEFF>#!/usr/bin/env python
+#!/usr/bin/env python
 # Copyright (C) 2010-2015 Cuckoo Foundation.
 # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
 # See the file 'docs/LICENSE' for copying permission.
brad-sp commented 9 years ago

Yeah, it was a bug in Python Tools that is only fixed in a nightly release. I'll write some script to remove it from all the files.