Line numbering in the source code
The obfuscated code retains the line positions of the source code. In VBA, each line of source code can be numbered at the start of the line, using an integer followed by by a colon (such 110:). When a runtime error occurs, the Erl system variable returns an integer indicating the line number of the last statement executed.
Once you know the line number in the obfuscated code where the error occurred, go to the corresponding line in the source code to see the faulty statement. Obfuscat does not alter the order of the lines related to the source code.
It is simpler not to set line numbering when programming, as best practice is to maintain ascending numbering (preferably matching the line number). Duplicate numbers are not permitted. The Obfuscat programme has an optional numbering function that automatically includes the consecutive number for each line in the code, removing all previous numbering. This feature means the programmer does not have to worry about numbering.
When programming common modules, it is sometimes necessary to exclude specific functions or instructions depending on the final use (for example, version for demo or version for production ).
The numbering function allows you to export multiple versions of the same source module, excluding specific lines based on the presence of certain keywords (which identify the different versions) in each line of the source code.
The numbering function also allows you to force the end of the source module file in advance, excluding all lines from that point onwards, based on the presence of certain keywords (which identify the different versions) in the line of source code that acts as the end of the file. Everything from that last line onwards is ignored.
Note: For the sake of simplicity, the numbering function treats lines that continue onto the next line (that is, those ending with an underscore “_”) as a single line of source code.
Parametrization in Dashboard
In the ‘Numbering phase’ section, there are several rows; each one can generate a different file with numbered source lines, depending on the parameters set.
Yes/No: Select ‘Yes’ to export a file based on the settings in this row. The exported file name will end in ‘.num.vb’ instead of the original ‘.vb’ extension. Select ‘No’ to skip this row; If all rows show ‘No’, the original source file is processed without any changes.
File name: Leave blank, or enter a file name to replace the original name of the import file.vb
Keywords to skip a line: Lines to be ignored. Keyword that, when appears, forces ignore the line. Used to remove specific line/s of debug or source code that you do not want to move to production. The line of source code is ignored (as if it had never existed in the import file) if one of the keywords appears in the text of that line of source code.
Keywords to end the file: Anticipated end of source code. Keyword that, when appears, forces ignore from that line and all subsequent lines. It is equivalent to a source code End Of File. Useful to remove debug code or source code at then end of the fille that you do not want to move to production. Any lines of source code from this point onwards will be ignored (as if they had never existed in the import file) if one of these keywords appears in the text of that line of source code.
