0
Almost complete Linux noob here, but I've been forced to switch over from Windows to a live Ubuntu to do some HDLocking magic.
TLDR; I have an old Original Xbox that needs the internal drive to be locked with a certain password to be able to boot up again (original drive died, but I managed to recover the internal EEPROM serial key, which is used to lock/unlock the drive)
So far : I have spent a few hours digging through google and can now comfortably lock, unlock and disable a plaintext password on the drive. But I dare not try with hex, given how there seems to be no '' or "" bracket support?, or any mention of reading hex (or converted hex)
This is the key in hex that I need to lock the drive with. 8e 05 80 83 89 85 67 2b c6 c3 c1 2a 9c ef d5 2a 44 63 90 e7 00 00 00 00 00 00 00 00 00 00 00 00
So far I've been using the following command to do a plaintext pass. hdparm --user-master u --security-set-pass PASSWORD /dev/sdc
Any Linux/Hex wizards here who can help me along? :)
That seemed to do the trick nicely! :)
Did have to throw a sudo at it to get it working though. – Mansen – 2019-05-21T06:43:40.250
Is there no way to provide the hex string directly to
hdparm
? I don't think this solves the issue when the password begins with null character, as bash will trim such string as part of expansion. – myxal – 2019-07-24T11:15:52.853@myxal: There is no implementation in
– Deltik – 2019-07-24T13:13:07.163hdparm
to handle a left-padding of null characters. Furthermore, C, the language in whichhdparm
is written, uses the null character as a string terminator, so even if you could pass in an argument that began with null, the whole string would be null. (This is not a Bash limitation.) If your hard drive password begins with a null, you will have to craft a raw SCSI command to send to the disk.@Deltik: Yes, that's exactly the problem. I was hoping
– myxal – 2019-07-24T15:48:38.790hdparm
itself would take the hex string as an argument and transform it into a byte array internally. There's a feature request with a patch that enableshdparm
to read the password from a file, which would also resolve the problem, but it was never committed AFAICT.1
@myxal: Good news! Turns out I was mistaken about
– Deltik – 2019-07-25T08:23:56.387hdparm
's binary security password capabilities.hdparm
version 9.46 and newer support binary passwords in the form of a hex string. See my updated answer for more information.