"Let's model me a mine"
M.E.G.M.S.
Mining & Exploration Geological Modelling Services
FF08Obfuscate is a command line tool for generating a superficially obfuscated variant of the source of a Fortran 2008 program. It does this by modifying the identifiers in the program and rendering the code without any source comments. Bar a few exceptions (and bugs), the semantics of the resulting obfuscated source should be the same as the original program.
The tool does not change statement labels or literal constants in the source. Structurally the source code will be very similar. The degree of obfuscation is relative - perhaps the tool should be renamed FF08Irritate.
The tool itself is written in Fortran 2003. A zip archive of the latest source release (revision 3189 from 2024-08-12), available under an Apache 2.0 licence, can be found at www.megms.com.au/download/FF08Obfuscate.zip.
The obfuscation logic is limited to the information available from application of the syntax rules of the language. It does not consider the semantics of those syntax rules - the tool knows that a particular identifier is used in the program, but has no real idea what that identifier actually identifies. As a consequence, the following things are not handled correctly:
The results of applying the tool to its own main program can be seen at www.megms.com.au/download/FF08Obfuscate-main-obfuscated.f90.htm.
The command line has the following syntax:
FF08Obfuscate [options] source-file-specs...
Command line options:
source-file-specs is a list of the names of the Fortran source files to read.
The obfuscated source is written to the console. Errors and warnings generated while parsing the supplied Fortran source are written to the error unit.
STOP codes (which may also be the program's exit code):
The source code should be compilable by a Fortran 2003 compiler.
Intel Visual Fortran 16.0 was the compiler used for development. With that compiler, the /standard-semantics switch (or its equivalent on non-Windows platforms) is required.
The file compile-order.txt in the source archive specifies the order in which the included source files may be compiled.
Note that gfortran current trunk (at the time of writing r238060) cannot be used due to PR 44265, PR 71796 and PR 71807.
Questions, queries and quibbles can be sent to ff08@megms.com.au.