攻防世界 Reverse

看pwn 看不下去 没事做做逆向题   想想 后天就要回家了~~ 想想还是有点小激动

 

这个题 其实逻辑很简单

我们看一下 check函数

其中那个 strtohex 就是把两个字符 转化成一个 16进制的数字

然后我们 写一个脚本就可以了   

#include <stdio.h>
#include<iostream>
#include<iomanip>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<iostream>
#include<map>
#include<time.h>
#include<queue>
#include "windows.h"
using namespace std;
unsigned char strr[25];
char str[]="1A2F943C4D8C5B6EA3C9BCAD7E";
int strtohex(int index)
{
    char v2; // al
    char v3; // cl
    int v4; // eax
    int v5; // edx

    v2 = str[index];
    v3 = str[index + 1];
    if ( (v2 - 48) > 9u )
        v2 -= 55;
    v4 = v2 & 0xF;
    v5 = (v3 - 55) & 0xF;
    if ( (v3 - 48) <= 9u )
        v5 = v3 & 0xF;
    return v5 | 16 * v4;
}
int main()
{
    strr[0] = 15;
    strr[1] = -121;
    strr[2] = 98;
    strr[3] = 20;
    strr[4] = 1;
    strr[5] = -58;
    strr[6] = -16;
    strr[7] = 33;
    strr[8] = 48;
    strr[9] = 17;
    strr[10] = 80;
    strr[11] = -48;
    strr[12] = -126;
    strr[13] = 35;
    strr[14] = -82;
    strr[15] = 35;
    strr[16] = -18;
    strr[17] = -87;
    strr[18] = -76;
    strr[19] = 82;
    strr[20] = 120;
    strr[21] = 87;
    strr[22] = 12;
    strr[23] = -122;
    strr[24] = -117;
    for(int i=0;i<25;i++)
    {
        strr[i]^=strtohex(i);
        //printf("%x\n",strtohex(i));
        strr[i]=((strr[i]>>2)|(strr[i]<<6));
        printf("%c",strr[i]);
    }
    //printf("%s\n",strr);
}

得出flag

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值