Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
#DEFINE - Why?
Message
De
31/03/2008 13:21:29
 
 
À
31/03/2008 12:37:12
Jay Johengen
Altamahaw-Ossipee, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01306848
Message ID:
01307059
Vues:
12
>>>>>>>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform