Skip to content

Instantly share code, notes, and snippets.

@chitoge
Last active August 29, 2015 14:18
Show Gist options
  • Save chitoge/9331029982ae165bbbeb to your computer and use it in GitHub Desktop.
Save chitoge/9331029982ae165bbbeb to your computer and use it in GitHub Desktop.
0ctf PolyQuine
#include/*
q='''*/<stdio.h>
main(){char*_;/*=;sub _:lvalue{$_}<<q;#';<<q#'''
def printf(a,*b):__import__('sys').stdout.write(a%b)
q
#*/
_=" #include/*%cq='''*/<stdio.h>%cmain(){char*_;/*=;sub _:lvalue{%c_}<<q;#';<<q#'''%cdef printf(a,*b):__import__('sys').stdout.write(a%%b)%cq%c#*/%c_=%c%s%c;printf(_,10,10,36,10,10,10,10,34,_,34,10,10,10,10);%c#/*%cq='''*/%c}//'''#=%c";printf(_,10,10,36,10,10,10,10,34,_,34,10,10,10,10);
#/*
q='''*/
}//'''#=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment