Obfuscate integer and/or string literals (such as 42 or "42"). Literal integers can be replaced with opaque expressions, which requires that the InitOpaque transformation has been previously issued. Literal strings can be replaced with a function that generates them at runtime.  

Options

OptionArgumentsDescription
--Transform EncodeLiterals Replace literal integers and strings with less obvious expressions.
--EncodeLiteralsKinds integer, string, * Specify the types of literals to encode Default=integer,string.
  • integer = Replace literal integers with opaque expressions
  • string = Replace literal strings with calls to a function that generates them
  • * = Same as integer,string
--EncodeLiteralsEncoderName string The name of the generated encoder function (only for encoded strings). Default=None.
 

Examples

Obfuscate Literals
Replace literal integers with opaque expressions.
tigress --Environment=x86_64:Darwin:Clang:5.1 --Verbosity=1  \
   --Transform=InitOpaque --Functions=main \
   --Transform=EncodeLiterals --Functions=\* \
   --Transform=CleanUp --CleanUpKinds=annotations \
   --out=gen/obfuscateLiterals.c test1.c 


test1.cobfuscateLiterals.sh.txtobfuscateLiterals.c
 

Issues

Note that the generated string encoding function is trivial, by design. To be made less conspicuous, it should itself be transformed, for example using the Virtualize transformation (to hide the string contents) and the RndArgs transformation (to hide the interface).