Reverse Attack and Defense World (Novice Zone) (3)

3.《open-source》

According to the instructions of the topic, the source code is analyzed directly after compilation. The following comment is the problem-solving process

#include <stdio.h>
#include <string.h>

int main(int argc, char *argv[]) {
    if (argc != 4) {                          //判断输入参数,这里除程序名还需要写3个
    	printf("what?\n");
    	exit(1);
    }

    unsigned int first = atoi(argv[1]);        //第一处输入十进制51966
    if (first != 0xcafe) {
    	printf("you are wrong, sorry.\n");
    	exit(2);
    }

    unsigned int second = atoi(argv[2]);
    if (second % 5 == 3 || second % 17 != 8) {    //第二处逻辑判断,前后两个条件都不能符合
    	printf("ha, you won't get it!\n");
    	exit(3);
    }

    if (strcmp("h4cky0u", argv[3])) {            //第三处比较判断,直接输入h4cky0u
    	printf("so close, dude!\n");
    	exit(4);
    }

    printf("Brr wrrr grr\n");

    unsigned int hash = first * 31337 + (second % 17) * 11 + strlen(argv[3]) - 1615810207;

    printf("Get your key: ");
    printf("%x\n", hash);
    return 0;
}

The second script

for a range (0,100):
    if (a % 5 != 3 and a % 17 == 8):
        print (a)

Draw a to be 25, then get the flag   

4.《insanity》

I am drunk. . . Do you have a lot of question marks

5.《simple-unpack》

1. Shelling

2. IDA binary open

Published 25 original articles · Liked 14 · Visits 5445

Guess you like

Origin blog.csdn.net/qq_40568770/article/details/105128093