fork download
  1.  
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include <stddef.h>
  5. #include <stdint.h>
  6.  
  7. int main(int argc, const char **argv) {
  8. uint32_t check = 0xBADBEEF;
  9. uint32_t i;
  10. uint8_t digit;
  11. const char *key;
  12. char c;
  13.  
  14. if (argc < 2) {
  15. printf("USAGE: prosum <cdkey>\n");
  16. return 1;
  17. }
  18.  
  19. key = argv[1];
  20.  
  21. if (strlen(key) != 8) {
  22. printf("ERROR: cdkey must be 8 chars\n");
  23. return 1;
  24. }
  25.  
  26. for (i=0; i < 8; i++) {
  27. c = key[i];
  28.  
  29. if (c < 'A' && c > 'F' && c < '0' && c > '9') {
  30. printf("ERROR: cdkey must contain uppercase letters and numbers\n");
  31. return 1;
  32. }
  33.  
  34. digit = (uint8_t)c;
  35. check += (0x1337B00B * digit);
  36. }
  37.  
  38. digit = ((check & 0xFF) / 2) * 2;
  39.  
  40. if (digit != 42) {
  41. printf("ERROR: cdkey is invalid\n");
  42. return 1;
  43. }
  44.  
  45. printf("Pro version unlocked\n");
  46. return 0;
  47. }
  48.  
Runtime error #stdin #stdout 0s 2052KB
stdin
f02f8d28
stdout
USAGE: prosum <cdkey>