突然发现 这个比赛 有些题还是比较简单的 简单的数据验证
下载链接: https://pan.baidu.com/s/1uvsl_xusNMMnnrjOzuoffg 密码: me4j
这道题的页面是
输入数字 会出现 Not Right! 输入字母 会出现Not a Valid Integer number emmm 然后 拖入andoridstdio 发现了
如果 i转化数字出现了异常 那他们 直接输出 Not a Valid Integer number 如果对了 就直接输出flag 错了 就输出 not right 我们就去看看 check 这个函数 到底是什么 然后发现了
霍霍 只能去 so文件里面看了 打开so文件 拖入ida 查找字符串 f5 发现了
原来的汇编代码
那我们就大概知道了 v9+2*v7%3 什么意思了 也就是说 这是个选择语句 选择去 creak1 还是creak2 或者是 creak3
那我们知道了最后的结果 我们就可以推导出 答案了
逆向代码如下
#include <iostream>
#include <stdio.h>
using namespace std;
int ans=1835996258;
int main()
{
int j;
for(int i=99;i>1;i--)
{
j=i* 2 % 3;
if(j==0)
{
ans-=4950;
}
else if(j==1)
{
if((i-1)%2==0)#include <iostream>
#include <stdio.h>
using namespace std;
int ans=1835996258;
int main()
{
int j;
for(int i=99;i>1;i--)
{
j=i* 2 % 3;
if(j==0)
{
ans-=4950;
}
else if(j==1)
{
if((i-1)%2==0)
ans-=499500;
else
ans+=499500;
}
else
{
ans-=49995000;
}
}
printf("%d\n",ans);
return 0;
}
ans-=499500;
else
ans+=499500;
}
else
{
ans-=49995000;
}
}
printf("%d\n",ans);
return 0;
}