Here is a little program that can
obfuscate and deobfuscate
Samsung SSD firmware files.
I'm against obfuscation because it's
a stupid malpractice aimed only
to keep off unliterate people.
Use as you please and drop me a comment/email
if it was useful to you.
Donations are welcome.
#include <stdio.h> #define HI_NIBBLE(b) (((b) >> 4) & 0x0F) #define LO_NIBBLE(b) ((b) & 0x0F) FILE *infile; FILE *infile2; FILE *outfile; int i, j, t; char table[2][16] = { {0x1, 0x3, 0x5, 0x7, 0x9, 0xb, 0xd, 0xf, 0xe, 0xc, 0xa, 0x8, 0x6, 0x4, 0x2, 0x0}, {0xf, 0x0, 0xe, 0x1, 0xd, 0x2, 0xc, 0x3, 0xb, 0x4, 0xa, 0x5, 0x9, 0x6, 0x8, 0x7} }; int main (int argc, char *argv[]) { if (argc <= 3) printf ("Usage: %s enc/dec infile outfile\n", argv[0]); else { infile = fopen (argv[2], "r"); outfile = fopen (argv[3], "w"); while (1) { i = fgetc (infile); if (feof (infile)) break; if (strcmp (argv[1], "enc") == 0) { t = 0; } else if (strcmp (argv[1], "dec") == 0) { t = 1; } else printf ("Usage: %s enc/dec infile outfile\n", argv[0]); j = ((table[t][HI_NIBBLE (i)]) << 4) | LO_NIBBLE (i); fputc (j, outfile); } fclose (infile); fclose (outfile); return 0; } }
The above script produces only 6 bit long file containing word "".
ReplyDelete(the source file was DSRD.ENC, 129 bytes.
Where is the problem?
https://github.com/Zibri/Samsung-SSD-Firmware-Decrypt
Deletehmm probably is a new type of file... with old ones (so far tested) it works.
ReplyDelete