Cryptor
Cryptor prevents unauthorised access to your application files via encryption. It then allow seamless access to your files in your application by adding a couple of lines of code. Multiple encryption levels are supported. Once a Visual FoxPro table encoded, it cannot be access from Visual FoxPro nor any other environment unless you have loaded the Cryptor registration function and password in memory. An encoded table with Cryptor will have little impact, depending on algorithm chosen and specific operation, on the performance of your application.
In some applications, mainly those being distributed on the Internet or any other aplication that require your data to only be readable from your application, the use of Cryptor is recommended. This is a small investment but surely one of the most important ones you will have to do for your application.
The use of Cryptor to protect your data is extremely powerful. However, it requires some considerations from your application. A few lines of code may be added in your application startup to load in memory all Cryptor registration to your files. You can also use various passwords for each file you wish to encode. From the Visual FoxPro command prompt or from the development environment, you should also consider you may have a need to load the Cryptor registration in memory if you wish to have access to your tables.
Load the library in memory
SET LIBRARY TO CRYPTOR
When you encode a file, it should not be in used. It is recommended to always include the full path of the file you are encoding. It is recommended to encode the CDX and FPT files as well. Most of the Cryptor functions will return 0 is the operation was completed successfully.
Encode('test.dbf','mypassword',.F.)
Access an encoded file
To access an encoded file, we need to load the Cryptor registration in memory. Once done, we are now ready to access the file.
Cryptor('test.dbf','mypassword')
The Decode() function remove the encoded access from a table. A table should not be in use before attempting a decode on it.
Decode('test.dbf','mypassword',.F.)
The Cryptoff() function removes a specific registration previously created by the Cryptor() function. A table should not be in use before attempting a decode on it. The act of un-registering a table means that future access to the file will be direct and not through Cryptor.
Cryptoff('test.dbf')
Cryptor is not royalty free. A special runtime version of Cryptor for specific number of users is available. There is also an unlimited number of users licence available. You may use that version of the library with your distributed application. That library can only be used from your EXE and not from Visual FoxPro.
Refox
ReFox is a decompiler for FoxPro. It supports all versions of FoxPro. With Refox, fully formatted source code retrieval is a snap. It can split FoxPro EXE's and APP's into their components to recover embedded Reports, Labels, etc. It also allows you to Brand your code to prevent unwanted decompilation. This is a lifesaver if your source files are damaged or lost.
Not only do you require protection to your source code from an EXE, but if you have encoded your data with Cryptor, for example, where the Cryptor password is inside the EXE, you will certainly want to protect your EXE as well to avoid someone to decompile it to get access to the password. There is no use to encode your data if you do not protect your EXE. However, in some applications, some techniques are used to avoid having the Cryptor password inside the EXE. One of them is to get that password from the Internet.
Despite the fact that it is illegal to decompile an EXE, unless you are the owner of it, there is always a chance someone will want to do it.
You may consider that investment to be another important one. It requires additional processing before preparing your install setup but it is well worth it.
Refox offers two levels of protection for your EXE called Branding. The branding does not interfere with Visual FoxPro performance.
Level I will still allow recovery of source code with Refox by supplying a password. Also, you will need to add some code in your files for Refox.
Level II is not decompilable by Refox. It also does not require you to add some code in your files. It consist of branding your EXE with the runtime files. So, only running the EXE with those runtime files will work.
That level offers your EXE maximum protection but includes some disavantages.
Here's a scenario to use Refox to protect your EXE with branding level II. To be able to use this scenario, you need to ensure Refox options shows Level II Branding.
Now, we need to brand the EXE:
Now, you have branded your EXE with Refox branding Level II. However, it won't run if it does not run with the Visual FoxPro runtime branded with Level II as well. You may proceed with the same steps to brand your VFP500.DLL as well. Once completed, you should now be able to run your EXE with the following command assuming your EXE name is MAIN, the directory is D:\MFUG and that the VFP500.DLL branded version is in the same directory
D:\MFUG\MAIN.EXE -DD:\MFUG\VFP500.DLL
COMPAxiON
COMPAxiON is a 32 bits software that provides developers with a mechanism not only to compress files, but to retain normal random access to them while still compressed. This will function on any readable storage media including CD-ROM's, floppy disks, etc.
COMPAxiON will allow you to compress a DBF file and get access to it without having to decompress it entirely first. Only the portions being read will be decompressed seamlessly in memory. In some situations, this can be really useful. For example, you may open a 3 MB compressed DBF file from a floppy disk, make some changes and add some records to it.
The current version supports single user operation only for read/write access and shared access to read-only volumes.
COMPAxiON is a powerful tool but may not be recommended if you are doing intensive maintenance on a table. For example, if your application constantly update your table by doing batch processes or any other kind of operations, the performance may suffer a little bit as this is not a direct DBF file access. However, for those kind of operations, this may still be acceptable if performance is not really a factor. When being used in an application which is not doing data intensive maintenance or is mostly a read only application, this may be an interesting tool especially if you deal with large tables and/or if disk space is a factor.
SET LIBRARY TO CPAXFLL
Assuming we have a clients table including a memo and a CDX files, the following would add those 3 files in a COMPAxiON file called CLIENT.CXI in the current directory. We assume that the clients table is located in D:\DATA and no other file are beginnig with D:\DATA\CLIENT*.*.
Cpax_Add('CLIENT.CXI','D:\DATA\CLIENT.*')
The function Cpax_List() will create an array with the files list description from a COMPAxiON file. The second parameter is used for the array name.
Cpax_List('CLIENT.CXI','laFiles')
Adding a file to an existing COMPAxiON file
Once a COMPAxiON file has been created, you can add more files to it. We can use the same function we used when we created the file. If the name of the COMPAxiON file is an existing file, the new file will be added to it. Otherwise, a new COMPAxiON file will be created.
The following will add the invoices files to the existing CLIENT.CXI file. Note here that we are still passing the * parameter to specify all files having INVOICE as the file name. We could have passed INVOICE.DBF to only add the invoices table to CLIENT.CXI.
Cpax_Add('CLIENT.CXI','D:\DATA\INVOICE.*')
To extract a file from an existing COMPAxiON file, we will use the Cpax_Extract() function. We will also take care of extracting the file one by one. We need to specify the full path of the file contained in the COMPAxiON file. We will also add another parameter to specify the destination.
Cpax_Extract('CLIENT.CXI','D:\DATA\INVOICE.DBF','D:\INVOICE.DBF') Cpax_Extract('CLIENT.CXI','D:\DATA\INVOICE.CDX','D:\INVOICE.CDX')
The Cpax_Delete() function will allow us to delete a file from a COMPAxiON file. As oppose to the Cpax_Extract() function which only take a copy out of the COMPAxiON file, this function will delete the file from it.
Cpax_Delete('CLIENT.CXI','D:\DATA\INVOICE.DBF') Cpax_Delete('CLIENT.CXI','D:\DATA\INVOICE.CDX')
The COMPAxiON library also includes some other nice functions. The function Cpax_Compress() gives the ability to compress a string. The following will compress a 64 bytes character string into 52 bytes.
LOCAL lcCompressText lcCompressText='' Cpax_Compress_Str('This is my very long string: AAAAAAABBBBBBCCCCCCCDDDDDDDEEEEEEEE',; @lcCompressText)
LOCAL lcDecompressText lcDecompressText='' Cpax_Decompress_Str(lcCompressText,@lcDecompressText)
The COMPAxiON library is extremely powerful. One of its main use is certainly to be able to archive several files in one COMPAxiON file and to be able to only extract a file from it, do some updates and add the file back in it. In the situation where we have an archive of about 20 MB and we only want to update a table in it having about 500 K, this library is the perfect tool for it. We won't have to unarchive the entire files but only the table we need. This will save some processing time and better disk space manipulation.
COMPAxiON is also available as a DLL for other development environments such as Visual C++, Delphi and Visual Basic. You may also download a pre-release version from Xitech's web site.
FoxFix
FoxFix can monitor and repair damage that may occur to Visual FoxPro data files after machine crashes or network errors for example, on both stand alone and networked systems. It can report DBF table and FPT memo headers in a networked environment while they are still being shared. It fixes the files before you get the error messages and minimise further corruptions. It also include additional tools for further internal DBF table and FPT memo files corruption and partial recovery from index files. Foxfix is a small utility that can save you a lot of time to repair your data files.
SET LIBRARY TO FOXFIX4
The FixDbf() function is the only function you will have to use. The first parameter is the name of the table. By the use of the table name, FoxFix will detect if a CDX and FPT files are present. The second parameter is used to tell FoxFix what operation to do. An optional parameter for the FPT block size can be passed. The default is 64.
The following table lists all return codes possibilities. A combination of multiple return codes may also be applicable.
The following table lists all return codes which represent an error.
Calling FixDbf('TEST.DBF',0) may return 12 (4+8) which means the record count and header ID are incorrect.
Calling FixDbf('TEST.DBF',1,128) will fix the DBF with a FPT blocksize of 128.
FoxFix also includes a variety of other tools for DBF and memo file scanning. Those tools have their own repair enhancements in cases where the header field definitions have been corrupted or offset. FoxFix 5.0 will introduce a complete revamp and whole set of developer tools for recovery and manipulation.
XiLights
XiLights will add a splash of colour to your Visual FoxPro desktop. Make more than just a fashion statement with this colour syntax highlighter which supports FoxPro for Windows and Visual FoxPro 3.0. It helps to identify typos and improve the code readability. Colour assignments to Visual FoxPro code keywords, program flow constructs, comments, string constants, numeric constants and system variables are fully customizable. This can also be applied to the Command and Trace windows.
SET LIBRARY TO XILIGHTS
SetColor() will allow you to customize the environment. It accepts two parameters. The first one is the type to specify the environment you wish to customize.
The second parameter is the color in a RGB() format.
The following will set the Visual FoxPro keywords in red.
SetColor(2,RGB(255,0,0))
The following will turn XiLights on.
ColorMode(1)