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
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.