JAxH混淆方法,不是文本[关闭]


12

JAPH是制作打印“ Just another Perl hacker”的程序的悠久传统。这个站点上已经有关于JAPH的问题,但他们似乎更关注隐藏文本,但是JAPH一直更多地是隐藏其执行方法的方法。因此,我要求您炫耀自己喜欢的语言的出色功能,不要太担心隐藏文本(除非您愿意)。

这是Perl的一个矿,对于一个经验丰富的速记员来说,这应该不难理解,但对其他人来说可能很有趣。

(*STORE,*TIESCALAR)=map{eval"sub{$_}"}qw'map{print&&sleep$|}split//,pop bless\$|++';tie$t,main;$t="Just another Perl hacker,\n"

由你们主观地投票,让我们看看一些弯腰的人!


也许您应该更新JAPH上的Wikipedia文章,因为它的大多数示例似乎都与隐藏文本有关。
彼得·泰勒

@PeterTaylor,好吧,有很多方法可以尝试隐藏文本,而这些都没有错,但是我想要一个能够探索该方法的方法。例如,见许多那些在发布cpan.org/misc/japh
乔尔·伯杰

1
“对于一个有经验的速记员来说,应该不难理解,但对其他人可能会很有趣”,这在任何Perl程序中都是如此,我不属于速记法者类别,所以我只想给你我困惑的《 Hash World in Bash》作为报仇的一种形式_2=($_1/*/*); ${_2[34]} -${_2[34]:5:1}'\110\145\154\154\157\54\40\127\157\162\154\144\41'

Answers:


29

C

必须编译为32bit。在64位计算机上使用gcc -m32或类似工具。

#include <stdlib.h>

int main() {
    char *c = "echo Just another C hacker";
    int foo=123; //unused                          /* Warning: there's a
    int k=(int)1                                    * (long) system
    //now for the fun part!                         * of chinese boxes
    //behold:                                       * in this code. */
    +0;
    -1;
    ((int(*)(char *))k)(c);
}

免责声明:不是我的主意。几年前,我发现它隐藏在某些代码中。说真的 他们的情况甚至更好,我忘记了一些小细节。但是要旨在那里。

看到它时,您将变成砖头。


1
什么... 您能解释一下这是为什么/为什么吗?
arshajii

1
哈!@arshajii,全都是烟和镜子。我不想在这里解释它,但是请仔细阅读代码。
面包箱

6
……那太可怕了。+1
Hasturkun

@Hasturkun谢谢。我确实为最坏的情况而努力。有一会儿我考虑将“ rm -rf〜”放在某个地方,但那本来就是不客气的;-)
Tobia

