Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. void __cdecl get_secret(int *authtoken)
  2. {
  3. __int64 v1; // rcx
  4. char filename_0[200]; // [rsp+10h] [rbp-310h]
  5. char *saveptr; // [rsp+D8h] [rbp-248h]
  6. char filename[200]; // [rsp+E0h] [rbp-240h]
  7. char flag[60]; // [rsp+1B0h] [rbp-170h]
  8. char authcode[60]; // [rsp+1F0h] [rbp-130h]
  9. char flag_id[20]; // [rsp+230h] [rbp-F0h]
  10. char access_code[129]; // [rsp+250h] [rbp-D0h]
  11. char *content; // [rsp+2D8h] [rbp-48h]
  12. char *token; // [rsp+2E0h] [rbp-40h]
  13. char *delim; // [rsp+2E8h] [rbp-38h]
  14. char *content_0; // [rsp+2F0h] [rbp-30h]
  15. char *real_authcode; // [rsp+2F8h] [rbp-28h]
  16. uint32_t chksum; // [rsp+304h] [rbp-1Ch]
  17. FILE *fp; // [rsp+308h] [rbp-18h]
  18. int rval; // [rsp+310h] [rbp-10h]
  19. uint8_t wordcount; // [rsp+317h] [rbp-9h]
  20. char *str; // [rsp+318h] [rbp-8h]
  21.  
  22. access_code[128] = 0;
  23. memset(access_code, 0, 0x80uLL);
  24. rval = -1;
  25. fp = (FILE *)_bss_start;
  26. chksum = -1;
  27. init_authtoken(authtoken);
  28. printf("Dear subscriber,\n", 0LL);
  29. printf("\n");
  30. printf("thank you for choosing our service. Your usage fee will be subtracted shortly\n");
  31. printf("form your account.\n");
  32. printf("\n");
  33. printf("We promise to keep your data save and never reveal it to any undisclosed third\n");
  34. printf("parties.\n");
  35. printf("\n");
  36. printf("=== Advertisement ===\n");
  37. printf("You have lots of data and don't know what to do with it? Give it to us and\n");
  38. printf("our advanced machine learning algorithms will reveal to you great insight well\n");
  39. printf("worth your money. Send us as much data as you can (only small chunks allowed)\n");
  40. printf("and gaze at the wonders revealed.\n");
  41. printf("=== Advertisement ===\n");
  42. printf("\n");
  43. printf("Your service team of wcaaS.\n");
  44. printf("\n");
  45. fprintf(fp, "Enter text:\n");
  46. fflush(fp);
  47. rval = fread(access_code, 1uLL, 0x80uLL, stdin);
  48. fprintf(fp, access_code);
  49. fprintf(fp, "\n");
  50. fflush(fp);
  51. chksum = crossum(access_code, rval);
  52. if ( chksum == *authtoken )
  53. {
  54. if ( (unsigned int)__isoc99_sscanf(access_code, "%10s ", flag_id, v1) != 1 )
  55. return;
  56. sprintf(filename, "%10s", flag_id);
  57. content = read_file(filename);
  58. fprintf(fp, "FLG: %s\n", content);
  59. goto LABEL_18;
  60. }
  61. if ( access_code[0] == 33 && access_code[1] == 115 )
  62. {
  63. if ( (unsigned int)__isoc99_sscanf(&access_code[2], "%10s %50s %50s ", flag_id, authcode) != 3 )
  64. return;
  65. sprintf(filename, "%10s_authcode", flag_id);
  66. new_file(filename, authcode);
  67. sprintf(filename, "%10s", flag_id);
  68. new_file(filename, flag);
  69. goto LABEL_14;
  70. }
  71. if ( access_code[0] != 33 || access_code[1] != 103 )
  72. {
  73. LABEL_14:
  74. delim = " ";
  75. wordcount = 0;
  76. for ( str = access_code; ; str = 0LL )
  77. {
  78. token = strtok_r(str, delim, &saveptr);
  79. if ( !token )
  80. break;
  81. ++wordcount;
  82. }
  83. fprintf(fp, "+++ Your text contains %d words.+++\n", wordcount);
  84. LABEL_18:
  85. fflush(fp);
  86. return;
  87. }
  88. if ( (unsigned int)__isoc99_sscanf(&access_code[2], "%10s %50s ", flag_id, authcode) == 2 )
  89. {
  90. sprintf(filename_0, "%10s_authcode", flag_id);
  91. real_authcode = read_file(filename_0);
  92. if ( !strcmp(authcode, real_authcode) )
  93. {
  94. sprintf(filename_0, "%10s", flag_id);
  95. content_0 = read_file(filename_0);
  96. fprintf(fp, "FLG: %s\n", content_0);
  97. goto LABEL_14;
  98. }
  99. }
  100. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement