KenMacD / wdpassport-utils

Code and information on how to unlock a WD My Passport drive in Linux.
127 stars 54 forks source link

sg_raw needs to be sudo-ized #4

Closed electronicsguy closed 3 years ago

electronicsguy commented 9 years ago

Hello, Thank you! Thank you for this! I was looking around for a long time for a Linux WD unlocker and you really made my day! How did you reverse engineer it? I'd love to contribute to it, esp. the encryption part.

A small note: the sg_raw commands needs to be sudo-ized. Also, in Ubuntu, the package name is "sg3-utils", not "sg3_utils". The command-line way works out of the box.

The GUI is giving errors, as reported in the previous issue. (Using python 2) Without 'sudo', it says: "/bin/sh: 1: cannot create /password.bin: Permission denied"

with 'sudo', it says: python: can't open file '/cookpw.py': [Errno 2] No such file or directory

I think the path is incorrect. There needs to be an extra "os.path.abspath" (ref: http://stackoverflow.com/questions/7783308/os-path-dirname-file-returns-empty). I've fixed this. Please see the pull request. However, the actual unlock using the GUI is still giving errors where it tries to send the SCSI commands. I'll try to fix this soon.

edit: The 'gksudo whoami' are unnecessary. They cause the 'try' blocks to fail. I don't know why those are indeed there. I removed them and the gui works fine for decrypt and mounting, the first time.

The gui still doesn't detect if the disk has already been unlocked. Due to this, if you try to send a second unlock request, it fails and the 'mount' button remains greyed out. I'll try to fix all these in a new version.

KenMacD commented 9 years ago

Hi. As #5 is merged, is there anything left to be done on this issue?

If not I'll close it, but improvement PRs are welcome.