Login   Register  
PHP Classes
elePHPant
Icontem

File: HowTo

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of hwrProgs  >  nabiBust  >  HowTo  >  Download  
File: HowTo
Role: Documentation
Content type: text/plain
Description: learn to use NabiBust
Class: nabiBust
Obfuscate PHP code scripts
Author: By
Last change:
Date: 2010-01-30 03:52
Size: 4,357 bytes
 

Contents

Class file image Download
WELCOME TO NabiBust, the PHP OBFUSCATOR!
_________________________________________________

How to Use the Obfuscator:
0. Example
1. Initiate system_classes class before anything else
2. Insert Source and target path
3. Clean up your code
4. Include/ Exclude a. folders, b. filenames, c.class names, d.variable names, e.functions
5. Execute obfusData.php to obfuscate the choosen files
6. Clean up
__________________________________________________

0.First, extract the files.

Second, try the example.
Therefore, run "php obfusData.php" and look in the folder "release". 

There, you'll find 8 folders. In the folder "step_8_final" are the obsfuscated example files.
You can compare the content of the "testfiles" source directory and the content of the "step_8_final".
In "testfiles", there is an folder called "not_to_obfuscate". 
The content of this folder will not be obfuscated. (You can read in chapter four, why.)

You have now successfully run the example. 
The rest of the document explains, how to use NabiBust in your project.
___________________________________________________

1.Initiate system_classes class before anything else
  
NabiBust changes (obfuscates) the names of your functions, classes, variables etc. 
Some names can not be changed, because they are pre-defined by the PHP system. 
To tell NabiBust the pre-defined names, you should use the class "system_classes.php". 
Please run system_classes::init() before all other declarations in your PHP project. 
Otherwise, the classes, variables, etc. declared before "system_classes::init" will be 
regarded as pre-defined and will not be obfuscated.
 
Here is how system_classes can be initialized:

	<?php
	require_once("class_system_classes.php");
	system_classes::init();
	?>

All further settings are made in the obfusData.php file.
____________________________________________________

2.Insert Source and target path

For using the Obfuscator for your own code, open obfusData.php and insert the source and the target 
path at the appropriate location (read the comments).	

Create a folder for your target directory. 

!!Warning!! 
The code deletes all files in your target directory!
____________________________________________________

3.Check your code

Go through your code and make sure, that you don't use  variables
like this:
	
	$$variablename
		
This obfuscator, does not support variables like that.
____________________________________________________

4. Exclude a. folders, b. filenames, c.class names, d.variable names, e.functions
	
Now scan the project for folders, files, classes, variables and functions that need 
to be excluded from obfuscation as described:
	
a.	Folders that need to be excluded are:
	- 	Folders with content that needs to be readable or alterable for the 
		user after obfuscation (if only a few files use "exclude_filename" (see later)).
	-	Folders that contain unknown source code, like 
		3rd party libraries
	
	( See in the example! There the folder "not_to_obfuscate" is excluded)
	
b.	Filenames that need to be excluded:
	-	files that have comments that are read and processed by a program
	-	files that need to be readable by the user after obfuscation
	
c.	class names that need to be excluded are:
	-	class names that are used in interpreted strings like in a callback or in reflection 
		or with "eval".
		
d.	variable names that need to be excluded:
	-	variable names that are used in interpreted strings, e.g by "eval" or by reflection.
	
e.	function names that need to be excluded:
	-	function names that are used in interpreted strings like in a callback or in reflection 
		or with "eval".	

There are various exclude settings in obfusData.php. Read the comments to see where and how!
________________________________________________________

5. Execute obfusData.php to obfuscate the choosen files.
	
You can see the result of obfuscation in your target directory!
_______________________________________________________	

6. Clean up

after running the obfuscation process you will find, depending on your settings,
up to 8 folders in the $target_directory
	
only folder "step_8_final" contains the completely obfuscated project, you can delete the rest.
__________________________________________________