Skip to content
  • Partial unobfuscation :

    • retrieve builtins functions
    x,y = [6, 11], [48, 67]  # random indices
    s = [x for x  in vars( )]  # locals (contains pointer to builtins)
    b = vars()[s[x[0]]]  # buildins
    k = list((b.__dict__ .keys())) # names of builtin functions
    g = getattr(b, k[x[1]*2])  # g is gettarr function
    m = g(b, k[y[1]+1])  # m is map function
    l = g(b, k[x[1]*3] )  # l is len function
    i = g(b, k[x[1]*6])  # i is int function
    p = g(b, k[y[0]- x[0]])  # p is print function

    I did not know the order of builtins is stable from one python to an other

    • get program arguments $0, $1 ...
    a=g(g(b,k [x[0]] )("".join(
     m( g(b,k[ x[0] //2+x[1]]) ,(m( g(
     b, k[y[ 0]
     -1 ]) ,g(b,k[x [1]+
     y[ 1] +1])([*[ g(b,
     k[ y[0]-1]) (y)] *3
     ], [0,x[0], 0])) ))
     )) ,"". join(m(g(b
     ,k [x[0 ]//2+x[1]]
     ), (m (g
     (b ,k [y
     [0 ]- 1]
     ), g( b,
     k[x[1] +y[1 ]+1]
     )([*[g (b,k [y[0
     ]- 1])( y) ]*4],[x[0]*- 3,-1
     ,x [0]* -2 ,x[0]//2]))) )))
    # -> ['fibonacci.py', '5']

    , where and

    p(i((1/5**.5)*(((1+5**.5)/2)**(i(a[1])+1)-((1-5**.5)/2)**(i(a[1])+1)))) if l(a)>1 else p(1)

    Which can be rewritten as :

    import sys
    
    if len(sys.argv)>1:
      n = int(sys.argv[1])
      print(int((1/5**.5)*(((1+5**.5)/2)**(n+1)-((1-5**.5)/2)**(n+1)))) 
    else:
      print(1)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment