Worst abuse of the C preprocessor

In order to understand the code presented we have to clarify the concept of obfuscation. So the obfuscation in programming is the act of create code or machine code difficult to understand. This practice is used for protect the intellectual property or difficult the realization of reverse engineering.

The code below was created by Jim Hague, In 1986, he created this C Code that is able to translate morse code from ASCII code, which was selected for the 1987 t-shirt collection as “The worst abuse of the C preprocessor”.

Our objective in this blog is to understand this C code, and try to figure out what all these DIT, DAT, _, … are use for.

what this program does?

how it works?

  1. run the code with this command: “ gcc hague.c -o h”
  2. run the executable “./h”
  3. it will wait until you write a word or words
  4. get your morse code from the string or strings that you enter.
  5. go here and try your string in this audio translator

De-obfuscation!!

in order to get the file in the preprocessing phase we have to run this command: “gcc -E hague.c -o h” where hague.c is our .c file or the file that contains the above code, -o h means that the output is going to be stored in h, and -E flag is to stop in the preprocessor.