Techniques

Obfuscation techniques

Dependence of running environment and language

Some obfuscation techniques are dependent of the object to obfuscate. An interpreted language as Visual Basic is very different of a compiled executable code, as C or Assembler. Also, the syntax of the language must be taken in account when obfuscating. In this case, the objective is Microsoft VBA, typically used for Excel or Word macros. The point is that the VBA source code, created by the author, is directly interpreted in clear at runtime. The code can be executed in clear, statement to statement. Imagine the purpose of each statement is quite immediate. And the reverse engineering or unauthorized source code re-use is greatly facilitated.

Remove comments.

Source code usually has comments that help the author to understand the functionality of the statements. In VBA the comments follows an apostrophe ( ‘ ) at the end of the statements.

Remove indentations.

To visualise the structure of the program, the instructions are usually placed further and further to the right according to their nesting. All indents are removed to erase the nesting.

Substitution of names for variables and constants.

In general, each variable is assigned a name more or less representative of its contents. For example, ClientName or ClientCountry. Substitution also includes function names and label names. Variable names are replaced by random names composed even of only two pseudo-binary symbols ( letters o l ) such as oolollo

Substitution of values for constants.

All numbers and text in imperative assignment statements are removed. For example myA = 2    myB =”Please select a file”. The decrypted value of each constant is only returned when the instruction that uses it is executed. Constants in declarative statements ( Const myLong As Long = 1 ) can hardly be obfuscated, because of the very structure of the VBA language. Instead, replace them with Dim variables and assign their values within the imperative statements. ( Dim myLong As Long: myLong = 1 )

To know more

stackoverflow.com/questions/16765277/obfuscation-tool-for-ms-excel-vba

www.excel-pratique.com/en/vba_tricks/vba-obfuscator

stackoverflow.com/questions/551892/how-effective-is-obfuscation

softwarerecs.stackexchange.com/questions/10785/c-code-obfuscator

Free Java Bytecode Obfuscator yworks.com/products/yguard