Here is my first attempt at a multiple-programming-language obfu. It runs in perl and C++. Not very pretty though.... Can anyone suggest methods for merging two codesets?
//* print '';@_=<DATA>;$_[5]=~s /int //g;$_[5]=~ s/J/\$J/g;
//* print '';$_[5]=~ s/A/\$A/g;$_[5]=~ s/P/\$P/g;$_[5]=~ s/H/\$H/g;
//* print '';$_[6]=~ s/char /\@/;$_[6]=~ s/\[\]//;$_[7]=~ s/ i/\$i/g;
//* print '';$_[6]=~ s/\{/\(/;$_[6]=~ s/\}/\)/;$_[7]=~ s/int//;
//* print '';$_[7]=~ s/switch\(\$i\)\{/CASE\:/;for($i=8;$i<13;$i++){
//* print '';$_[$i]=~ s/cout<</print \$/;$_[$i]=~ s/<<j/\,\$j/g;
//* print '';$_[$i]=~ s/ / \$i eq /;$_[$i]=~ s/case/\(/;
//* print '';$_[$i]=~ s/\:/\)\&\&do\{/;$_[$i]=~ s/\;/\}\;/;
//* print '';$_[$i]=~ s/J/\$J/g;$_[$i]=~ s/P/\$P/g;
//* print '';$_[$i]=~ s/A/\$A/g;$_[$i]=~ s/H/\$H/g;}
//* print '';$_[12]=~ s/\}//;$_ [4]= '#'.$_ [4];my $japh;
//* print '';$_[10]=~ s/\$japh\[\$H\+\$H\+\$H\+\$J\]/ \$japh\[5\]\,\$j
+aph\[12\]\,\$japh\[8\],\$japh\[13\] /;
//* print '';foreach(@_){$japh = $japh . $_}eval $japh;
// __END__
#include <stdio.h>
#include <iostream.h>
void main()
{int J=0;int A=0;int P=0;int H=0;J++;A+=2;P-=1;H+=5;
char japh[] = {'J','s','a','u','t','P','h','c','r',' ','n','o','e','l'
+,'k',',','C'};
for(int i=0; i<5; i++){switch( i){
case 0:cout<<japh[J+P]<<japh[A+J]<<japh[J]<<japh[A+A]<<japh[9];break;
case 1:cout<<japh[A]<<japh[H+H]<<japh[11]<<japh[H+P]<<japh[H+J];break;
case 2:cout<<japh[H+H+A]<<japh[8]<<japh[H+A+A]<<japh[H+H+H+J];break;
case 3:cout<<japh[H+A+A]<<japh[H+J]<<japh[J+A+P]<<japh[H+A];break;
case 4:cout<<japh[H+H+H+P]<<japh[H+H+A]<<japh[H+H+P+P]<<japh[H+H+H];}}
}
In reply to JA(C|P)H
by ktross
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.