image

The A - Z of Revtran

 

Mike Rudin's Revtran has been around for an number of years now and is still regarded as controversial. The idea of Revtran is that it can take an existing Psion application and REVerse TRANslate it back into the original source code and this is where the controversy comes in - should you be able to see and make changes to someone else's code?

What might be considered ligitimate uses for Revtran?

What is NOT a ligitimate use for Revtran?

That said the results of Revtran are surprisingly good, with one or two exceptions. All variable names are replaced with meaningless ones, if there is a call to an OPX that it cannot reference it will give up on that procedure and if the author has added Revtran protection then it won't work at all.

See the simple example below. The code below has been written to demonstrate how Revtran tackles certain features, it was saved as test.opl.

INCLUDE "AppInfo.oxh"

PROC Proc1:
LOCAL s%
gUSE 1
gVISIBLE OFF
s%=gCREATE(100, 100, 100, 100, 1, $111)
gORDER s%,1
gBUTTON "Button", 2, 50, 25, 0
ENDP

PROC Proc2:
LOCAL aifFile$(255), iconFile$(255)
AppExtractAifIcon:(aifFile$, 16, 0, iconFile$+"16")
gIPRINT "Hello world"
GET
ENDP

The above code was complied and the resulting test.opo run through Revtran. The following code was produced by Revtran. Notice that the local variable s% in the original has been translated by Revtran to lc1z% and also that the call to the external procedure AppExtractAifIcon has not been translated and all of the rest of this procesdure skipped.

REM Reverse-translated Series 5 OPL,
REM created by Revtran V6.4 (2000) S5
REM from D:\Documents\Programming\Test.opo
REM on Sat 20 Jul 2002 09:58:17.

REM Please do NOT distribute any
REM program altered using Revtran,
REM except with permission from
REM the program's original author.

INCLUDE "Appinfo.oxh"
PROC Proc1:
LOCAL lc1z%
gUSE 1
gVISIBLE OFF
lc1z%=gCREATE(100,100,100,100,1,273)
gORDER lc1z%,1
gBUTTON "Button",2,50,25,0
ENDP

PROC Proc2:
!! Couldn't open *:\system\OPL\APPINFO.oxh ; routine lookup #1 !!
!! Unparseable command at &A4; procedure skipped. !!

REM Revtran V6.4 (2000) S5 finished.

Obviously if you have a copy of the appropriate header file, appinfo.oxh in this case, then the code will translate correctly, for example:

PROC Proc2:
LOCAL lc2z$(255),lc3z$(255)
AppExtractAifIcon:(lc2z$,16,0,lc3z$+"16")
GIPRINT "Hello world"
GET
ENDP

Notwithstanding these minor limitations 99 times out of 100 code that has been produced by Revtran will be useable and will complile first time.

image


Home  |  Programming  |  Resources  |  Downloads  |  Oddities  |  Links
Contact  |  Site map  |  Search