猫咪和键盘
题目地址 : https://ce.pwnthebox.com/challenges?type=1&page=1&diff=medium&id=452 纵向随机切割
with open("typed_printf.cpp","r") as f:
lines=f.readlines()
for line in lines:
seg1=line[0:1]
seg2=line[1:7]
seg3=line[8:20]
seg4=line[20:22]
seg5=line[22:32]
seg6=line[32:39]
seg7=line[39:-1]
print((seg1+seg6+seg2+seg4+seg3+seg5+seg7).strip())
#include
#include
#include
using namespace std;
template
static auto println() {
if constexpr (format[0]=='%') {
if constexpr (format[1]=='d') {
return [](int x){cout<
constexpr auto get_arg(R (*f)(T)){
return T{};
}
template
constexpr bool cont_takes_no_arg(T cont){
using cont_t = decay_t;
using arg_type = decay_t;
return is_same::value;
}
template
auto print_var(T x){
cout<
auto print_var(T x){
cout<
auto print_const(X x){
cout<
auto print_const(){
cout<
constexpr auto cont_ret_type(R (*cont)(X)){
return R{};
}
template
constexpr auto cont_ret_type(R (*cont)()){
return R{};
}
template
constexpr auto cont_arg_type(R (*cont)(X)){
return X{};
}
template
constexpr auto cont_arg_type(R (*cont)()){
return unit_t{};
}
unit_t print_nothing(){return unit_t{};}
#define cont_ret_t decay_t
#define cont_arg_t decay_t
template
constexpr auto _typed_printf(){
if constexpr (format[i]=='%' && format[i+1] == 'd') {
constexpr auto cont = _typed_printf();
return print_var;
} else if constexpr (format[i]=='%' && format[i+1] == 's') {
constexpr auto cont = _typed_printf();
return print_var;
} else if constexpr (format[i]!='\0') {
constexpr auto cont = _typed_printf();
return print_const;
} else {
return print_nothing;
}
}
#define def_typed_printf(f,str) constexpr static const char str_fmt##f[] = str; auto f = _typed_printf();
#define ABC "FfQ47if9Zxw9jXE68VtGA"
#define BAC "JDk6Y6Xc88UrUtpK3iF8p"
#define CAB "7BMs4y2gzdG8Ao2gv6aiJ"
int main(){
def_typed_printf(f_l_x_g_1, "%s%s%s%s");
f_l_x_g_1("fl")("a")("g")("{");
def_typed_printf(a_a_a_a_a_a_a_a_a, "%s%s%s%s%s%s%d");
a_a_a_a_a_a_a_a_a(ABC)("")(BAC)("")(CAB)("")('}');
def_typed_printf(def_typed_printf_, "%s%d%s");
def_typed_printf_("typed_printf")('_')("}");
return 0;
}
c++17运行得flag
Quotes
题目地址 : https://ce.pwnthebox.com/challenges?type=1&page=6&id=973
My+mission+in+life+is+not+mer ely+to+survive+but to+thrive+and+to+do+so+w ith+s ome+pass i on+some+compass ion+so me+humor+and+some+style 英文句子有加号有空格,按空格分组,计算字母数量然后对照26英文字母表输出文字
import string
l1="My+mission+in+life+is+not+mer ely+to+survive+but to+thrive+and+to+do+so+w ith+s ome+pass i on+some+compass ion+so me+humor+and+some+style".split(' ')
l2 = [len(i) - i.count('+') for i in l1]
l3 = [len(i) for i in l1]
print(l2)
cs = [string.ascii_lowercase[i-1] if i > 0 else ' ' for i in l2]
print(cs)
print(''.join(cs))
你猜猜
题目地址 : https://adworld.xctf.org.cn/task/answer?type=crypto&number=5&grade=1&id=4930&page=1 另出为zip文件,打开发现需要输入密码
0和1的故事
题目地址 : https://ce.pwnthebox.com/challenges?type=1&page=1&diff=easy&id=79
flag为16进制字符串
s1='09 20 20 09 20 09 20 09 09 20 09 20 09 20 09 09 20 20 09 20 20 09 09 09 20 20 20 09 09 09 20 09 20 09 20 09 09 09 09 20 20 20 20 09 09 09 20 09 09 09 09 09 09 20 20 20 20 20 20'
res1 = ''
ls2 = s1.split(' ')
print(len(s1))
print(len(ls2))
for i in ls2:
if '09'==i:
res1 += '1'
elif '20'==i:
res1 += '0'
print(res1)
print(hex(int(res1,2)))
|