billythegoat356 / Hyperion

The most powerful 100% Python obfuscator.
Eclipse Public License 2.0
338 stars 58 forks source link

File not found. #7

Open therealOri opened 2 years ago

therealOri commented 2 years ago

When dragging and dropping a file into the terminal to be obfuscated it will firstly spit out an invalid file error, unless you press backspace once. (I have a fix for that and have manually edited that on my end with the following code) .replace('\\', ' ').strip()

file = input(stage(f"Drag the file you want to obfuscate {dark}-> {Col.reset}", "?", col2 = bpurple)).replace('\\', ' ').strip().replace('"','').replace("'","")



Now the error I'm encountering is:

Traceback (most recent call last):
  File "/home/ori/Desktop/Hyperion/hyperion.py", line 1003, in <module>
    main()
  File "/home/ori/Desktop/Hyperion/hyperion.py", line 992, in main
    with open(f'obf-{filename}', mode='w') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'obf-/home/ori/Desktop/Hyperion/test.py'

The issue here is that it's using the path to the file instead of the file name and obviously obf-/home/ori/Desktop/Hyperion/test.py' isn't going to exist.

The main issue and the reason this error happens is because "filename" isn't a valid file and is instead a path. (Idk how you managed to do this or make this happen..but man is it weird.)




Steps to reproduce

1 - Start Hyperion 2 - Drag and drop .py file into terminal window. (After using my "patch") 3 - Don't skip anything and type "n" when prompted. 4 - Oof (error happens)


Notes:

  • All of the code I am having issues with is in the main() function.
  • Error happens with and without my "patch".
  • Typing the file's name instead of dragging and dropping works. (file must be in current running directory with hyperion.py)
therealOri commented 2 years ago

Hmm, I think I may know what the issue is.

It's working with a windows path system but not linux/unix. It is trying to split \\ when linux/unix is /

Idk, I'm gonna mess around with that and see what happens.

Yep, this is the issue.

therealOri commented 2 years ago

I have made a pull request with a fix for some of my issues.

A fixed version can be found Here in case my pull request isn't accepted.

Edit: The pull request wasn't accepted so if you are using Linux, Mac, etc. (anything that isn't Windows) You will need to use my fork or else things won't work to well. (At least until things are fixed here).