Đã Đóng

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.

Kĩ năng: Lập trình C, PHP, Kiến trúc phần mềm

Xem nhiều hơn: 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

Về Bên Thuê:
( 3 nhận xét ) Talca, Chile

ID dự án: #14082585

15 freelancer đang chào giá trung bình $183 cho công việc này


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 Thêm

$180 USD trong 3 ngày
(736 Nhận xét)

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 Thêm

$150 USD trong 2 ngày
(108 Nhận xét)

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 Thêm

$155 USD trong 3 ngày
(61 Nhận xét)
$155 USD trong 3 ngày
(122 Nhận xét)

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

$237 USD trong 10 ngày
(78 Nhận xét)
$150 USD trong 3 ngày
(46 Nhận xét)

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 Thêm

$250 USD trong 3 ngày
(34 Nhận xét)

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 trong 2 ngày
(20 Nhận xét)

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 Thêm

$228 USD trong 10 ngày
(14 Nhận xét)

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 Thêm

$155 USD trong 3 ngày
(5 Nhận xét)

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 Thêm

$155 USD trong 3 ngày
(8 Nhận xét)

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 Thêm

$155 USD trong 3 ngày
(6 Nhận xét)

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 trong 3 ngày
(4 Nhận xét)
$207 USD trong 6 ngày
(0 Nhận xét)

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 Thêm

$230 USD trong 10 ngày
(0 Nhận xét)