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

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

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

Obfuscation will never work.

ml> Hello again, sweet readers ! OpenRG is an embedded OS for routers. It's based on Linux and it's inside many ISP routers out there. Inside OpenRG configuration file, passwords appear in a way that can seem to be crypted, but it's just obfuscated. For example: (username(admin)) (password(&b7;X&5c;&b9;&a2;)) Above you can see a simple deobfuscator. Enjoy! You can try it with: &ad;Y&5b;&b3;&a3;&17;T&8b;&c4;&b9;#&96;&04;c&ea;&1d;$%&5d;&16;&08;B3&c0; :) Zibri.