2
@面包啊!该/*被注释掉!facepalm :-P
门把手

6

Mathematica:

TextRecognize@
 ImageAssemble@
  Transpose@
   ImagePartition[Import@"http://i.stack.imgur.com/S9fci.png", 5] 

6

class Print{
  var PrinT,print,prinT;
  get PRint() => PrinT;
  get pRInt() => 'A$prinT';
  get pRint() => print;
  set pRInt(PrinT){print=PrinT;}
  set prInt(pRInt){prinT='n$pRInt';}
  Print(prinT,PRINT){
    PrinT = prinT;
    prInt = PRINT;
  }
  PRINT(print,PrinT){
    pRint.PRint('$print ${pRint.pRInt} $PRint $PrinT');
  }
  Print.print(print,prinT){
    pRInt = new Print(print,'other');
    PrinT = prinT;
  }
}
main(){
  Print print = new Print.print(print,'Dart');
  print.PRINT('Just','Hacker');
}

编辑:少无聊的二传手,少无聊的吸气剂。

我已经学习了这种语言一天,所以我认为其他人可能会认为这是孩子的烂摊子……:(


1
早期采用的道具,我会屈服于规则并投票给您。让我们看看法官(社区)的想法
Joel Berger

我同意乔尔。
DocMax 2011年

6

液化天然气

它在C语言中,但实际上表明您可以使用PRNG和输出来完成一些酷的事情Just another PRNG hacker

#include <stdio.h>

#define P 0x3A4B5C6D

char s[6];
int j, t;

void r(int d) {
  t = ((P * d + P) << 17) + ((P * d - P) >> 15) + P;
  for (j = 0; j < 5; j++) {
    s[j] = (t % 51) + 67;
    t /= 51;
    if ((s[j] >= 91) && (s[j] <= 96)) s[j] = 32;
  }
  printf("%s", s);
}

int main() {
  r(0x444C725);
  r(0x2D65DD4B);
  r(0x6C5C71A);
  r(0xB2A4BBD);
  r(0x275BD6F);
  return 0;
}

也可以使用内置的PRNG(商标,商标),但便携性较差。


哇。什么...我...哦,天哪
TehShrike 2011年

5

C

int main(int _)
{
    putchar(~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
    putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~
    putchar(~-~-~-~-~-~-
    putchar(-~-~-~-~-~-~-~-~
    putchar(-~-~
    putchar(~-~-~-~-~-~-~-
    putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
    putchar(~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
    putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
    putchar(~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
    putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~
    putchar(~-~-~-
    putchar(~-~-~-~-~-~-~-~-~-~-~-~-
    putchar(-~-~-~-~-~
    putchar(-~
    putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~
    putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
    putchar(~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
    putchar(-~
    putchar(~-~-
    putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
    putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~_
    ))))))))))))))))))))));
}

4

蟒蛇

credits.__class__(0,'Just another Python hacker')()

对此感到困惑的是什么?
FantaC

该方法的原因
etuardu

3

Java脚本

eval('Acy419yt=12-14;'.split('').map(function(x){return String.fromCharCode(
0240-x.charCodeAt(0))}).join(''))[_]((___='splitulengthureverseujoinufilter'
.split('\x75'),function __(_){return _[___[1]]?__(_[___[0][0]+___[___[3]](''
)[___[0]]('')[___[4]](function(_,__){return ~~(__/2)==1})[___[3]]('')+'ce'](
1))+_[0]:_}("Just Another JavaScript Hacker"))[___[0]]('')[___[2]]()[___[3]](''));

在我的代码中,JAJSH文本通过反向加密,不仅一次,而且两次!哈!你能找到吗?


2

哈斯克尔

我做了一些帮助

{-# LANGUAGE ForeignFunctionInterface #-}

import Control.Applicative
import Control.Monad
import Foreign
import Foreign.C

foreign import ccall "stdio.h puts"
    puts :: CString -> IO ()

main :: IO ()
main = liftM2 allocaBytes length
       ((<*> puts) . ((>>) .) . flip (flip zipWithM_ [0..] . pokeElemOff))
     $ map (fromIntegral . fromEnum) "Just another Haskell hacker\0"

只是为了好玩:

{-# LANGUAGE ForeignFunctionInterface #-}

import Control.Exception
import Control.Monad
import Data.Bits
import Data.Word
import Foreign
import Foreign.C

foreign import ccall "stdlib.h realloc"
    c_realloc :: Ptr a -> CSize -> IO (Ptr a)

foreign import ccall "stdlib.h free"
    c_free :: Ptr a -> IO ()

foreign import ccall "stdio.h puts"
    c_puts :: CString -> IO ()

-- | Write a UTF-8 character into a buffer.
--
-- Return the length of the character in bytes, which will be a number from 1-4.
pokeUtf8 :: Ptr Word8 -> Char -> IO Int
pokeUtf8 ptr char =
    case (fromIntegral . fromEnum) char :: Word32 of
        c | c <= 0x7F -> do
            put ptr c
            return 1
        c | c <= 0x7FF -> do
            put ptr                 (0xC0 .|. c `shiftR` 6)
            put (ptr `plusPtr` 1)   (0x80 .|. c .&. 0x3F)
            return 2
        c | c <= 0xFFFF ->
            if c >= 0xD800 && c <= 0xDFFF
                then replacement
                else do
                    put ptr                 (0xE0 .|. c `shiftR` 12)
                    put (ptr `plusPtr` 1)   (0x80 .|. c `shiftR` 6 .&. 0x3F)
                    put (ptr `plusPtr` 2)   (0x80 .|. c .&. 0x3F)
                    return 3
        c | c <= 0x10FFFF -> do
            put ptr                 (0xF0 .|. c `shiftR` 18)
            put (ptr `plusPtr` 1)   (0x80 .|. c `shiftR` 12 .&. 0x3F)
            put (ptr `plusPtr` 2)   (0x80 .|. c `shiftR` 6 .&. 0x3F)
            put (ptr `plusPtr` 3)   (0x80 .|. c .&. 0x3F)
            return 4
        _ -> replacement
    where
        put p c = poke p (fromIntegral c :: Word8)
        replacement = pokeUtf8 ptr '\xFFFD'

withUtf8 :: String -> (CStringLen -> IO a) -> IO a
withUtf8 string action = expand nullPtr 64 0 string where
    expand buf bufsize pos str = do
        buf' <- c_realloc buf (fromIntegral bufsize)
        when (buf' == nullPtr) $ do
            c_free buf
            ioError $ userError "Out of memory"
        write buf' bufsize pos str

    write buf bufsize pos str
        | bufsize - pos < 4 = expand buf (bufsize * 2) pos str
        | otherwise = do
            case str of
                (c:cs) -> do
                    len <- pokeUtf8 (buf `plusPtr` pos) c
                    write buf bufsize (pos + len) cs
                [] -> do
                    pokeByteOff buf pos (0 :: Word8)
                    finish buf pos

    finish buf len =
        finally (action (buf, len)) (c_free buf)

puts :: String -> IO ()
puts str = withUtf8 str (c_puts . fst)

main :: IO ()
main = puts "\x266B Just another C hacker using Haskell \x266B"

2

的JavaScript

在控制台中运行

({}+[])[!''+!''+!![]] + (!![]+[])[!''+!''] + (![]+[])[!''+!''+!''] + (!![]+[])[+![]] + ({}+[])[!![]+!''+!''+!''+!''+!''+!''] + (![]+[])[+!![]] + ([][{}]+[])[+!![]] + ({}+[])[+!''] +
(!![]+[])[+![]] + 'h' + (![]+[])[!''+!''+!![]+!![]] + (!![]+[])[+!![]] + ({}+[])[!![]+!![]+!''+!''+!''+!''+!''] + ({}+[])[!![]+!''+!![]] + (![]+[])[!![]+!''+!![]] + 
({}+[])[!![]+!![]+!![]+!![]+!''+!![]+!![]] + 'h' + (![]+[])[+!![]] + ({}+[])[!![]+!![]+!''+!![]+!![]] + 'k' + (![]+[])[!''+!![]+!![]+!''] + (!![]+[])[+!'']

2

Python 2.x(单个表达式)

现在,尽管对于Pythoneers来说这很容易弄清楚,但其他人可能至少觉得很有趣。如果您想知道为什么有那么多的lambda,我想拥有最大的下划线,但重复次数最少。谁不喜欢下划线?伊迪奥

(lambda ______________:(lambda ______,_______,________:(lambda _____:(lambda _,___,__,____,_____________:(lambda _________,__________:(lambda ___________,____________:___________(____________,____[_________**(_________+__________)-__________::_________+_________+_________]+_[__________::_________]+__[_________+__________])(____________,______________))((lambda _,__:________(______(_))[__]),(________(__import__(_[_________]+__[_________*_________+__________]+_[_________]))[_[_________:_________+_________]+___[__________/_________]+__[__________]+_____(u'')[__________/_________]+_[_________+__________]])))((_____________(_)+_____________(_))/_____________(_),_____________(_)/_____________(_)))(_____([]),_____({}),_____(None),_____({}.__iter__),lambda _:len(_)))(lambda _:_______(______(_))))((lambda _:_.__class__),(lambda _:_.__name__),(lambda _:_.__dict__)))('Just another Python Hacker\n')

缩进版本,如果您愿意:

(lambda ______________:
    (lambda ______,_______,________:
        (lambda _____:
            (lambda _,___,__,____,_____________:
                (lambda _________,__________:
                    (lambda ___________,____________:
                        ___________(____________,____[_________**(_________+__________)-__________::_________+_________+_________]+_[__________::_________]+__[_________+__________])(____________,______________)) (
                        (lambda _,__:________(______(_))[__]),
                        (________(__import__(_[_________]+__[_________*_________+__________]+_[_________]))[_[_________:_________+_________]+___[__________/_________]+__[__________]+_____(u'')[__________/_________]+_[_________+__________]]))) (
                    (_____________(_)+_____________(_))/_____________(_),
                    _____________(_)/_____________(_))) (
                _____([]),
                _____({}),
                _____(None),
                _____({}.__iter__),
                lambda _:len(_))) (
            lambda _:_______(______(_)))) (
        (lambda _:_.__class__),
        (lambda _:_.__name__),
        (lambda _:_.__dict__)))('Just another Python Hacker\n')

这定义了一个函数,并使用“ Just another Python Hacker”进行调用。现在,它不必一定是一个函数,但我认为它会更优雅。

f = (lambda ______________:(lambda ______,_______,________:(lambda _____:(lambda _,___,__,____,_____________:(lambda _________,__________:(lambda ___________,____________:___________(____________,____[_________**(_________+__________)-__________::_________+_________+_________]+_[__________::_________]+__[_________+__________])(____________,______________))((lambda _,__:________(______(_))[__]),(________(__import__(_[_________]+__[_________*_________+__________]+_[_________]))[_[_________:_________+_________]+___[__________/_________]+__[__________]+_____(u'')[__________/_________]+_[_________+__________]])))((_____________(_)+_____________(_))/_____________(_),_____________(_)/_____________(_)))(_____([]),_____({}),_____(None),_____({}.__iter__),lambda _:len(_)))(lambda _:_______(______(_))))((lambda _:_.__class__),(lambda _:_.__name__),(lambda _:_.__dict__)))
f('Hello.\n')
f('Just another Python Hacker here.\n')

哦,正好是900个字节。那完全是无意的和令人敬畏的。
seequ 2014年

显然,它仅适用于Python 2.x
seequ 2014年

2

QBasic

这是我在QBasic中的实现。为了使其正常执行,该程序必须称为“ JAQBH.BAS”,因为它会读取自己的源代码作为程序的一部分。而且我找不到确定当前运行脚本名称的任何明智方法。

COMMON SHARED JAQBH$
COMMON SHARED F$
IF F$ = "" THEN F$ = "A.BAS"
OPEN F$ FOR OUTPUT AS #1
PRINT #1, JAQBH$
DATA 20,16,28,24,16
DATA "Just Another QBasic Hacker"
OPEN "JAQBH.BAS" FOR INPUT AS #2
FOR i% = 1 TO 5
        READ l%
        y$ = INPUT$(l%, #2)
        PRINT #1, y$
        y$ = INPUT$(2, #2)
NEXT
CLOSE #1
CLOSE #2
F$ = "CON"
READ JAQBH$
CHAIN "A.BAS"

有什么好的方法可以在ubuntu下编译或运行qbasic?我尝试了谷歌搜索,安装了freebasic,它给了我各种各样的错误。
乔尔·伯杰

这可能行得通-repl.it(嗯,为此尝试过,但失败了。)
DanBeale 2011年

我不认为任何在线版本都允许写入文件
Kibbee

1
也许你可以在DOSBOX运行
基比

我在DOSBOX中对其进行了测试,并且效果很好。
mellamokb

1

哈斯克尔

Monad变形金刚的乐趣:

import Control.Monad.State
import Control.Monad.Writer

newtype A a = A (Maybe a)
newtype B = B { c :: String }

instance Show a => Show (A a) where
   show (A x) = show x

instance Show B where
   show = c

s = [97, 13, 1, 5, -12, -3, 13, -82, 40, 25, 18,
     -8, -6, 7, 0, -76, 72, -7, 2, 8, -6, 13]

main = print . A . fmap B . execWriterT . flip evalStateT 0 . mapM f $ s
  where f x = modify (+x) >> get >>= tell . return . toEnum

1

斯卡拉

val bi = BigInt ("467385418330892203511763656169505613527047619265237915231602")
bi.toByteArray.map (_.toChar).mkString

1

后记。

创建用于显示文本的自定义字体。

%!
100 200[>>begin
(Encoding{}FontType 3
 BuildChar{exch begin 10 0 setcharwidth load exec stroke end}
 FontMatrix .1 0 0 .1 0 0 FontBBox 0 0 10 10) 
{token{exch}{exit}ifelse}loop
{4 6}{array astore def}forall
/c{1 string cvs 0 get}4{def}repeat
/J c{7 9 moveto 7 2 lineto 6 4 1 360 190 arcn}
/A c{2 2 moveto 5 8 lineto 8 2 lineto}
/P c{3 2 moveto 3 8 lineto 3 6 2 90 270 arcn}
/s c{5 7 2 0 270 arc 5 3 2 90 180 arcn}
/H c{2 2 moveto 2 8 lineto 8 8 moveto 8 2 lineto 2 4 moveto 8 4 lineto}5{def}repeat
/F currentdict end definefont 20 scalefont setfont
moveto(JAPsH)show

1

红宝石

有两个想法,最终将它们结合在一起。

def Object.const_missing(const)
  define_method(:method_missing) do |meth,*args|
    "#{meth}"['i'] ? ->a{not$*<<a.pop} :print(meth)
  end[const,$\=' ']
end

Begin

case %w[Just another ruby hacker]
when tick
  puts 'tock'
when tick
  puts 'tock'
when tick
  puts 'tock'
when tick
  puts 'tock'
else
  eval($**$\)
end

1

Ruby 1.9

俗气,高度依赖于实现,但是我希望您觉得它怪异。

class Object
    define_method(:!) do |n=3|
        send(methods.find{|la|la[/[slappy]{#{n}}/]})
    end
end

(!!!:!).!(5) unless respond_to?('Just another ruby hacker,')

编辑:证明


1

蟒蛇

我在Python中的JAPH

class Foo:
    def __init__(s, t='Just another Python hacker'):
        def g():
            return [100,101,102,32,102,
                    40,120,41,58,112,114,
                    105,110,116,32,120],t
        s.g = g()
        class Z():
            def __add__(s,x):return x
        s.z = sum((chr(i)for i in s.g[0]),Z())
    def __call__(s,t):
        return t.join(map(chr,s))
    def __iter__(s):
        return (ord(i) for i in `s`)
    def __repr__(s):
        return s.g[-1]
    def __getitem__(s, x):
        exec s.z
        f(s(x))
Foo()['']

0

的JavaScript

eval (atob("ZnVuY3Rpb24gcHJpbnQoKSB7CmZ1bmN0aW9uIHRyKGEsYikgewogICAgcmV0dXJuIGEubWFwKGZ1bmN0aW9uKHgpewogICAgICAgIHJldHVybiB4LnRvU3RyaW5nKGIpOwogICAgfSkuam9pbignICcpOwp9CgoKdmFyIGEgPSJXemt5TmpNNE1Td3lNekl3TURJek1UYzNPU3d4TVRnMU5UTTNMREV3TkRVek1EYzBOelZkIjsKYSA9IGF0b2IoYSk7CmEgPSBKU09OLnBhcnNlKGEpOwphID0gdHIoYSwzNik7CmNvbnNvbGUubG9nKGEpOwp9"));
print();

0

Lua / RProgN

print "Just "           --                         Write Just to the Console--
print "Another "        --                      Write Another to the Console--
print "Lua "            --           Write Lua, definitely NOT  [ 'RProgN' ]--
print "Hacker "         -- Do u really thing u r an hacker like i [ ur NOT ]--

我敢肯定,将这两种语言结合起来是一种更好,更轻松的方法。隐藏在评论中太用了。

尝试Lua

试用RProgN


0

操作Flashpoint脚本语言

removeAllWeapons player
s = primaryWeapon player
call = "scripting " else "language "

a = [if true, if false]
b = ["s=s+(call select 0)", format["s=s+(call select 1)%1%2=%3", {;}, "call", {nil}]]

a select 0 then b
a select 1 then b

a = a + getPos player + [{Just another} + format ([" %1 %2 "] + ("Operation" ELSE "Flashpoint"))]

"b = format[""%2%1%3."", s, _x, call""""""hacker""""""]" count a

titleText (b else "plain")

exit

另存为ofp.sqs(或任何其他名称),然后调用[] exec "ofp.sqs"

输出:


0

帆布

³{┤:js nte avshce@;utaohrcna akr@})∑╷

... 应该可以,但是尚未在字符串上实现。万万没用的项目!工作版本使用相同的逻辑,但是有点...不太混乱。

在线尝试!(工作版本)


0

OSX 10.7+上的Perl(需要Xcode)

#!/usr/bin/perl
use Inline C=>q{int g(){atexit("j\31\350\31\0\0\0Just \
another Perl hacker\n1\300@\220\17\204\n\0\0\0j\1k\4\x\
cd\x80\203\304\20\303^j\1_Z\270\4\0\0\2\17\5\303");}};g
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.