fpt and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Ref Manual Home |

OBFUSCATE ONLY

Syntax:

OBFUSCATE ONLY

Function:

Renders code unreadable and unmaintainable, but preserves its integrity as compilable and functional Fortran.

The effects of this command are closely similar to those of OBFUSCATE ALL NAMES but the mechanism by which the command is carried out is different. fpt stops processing immediately after identification of the Fortran keywords and obfuscates all remaining names. It then writes the output code and exits. No other fpt commands or checks are carried out.

The command was created for the situation where fpt crashed during static semantic analysis while processing a user's code for obfuscation. This resulted in a game of blind-man's-buff. The user could not send the code to SimCon customer support because it was secret. That was why it was being obfuscated. SimCon could send parts of the fpt code to the user, but fpt is a large and complex program and difficult to debug.

To protect names from obfuscation please use the command KEEP NAMES. The command DO NOT OBFUSCATE works on symbols, not on name tokens, and the symbols will not be identified because static semantic analysis will not have been carried out.

Where to Use this Command

Operating system command line Yes
Configuration file, config.fsp No
Specification (fsp) files, *.fsp Yes
Interactively, to FPT> prompt No
Interactive command files No
Embedded in the Fortran code No

Default

User-defined names are not changed by default.

Example

The test program t_keep_names.f90:

PROGRAM t_keep_names INTEGER*4 :: k1 = 1,c1 = 1,k2 = 2,c2 = 2,k3 = 3,c3 = 3 WRITE(*,*)k1,c1,k2,c2,k3,c3 ! The following will generate an error only if SSA is completed IF (k3) THEN WRITE(*,'("INTEGER k3 used as LOGICAL")') ENDIF ! Check that .AND., .OR. and intrinsics are not obfuscated IF ((k2 .GT. k1) .AND. (k2 .LT. k3)) THEN WRITE(*,'("k1 < k2 < k3")') ENDIF IF ((MAX(k1,k2) .LT. k3) .OR. & (.NOT. (k1 .GE. k2))) THEN WRITE(*,'(".NOT. works as well")') ENDIF END PROGRAM t_keep_names ! ***************************************************************

is processed using the fsp script:

! t_keep_names_only.fsp 1-Feb-25 John Collins % primary input file name extension: ".f90" FPTMAIN:free_format.fsp % keep name: k1 % keep names: k2,k3 % overwrite changed files % correct use of integer for logical % obfuscate only % edit output file names: replace "names" by "names_only" FPTTESTS:t_keep_names.f90 ! End of t_keep_names_only.fsp

and generates:

PROGRAM aabjed INTEGER*4 :: k1 = 1,aabjeg = 1,k2 = 2,aabjei = 2,k3 = 3,aabjfa = 3 WRITE (*,*)k1,aabjeg,k2,aabjei,k3,aabjfa IF (k3) THEN WRITE (*,'("INTEGER k3 used as LOGICAL")') ENDIF IF ((k2 .GT. k1) .AND. & (k2 .LT. k3)) THEN WRITE (*,'("k1 < k2 < k3")') ENDIF IF ((MAX(k1,k2) .LT. k3) .OR. & (.NOT. (k1 .GE. k2))) THEN WRITE (*,'(".NOT. works as well")') ENDIF END PROGRAM aabjed

Copyright ©1995 to 2025 Software Validation Ltd. All rights reserved.