当前位置:网站首页>Chinese valentine's day cup (re)
Chinese valentine's day cup (re)
2022-08-08 01:04:00 【Snow Moon Thirty】
逆向签到

easy_magic
Just look at the main function directly
scanf()function but note that only one character is entered here(%c)就可以了
这里需要注意v5The value of is equal to the character we entered(v4)去异或0x77
而v10The first character of the array is equal to what we enteredv4
主算法
The main algorithm is very simple in two sentences :
v5依次加上v7The value of , and then the result of each addition is givenv10数组
最后把v10数组md5Encrypted and then assigned tos1
最后比较s1和s2的md5值是否相同 If the same, the characters entered are correct
解题思路:
Although the questioner gave itmd5value but obviously to solve directlymd5Not the author's intention
But we need to askv10的值
Because the algorithm logic is very clear that it is simply lettingv5去累加v7And the result of each accumulation is assigned tov10
所以我们只需要知道v5The initial value of
因为比赛的flag格式为ctfshow{}所以可以猜测v5The initial value of must be c的asc码(99)
Just dig out the algorithm and decrypt it
#include <stdio.h>
#include<string.h>
int main()
{
int v4;
char v5;
char v7[32];
char v10[104];
v7[0] = 17;
v7[1] = 0xF2;
v7[2] = 13;
v7[3] = 0xF5;
v7[4] = 7;
v7[5] = 8;
v7[6] = 4;
v7[7] = 0xBC;
v7[8] = 65;
v7[9] = 0xE7;
v7[10] = 7;
v7[11] = 6;
v7[12] = 0xF5;
v7[13] = 6;
v7[14] = 0xF8;
v7[15] = 10;
v7[16] = 10;
v7[17] = 0xEC;
v7[18] = 9;
v7[19] = 0xFD;
v7[20] = 0xD;
v7[21] = 0xF3;
v7[22] = 24;
v5 = 0;
v4 = int('c') ^ 0x77;
v5 = v4 ^ 0x77;
v10[0] = 'c';
for (int i = 0; i <= 22; ++i)
{
v5 += v7[i];
v10[i + 1] = v5;
}
v10[24] = 0;
for(int i = 0;i<=strlen(v10);i++)
{
printf("%c", v10[i]);
}
}
//ctfshow{7x_flag_is_here}
This question is the idea given by the student Posted by the apprenticepython的脚本
v7 = [17,-14,13,-11,7,8,4,-68,65,-25,7,6,-11,6,-8,10,10,-20,9,-3,13,-13,24]
v4 = "c"
for i in range(len(v7)):
v5 = v4
v10 = ""
for i in range(len(v4)):
v10 += chr(ord(v5[i])+v7[i])
v4 = "c" + v10
print(v4)
边栏推荐
- JS中常用的数组方法(补充)
- Pour water problem (summer vacation daily question 17)
- 解决:ERROR: Cannot uninstall ‘certifi‘. It is a distutils installed project and thus we cannot accurat
- idea一些debug技巧
- 证券开户是安全的吗,靠谱吗?
- PAT甲级 1055 The World‘s Richest
- PAT甲级 1057 Stack
- Seaborn调用load_dataset时,出现错误。 urllib.error.URLError: urlopen error [WinError 10054] 远程主机强迫关闭了
- 嵌入式分享合集31-串口
- Octopus Application Chain|Content Curation Collaboration Organization DISCOVOL DAO Mainnet Launched in August
猜你喜欢
随机推荐
头脑风暴:除数博弈
家乡的黄桃
章鱼应用链|内容策展协作组织 DISCOVOL DAO 主网8月上线
如何将 Tex 转化为 Word 文件
分布式一致性协议 之 Lease机制
pycharm connect to remote server
win10 rdkit下载及使用
Octopus Network Progress Report | 2022.7.1-7.31
【神器】MarkDown-沉浸写作的利器
STM32F103C8T6 analog SPI control 6-pin/7-pin 0.96-inch OLED display
任意精度的浮点数计算
QML ListView详解
第三章 矩阵压缩
PAT甲级 1057 Stack
Benchmark testing using the jmh framework
MySQL index
系统滴答及Systick定时器
Detailed explanation of SQL DNSlog injection
高数_证明_柯西中值定理
陈强教授《机器学习及R应用》课程 第七章作业







