Offensive and defensive world

Title link:
https://adworld.xctf.org.cn/task/answer?type=reverse&number=4&grade=0&id=5076&page=1Insert picture description hereOpen the attachment to get the following code: Analysis Insert picture description here:
1. Must meet the input four Parameters;
2. The second parameter is equal to 0xcafe;
3. The third parameter is the remainder of 5 cannot be equal to 3, or the remainder of 17 is equal to 8;
4. The fourth parameter is: h4cky0u According to the above conditions, we can get Out:
first = 0xcafe
second% 17) = 8
strlen (argv [3]) = strlen ("h4cky0u") The
final output hash can be rewritten as:
unsigned int hash = 0xcafe * 31337 + 8 * 11 + strlen ("h4cky0u ")-1615810207;
we can rewrite the code as:
#include <stdio.h>
#include <string.h>
int main () {
unsigned int hash = 0xcafe * 31337 + 8 * 11 + strlen (" h4cky0u ")- 1615810207;
printf (“Get your key:“);
printf (”% x \ n”, hash); return 0;
}
Run with codeblocks to get the result:  Insert picture description hereSo the final flag is c0ffee

Published 2 original articles · liked 0 · visits 120

Guess you like

Origin blog.csdn.net/qq_46927150/article/details/105440867
Recommended