Skip to main content

Samsung SSD firmware encoder/decoder.

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;
    }
}

Comments

  1. The above script produces only 6 bit long file containing word "".
    (the source file was DSRD.ENC, 129 bytes.
    Where is the problem?

    ReplyDelete
    Replies
    1. https://github.com/Zibri/Samsung-SSD-Firmware-Decrypt

      Delete
  2. hmm probably is a new type of file... with old ones (so far tested) it works.

    ReplyDelete

Post a Comment

Popular posts from this blog

TP-LINK Configuration file encrypt and decrypt.

Here we go! TP-Link is another company that thinks that security by obscurity could ever work. If you "backup" the configuration from most TP-Link routers, you will get a .BIN file which is "encrypted". Use this utility below, to decrypt it (so you can edit it) and encrypt it again. Have fun. Drop files here or

Your own CORS ANYWHERE proxy on CLOUDFLARE

Hello again! Many of you probably hate as I do CORS because it hinders the very nature of internet, which is SHARING. There are some services to circumvent this commercial  restriction, one of these is the famous "cors anywhere". So yesterday I decided to make my own and allow you to make your own in only 2 minutes. To do so you just need a cloudflare account (can be set up in 1 minute). The you can upload my worker on it and have your personal very fast cors proxy! So, enough talk, just head to:  https://github.com/Zibri/cloudflare-cors-anywhere The is also a demo online at: https://test.cors.workers.dev Enjoy! Zibri

Powerline Ethernet fun and secrets.

Many 200 Mb/s powerline adapters nowadays are based on the INTELLON 6300 chipset. Despite what can be thought looking at them, they are all using the same hardware and firmwares. I heard many people with Netgear XAV101 or Linksys PLK 200 or PLE 200 having problems after firmware updates and many other people with other brands having much more problems because of lack of support or configuration/upgrade utilities. So let me explain a few things I learnt studying them. Many of 200 Mb/s powerline ethernet adapters follow the "HomePlug AV" standard. (85 Mb adapters use HomePlug 1.0 standard which is completely different). This standard uses ethernet broadcast packets using the HomePlug AV protocol. The interesting thing is that their firmware is made of two different parts: a .PIB file (Parameter Information Block) and a .NVM file (the code itself). In the P.I.B. there are many interesting things: The branding (mac address, device name, etc) and the tone map. I test...