y and old(s,x,x+y-2) .. "X" .. old(s,x+y,y+x) or old(s,x,y) end) result="JARRGH"..result print (sub(result,0,8) .. sub(result,10,9) .. sub(result,10,100)); eos t.write(gg) t.close() res=`lua #{t.path}` def nastify(x) y=0 x.each_byte do |i| if (y+=1)%"JARRGH".length>0 then yield (i+' '.ord).chr else yield '' end end end nastify(res){|x| print x} X; $hc=<<= x) xs) main =mapM_ print ( qq ( [LIST_HERE]) ) X; $cc=<<<'X' #include float somethingsomethingdarkside(float x) { int i=*(int*)&x;float h=.5*x; i=(0x5f3759d0|15)-(i>>1); x=*(float*)&i; x=(x*(1.5-(h*x*x))); return x; } int main(int argc, char *argv[]) { argv[1][88]=0; int x=atoi(argv[1]+83)/5; x>>=1; int y=1/somethingsomethingdarkside(x); int y2=1/somethingsomethingdarkside(x+1); if (y==36 && y2!=y) { char buf[1000]; sprintf(buf,"%d%.2f%d",x,(float)x,x); char *t=buf+8;while (*t=*(t+1)) t++; printf("Correct:(%s)\n",buf); } else printf("No."); return 0; } X; function into_temp($code) { $f=tempnam(null,"polyglot_"); file_put_contents($f, $code); return $f; } function sys($com,$code) { return trim(shell_exec($com." ".into_temp($code))); } $password="KIWISOMETHING"; $rr=sys(chr(114).chr(117).chr(98).chr(121),str_replace("JARRGH", $password, $rc)); $pc=<<<'X' t=0 for x in list("STR"): t=(t+ord(x))*256 print t X; $n=sys("python",str_replace("STR", $rr, $pc)); $a=str_split($n,12); file_put_contents("hs.hs", str_replace("LIST_HERE", implode(",",$a), $hc)); shell_exec("ghc -o hh hs.hs 2>&1"); $ss=shell_exec("./hh"); $arg=implode("",explode("\n",$ss)); $g=ord($arg[121]); $f=ord($arg[122]); $a=ord($arg[86]); $b=ord($arg[85]); $g^=$b^=$g^=$b; $arg[121]=chr($g); $arg[85]=chr($b); $arg[122]=chr($a); $arg[86]=chr($f); file_put_contents("temp.c", $cc); shell_exec("gcc -o dark temp.c 2>&1"); $out=shell_exec("./dark {$arg}"); if (strpos($out, "Correct")!==false) echo "Flag is ".md5($password),PHP_EOL; else echo "No.";