Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss. print.
OBFUSCATOR: ENCRYPT YOUR SOURCE CODES

Introduction: What is obfuscator?
Obfuscator is a program that garbles a source either by encryption or by substitution of codes. This means that the source to be compiled is hard to understand and hard to debug. But during runtime it is decrypted as pure source.

Take a look at this. If I have a source say:


*--- code start ----------------->
PUBLIC VEmpNo, VSalary, VWorkingDays, VPerDay

VEmpNo = '00001'
VPerDay = 100.00
VWorkingDays = 5
VSalary = VPerDay * VWorkingDays

? 'The Salary of Empno:' + VEmpNo + ' = ' + trans(VSalary,'99,999.99')
*--- code end ------------------->

And we obfuscate them before compiling them, we have:

*--- code start ----------------->
PUBLIC si2l2k1, poo11k1i2o, w7wuie86wl, ukkgd1h390shd

si2l2k1 = '00001'
ukkgd1h390shd = 100.00
w7wuie86wl = 5
poo11k1i2o = ukkgd1h390shd * w7wuie86wl

? 'The Salary of Empno:' + si2l2k1 + ' = ' + trans(poo11k1i2o,'99,999.99')
*--- code end ------------------->

Therefore, if we compile this code it will still work. Right? However, if somebody decompile this, let's say using REFOX, they will get the Obfuscated code as shown above AND IT IS HARD TO DEBUG. Will you debug this?

Limitation
You'll get an error if you specify 'THISFORM' in your source. Rather, you should specify the formname say 'MYFORMNAME'. Thus having a code such as,

*--- form.init start ------------->
thisform.caption = 'Hello World'
*--- form.init end --------------->

Should be:

*--- form.init start ------------->
myformname.caption = 'Hello World'
*--- form.init end --------------->

How to use obfuscator?
Run obfuscate.exe and input the myformname.scx and click button. Then, compile your form. see if it runs.

Note
Be sure to backup your form, this is a demo for foxpro developers. It is planned to be enhanced and be improved by you as a developer. If you found a bug, you could e-mail me for such report. However, you have the freedom not to do so.


This is an open source for public use. You could alter and modify the encryption technique for your own use. The purpose of this obfuscator is to FRUSTRATE decompilers. Yes they could decompile, yet they need an ANTI-OBFUSCATING program. With such OPEN SOURCE, there would be many versions of OBFUSCATING ALGORITHM and you need to FED all the algo to ANTI-OBFUSCATING programs.

Download code
Click here to download the code that is discussed in this article. The download is a zipfile. Its size is 26,311 bytes.

ABOUT THE AUTHOR: MZ

Mz David has been programming the Fox since 1999. He graduated as a mathematician in 1996. David's main line of business is POS (Point of Sale) and Inventory Systems. He has developped different POSWares in C, Progress, Delphi, FoxDOS 2.6, Clipper and VFP. David currently is the head of the development department of his company Applied Ideas.

FEEDBACK


Your Name: 
Your Feedback: 

Spam Protection:
Enter the code shown: