Extracting and using exceptions when using Perl Obfuscator
Table of contents
Extacting list of symbols
There are several ways to extract a list of exceptions. If not specified otherwise, you should paste extracted exceptions as explained here. Also see extracting exceptions from HTML if your project is web-oriented.
- Go to - it will extract symbols from all modules outside of your project's input directory (e.g. modules installed along Perl's installation).
- For symbols that are defined in public interface of ActiveX or OLE component, it's possible
to extract names of these symbols using Project Manager - go to the
Please note that trial version doesn't have this function.
.
For each component your project uses, select the component, click the
button, and you will be prompted to save a list of exceptions extracted from the
component to the file of your choice.
- You can create a new project containing only modules that you need to extact symbols from,
and without touching any settings, do
You will have to review it and remove names of local variables, names of private symbols, and then use remaining symbols as exceptions. If all symbols exported by that module have same prefix, then you just select all symbols with that prefix as exceptions.
, and then go to
, scroll to bottom and
click on - this
way you will get names of all symbols found in those modules .
- Produce a list of exceptions manually. Sometimes this is necessary even for symbols from external module too.
- Use
gen-ident-exceptions.pl
utility shipped with Perl-Obfus as explained here. You can also use it from GUI - see first item on When using GUI tab. GUI also allows to extract symbols that are defined in public interface of ActiveX or OLE components, without creating any project. See second item on When using GUI tab for how to do this.
- You can create a new project containing only modules that you need to extact symbols from,
and then process it
perl-obfus
, appending -D mapping.txt to its command line, and then use first column from mapping.txt as a list of all encountered symbols. This way you will get names of all symbols found in those modules .You will have to review it and remove names of local variables, names of private symbols, and then use remaining symbols as exceptions. If all symbols exported by that module have same prefix, then you just take all symbols with that prefix and use them as exceptions.
- Produce a list of exceptions manually. Sometimes this is necessary even for symbols from external module too. Simply add them to the file (e.g. exceptions/manual.txt) one per line.
Adding symbols to exceptions
To add symbols to exceptions, simply go to
and paste the symbol names there, one per line.You can use empty lines to separate blocks of exceptions.
You can use #
to enter comments or comment out some symbols.
You can edit that list with your favourite text editor, as it's stored in plain text file list-of-symbols-for-obfuscator/user-exceptions.txt in your Project Input Directory.
You can also store the symbols in separate files. Just place those files (e.g. manual.txt, library1.txt, library2.txt) into some directory (e.g. named exceptions). To tell Perl-Obfus to read it, go to
, scroll to section , find entry with label " ", put a checkbox to the left of it, and put exceptions into the entry, then click at the bottom of the page.To add symbols to exceptions, simply put them to plain text file, one per line, and pass name of that file after -x switch.
You can use empty lines to separate blocks of exceptions.
You can use #
to enter comments or comment out some symbols.
You can also store the symbols in separate files. Just place those files (e.g. manual.txt, library1.txt, library2.txt) into some directory (e.g. named exceptions) and pass its name after -x swtich - perl-obfus will read all files from that directory.
Extracting exceptions from HTML
Project Manager GUI can automatically extract IDs and NAMEs of html elements and form fields, and add them to the list of exceptions. This is done for files that are assigned processing mode containing "special: copy file as is, .. use ids and names of .. elements in it as exceptions" in its name. To change processing mode for a file, go to
, put checkboxes near those files, select mode from drop-down list, click onYou can review symbols autoextracted this way in
.For generating a list of IDs and NAMEs of html elements and form fields, you can use get-idents-from-html.pl utility shipped with Perl-Obfus, by running it over all your html files, like this:
get-idents-from-html.pl -i exceptions/htmlidents.txt file1.html file2.html file3.html