LandGrey / pydictor

A powerful and useful hacker dictionary builder for a brute-force attack
https://github.com/LandGrey/pydictor
GNU General Public License v3.0
3.26k stars 637 forks source link

fix(data.py): add symbolic link support #29

Closed senges closed 3 years ago

senges commented 3 years ago

In current version, pydictor won't work with symbolic links.

➜  ln -s /opt/pydictor/pydictor.py /usr/bin/pydictor
➜  pydictor 
Traceback (most recent call last):
  File "/usr/bin/pydictor", line 14, in <module>
    from core.BASE import get_base_dic
  File "/opt/pydictor/core/BASE.py", line 13, in <module>
    from lib.data.data import pystrs,  pyoptions
  File "/opt/pydictor/lib/data/data.py", line 307, in <module>
    init_pyoptions()
  File "/opt/pydictor/lib/data/data.py", line 212, in init_pyoptions
    pyoptions.core_range = [core[:-3].lower() for core in os.listdir(paths.core_path)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/pydictor'

With os.path.realpath instead of os.path.abspath, it will work either way.