May 6th, 2015, 1:47
# python Script to decode samsung SSD Firmware .enc files
# by HaQue 06-May-2015
# NO ERROR CHECKING IS DONE!
# Input file should be an encoded .enc file.
# Output file will be input filename appended with ".decoded".
# USEAGE: python dsssd.py xxxxx.enc
# Example: python samsung_ssd_decode.py test.enc
import sys
lookup = [0x0f,0x00,0x0e,0x01,0x0d,0x02,0x0c,0x03,0x0b,0x04,0x0a,0x05,0x09,0x06,0x08,0x07]
decFile = open(sys.argv[1] + '.decoded', 'wb')
b = bytearray(open(sys.argv[1], 'rb').read())
for i in range(len(b)):
b[i] = (lookup[b[i] >> 0x04 & 0x0F] << 0x04) | (b[i] & 0x0F)
open(sys.argv[1] + '.decoded', 'wb').write(b)
May 6th, 2015, 3:55
May 12th, 2015, 9:44
lookup: array[0..15] of array[0..15] of BYTE =
[0xF0, ..., 0xF0]
[0x10, ..., 0x10]
[0xC0, ..., 0xC0]
[0x20, ..., 0x20]
[0x90, ..., 0x90]
[0x70, ..., 0x70]
[0xA0, ..., 0xA0]
[0x40, ..., 0x40]
[0x30, ..., 0x30]
[0xD0, ..., 0xD0]
[0x00, ..., 0x00]
[0xE0, ..., 0xE0]
[0x50, ..., 0x50]
[0xB0, ..., 0xB0]
[0x60, ..., 0x60]
[0x80, ..., 0x80];
b: array of BYTE;
i: Integer;
for i := 0 to Length(b)-1 do
b[i] := b[i] xor lookup[b[i]];
May 12th, 2015, 16:25
May 14th, 2015, 11:23
August 4th, 2015, 12:09
August 4th, 2015, 14:17
albanytech wrote:Now, I would like to make a change and encode to test a firmware package. While the code is straight forward, I'm having difficulty with the same process in reverse.
import sys
lookup = [0x01,0x03,0x05,0x07,0x09,0x0B,0x0D,0x0F,0x0E,0x0C,0x0A,0x08,0x06,0x04,0x02,0x00]
decFile = open(sys.argv[1] + '.encoded', 'wb')
b = bytearray(open(sys.argv[1], 'rb').read())
for i in range(len(b)):
b[i] = (lookup[b[i] >> 0x04 & 0x0F] << 0x04) | (b[i] & 0x0F)
open(sys.argv[1] + '.encoded', 'wb').write(b)
August 4th, 2015, 15:03
August 17th, 2015, 22:04
August 17th, 2015, 22:29
August 17th, 2015, 22:46
Forum Threads Posts Last Post
AAAAAAAA
aaaaaaaaaaaaa
Moderators:xiong,Raziel 8 11 vcxcvcx
12 months ago | By Raziel
BBBBBBBBB
bbbbbbbbb
Moderators:Myles 5 4 d
383 years ago | By xiong
Servicing, repair, faults and reliability
Ask question about servicing, repairs, faults and reliability.
Moderators:Donavan 0 0
CCCCCCCCCCCC
ccccccccc
Moderators:xiong 1 0 enter topicfdsfsdfs
12 months ago | By Raziel
August 17th, 2015, 22:51
August 26th, 2015, 7:21
August 26th, 2015, 8:40
Serdyuk wrote:Sorry for my stupid question, but i can't find any .enc files. There are only four files in iso image: btdsk.img, isolinux.bin, isolinux.cfg, memdisc.
October 2nd, 2015, 11:37
August 4th, 2016, 11:50
December 25th, 2017, 17:15
January 9th, 2018, 5:28
February 27th, 2018, 7:00
February 27th, 2018, 11:50
Powered by phpBB © phpBB Group.