Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
#DEFINE - Why?
Message
From
31/03/2008 13:21:29
 
 
To
31/03/2008 12:37:12
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01306848
Message ID:
01307059
Views:
11
>>>>>>>>What is the simplest explanation as to why these are needed? Why not just set regular variable values? So what if they are constant and don't change?
>>>>>>>
>>>>>>>Security of the source code so that reverse engineering of an application won't give back that code.
>>>>>>
>>>>>>Good additional point.
>>>>>
>>>>>Give back what code?
>>>>>
>>>>>It would show "10" instead of "My_Constant" in the source. Is that a big security issue? Enough to not put it in a variable? It can only be done for constants, so constants are the only things that would be protected. Is that a valid security reason to use DEFINE?
>>>>
>>>>You got it wrong. When your source code is Re-foxed, the constants will remain as is (I'm guessing), e.g. you would not get your code as it was written originally with #DEFINE.
>>>>
>>>>That was Denis point, as I understood it.
>>>
>>>What part did I get wrong? That only the constants are protected?
>>__
>>
>>Oh, it's getting in slowly ...
>
>I didn't get that. Are you trying to be clever? How is all the source protected if I use one DEFINE?

You can use #DEFINEs to actually obfuscate your code. Suppose you have some nice readable source code:
TaxAmount = InvoiceSubTotal * TaxPercentage
Now, let's get cute:
#DEFINE TaxAmount         _0lO1Ol
#DEFINE InvoiceSubTotal   _0lOlOl
#DEFINE TaxPercentage     _0lO1O1
What actually gets compiled into your .EXE is
_0lO1Ol = _0lOlOl * _0lO1O1
So, if someone ReFoxes your code, that's all they get. It makes their life a LOT harder, trying to reverse-engineer your application.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform