#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,
SQL Server Database Glossary CSS Animation effect dedecms Website is hacked How to solve hijacking to other websites Count the number of letters (java Language implementation )Java Basics ( Three ) String In depth analysis The difference between static method and non static method And storage location Django Personal blog building tutorial --- Time classified archiving Keras Save and load model (JSON+HDF5)hive Summary of processing methods for a large number of small files Website mobile phone number capture method