#include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { if (
argc!= 4) { printf("what?\n"); exit(1); } unsigned int first = atoi(argv[1]); if
(first != 0xcafe) { printf("you are wrong, sorry.\n"); exit(2);
// Not equal to 0xcafe Quit , that first=0xcafe } unsigned int second = atoi(argv[2]); if (second %
5 == 3 || second % 17 != 8) { printf("ha, you won't get it!\n"); exit(3);
// Exit when you meet the conditions , Then the conditions are not satisfied ,second=25 Can } if (strcmp("h4cky0u", argv[3])) { printf("so
close, dude!\n"); exit(4);// Exit if not equal , Then make it equal, then argv[3]="h4cky0u" } 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; } #
include <stdio.h> #include <string.h> int main(int argc, char *argv[]) { int
hash= 0xcafe * 31337 + (25 % 17) * 11 + strlen("h4cky0u") - 1615810207; printf(
"Get your key: "); printf("%x\n", hash);// with 16 Binary output return 0; }
0xcafe Change the same 10 Any number will do ,16 Base and 10 Multiplication by Radix , The output is treated as 10 Binary
int('0xcafe',16)//python16 Base conversion to 10 System
strcmp(a,b)//ab Equal return 0;
ps:
printf("%x\n", j); // The output is : 2f
printf("%X\n", j); // The output is : 2F
printf("%#x\n", j); // The output is : 0x2f
printf("%#X\n", j); // The output is : 0X2F %#X Recommended

Used in printf Function ,"%X,%O" Medium %O The controller is wrong , Because some compilers only recognize %o Do not recognize %O, That is to say, in the printf Chinese is case sensitive .%X The hexadecimal number corresponding to the output uppercase letter ,%x Corresponding output lower case hexadecimal number ; Middle comma copy output ,%o Corresponding output octal number .

Technology
©2019-2020 Toolsou All rights reserved,
Non preemptive static priority scheduling algorithm for operating system (C language )Go Language learning notes (GUI programming )XCTF Attack and defense world web Advanced practice _ 2_lottery What's the difference between computer major and training background ?python realization vlookup_ Dry goods I : Why python It's inside vlookup Bubble sort primary springboot2 Separation of front and rear platforms ,token Put in header Pit for verification Python Case conversion of letters ( Two methods )javascript event ( Detailed explanation of zero basis )Unity2019 UIElement note ( ten ) Simple exercise 2