Create a PHP normalizer in C

I need to make a C program based on Flex/Bison with two funcionalities:

1. executed as a standalone command:

pnorm <path-to-php/html>

2. Provide a function to other C programs... by example:

int pnorm(char *orig_filename, char *dest_filename) { ....... }

> In this case, the output is to dest_filename, not stdout.

The program should read an HTML/PHP file and print to stdout the result.

The result is normalized version of the PHP code.

The process should be done in 2 steps:



- convert $variable= base64_decode(...) in $variable="<printable characters>"

- convert eval(base64_decode(...) in eval("<php code> (printable characters) ");

- convert eval(mutltiple_functions("...")) in eval("<php code> (printable));

Also consider the "string1" . "string2" posibility as the source string

Where multiple_functions are all possible combinations of:

- base64_decode

- str_rot13

- gzinflate

- gzuncompress

- stripslashes

*1 please note that the resulting PHP code is not to be executed, it is just to be analyzed. It can result with syntactic errors.

*2 Consider that there could be necessary to recursivelly do this job. It means that the base64_decode can result as a new encoded string with another combination of these functions.



Once all strings are replaced with the decoded version, the software should make the next changes to the code:

1. Take off all the comments (Multi line comments and single line comments)

2. Convert all text to lowercase (statements, strings and every text). Remember that PHP source code is UTF-8

3. Convert all strings delimitators to " (double quote)

4. Convert all strings like "ab" . "cd" to "abcd"

5. Convert all strings like "ab" .chr(65) . "cd" to "abAcd" (only with printable characters)

6. convert "ab" . chr(64+1) ."cd" to "abAcd" (for basic operations: +,-,*,^)

7. Convert all strings like "ab\065" and "ab\x41" to "abA" (only with printable characters)

8. Replace all CR,LF,TAB with a single space

9. Remove all repeated spaces. Example: echo "hello"; -> to echo "hello"

10 Remove reduntant spaces after and before parenthesis, braces and comparison ops:

if ( $a == 2 ) { echo "2"; } --> to --> if ($a==2) {echo "2";}

Be careful with:

1. Segmentation faults

2. buffer overrun

3. memory management

Please try not to use but the standard libraries. (accepted are flex,bison,pcre and the standard libraries)

Also pleaseprovide the makefile.

The HTML code (imagine there is PHP embeded in an HTML file) should be lowered case,removed the CR,LF,TAB, removed the comments. Javascript should be treated as HTML code.

Please make me any question if you need.

Please respect the price you give me. Think well before offer.

Habilidades: Programação C, PHP, Arquitetura de software

Veja mais: Desarrollar logo para nueva empresa de software, Desarrollar logo para nueva empresa de software / Design logo for new software development company, Desarrollar software para admin de historia clínica, Desarrollar software para admin de historia clínica, facturación y agendamiento, Desarrollar software para admon de historia clínica, facturación y agendamiento, Desarrollar software y sitio web, Desarrollar software, desarrollar software, desarrollar software para hotel, desarrollar software gestion contable ventas facturacion, desarrollar software control clientes, desarrollar software control clientes project, desarrollar software 2, cronograma actividades para desarrollar software, desarrollar software php, php create static pages database, php create multiple choice website, php create image text, php create install database script, php create image function, php create png multiple pngs, mysql data php create dynamic graphs, php create calendar, php create div, php create small database

Acerca do Empregador:
( 2 comentários ) Talca, Chile

ID do Projeto: #14082585

17 freelancers are bidding on average $181 for this job


Hello I'm interesting your project very well I'm a Good C/C++, PHP, Java, Math, Algorithm expert. I m quite well experienced in these jobs. Let's go ahead with me I want to service for you continously. Tha Mais

$180 USD in 3 dias
(482 Comentários)

I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 7 years. My work is online game developing, and mainly focus on server side, using c++ under Linux environ Mais

$150 USD in 2 dias
(97 Comentários)

Hi Let's clarify the requirement in details also if you want us to share our previous work let us [url removed, login to view] have a few questions about your project, please send us message so that we can discuss more. Thanks & regar Mais

$237 USD in 10 dias
(78 Comentários)
$155 USD in 3 dias
(88 Comentários)
$150 USD in 3 dias
(46 Comentários)

Greetings sir, i am an expert freelancer for this job and your 100% satisfaction is assured if you allow me to serve. Here is the reason. Why you should pick me? a) I am a very expert and have the same kind of ex Mais

$250 USD in 3 dias
(22 Comentários)

Hey There !! We have Senn the job post of your And I am very interested to start work with you I am having major 13+ years experience in asp.net,C# mssql,html,html5, .net, mvc, MVC4,MVC5,php, MySQL,css,css3 Mais

$155 USD in 3 dias
(4 Comentários)

Not sure if flex & co. stuff are appropriate for PHP. I don't know them well enough to make them do the trick, so I'll need custom state machine as lexer. I need some time to understand how to use it with bison. Long s Mais

$228 USD in 10 dias
(13 Comentários)

Hello?, how are you? I have read your description in detail. So i can help you. I am experienced in windows and web development with Microsoft technologies using C#, ASP.NET, VB.NET, C++, Java, Android, iPhone and Wor Mais

$155 USD in 3 dias
(5 Comentários)

Hello there, Deepak this side from India. Thank you for posting the project, I have studied your requirements... I Have 8+ years of exp in the PHP and I Have a great portfolio as well. I am a team player and Mais

$155 USD in 3 dias
(8 Comentários)

Hi, I am a serious developer who aims to provide high quality services. If you contact me, we can discuss more things detail and will be achieved with each other's purpose. Good luck for your business…

$155 USD in 2 dias
(7 Comentários)

Dear, I have several years of experience in C programming language. I have implemented several projects related to language translators using Lex and Yacc. I am confident that I can finish the parser according to Mais

$133 USD in 5 dias
(2 Comentários)
$208 USD in 6 dias
(1 Comentário)

Hey We are a team of Technical Developers and have got expertise in such stuff. Ping me if you are looking for a quick resolution

$188 USD in 3 dias
(2 Comentários)

Dear Prospect Hiring Manager. Thank you for giving me a chance to bid on your project. i am a serious bidder here and i have already worked on a similar project before and can deliver as u have mentioned I have Mais

$208 USD in 6 dias
(1 Comentário)
$207 USD in 6 dias
(0 Comentários)

Hi, I’m dedicated professional Web and Desktop Programmer & Developer and freelancer only. I have been working with challenge and hope to improve future plan with good network every client. If any client want to get Mais

$155 USD in 3 dias
(0 Comentários)

Hello dear, I have good experience in C programming language. I have been using Lex/Flex and Bison/Yacc tools with several projects related to compilers and query processing tools. I have read and understood all Mais

$200 USD in 6 dias
(3 Comentários)

Hi, I read through your project description very well and I am interested in doing this project. About me, I am a professional software developer with more than 5 years experience in making applications for small and Mais

$230 USD in 10 dias
(0 Comentários)

Hi, we are a 1000 + employee firm. Charging 6$ an hour. Can start any technology immediately. Direct access to developers via Skype, G talk and hotline – 24/7 availability for all 1000+ resource. We can bet you that no Mais

$155 USD in 3 dias
(0 Comentários)