Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void __cdecl get_secret(int *authtoken)
- {
- __int64 v1; // rcx
- char filename_0[200]; // [rsp+10h] [rbp-310h]
- char *saveptr; // [rsp+D8h] [rbp-248h]
- char filename[200]; // [rsp+E0h] [rbp-240h]
- char flag[60]; // [rsp+1B0h] [rbp-170h]
- char authcode[60]; // [rsp+1F0h] [rbp-130h]
- char flag_id[20]; // [rsp+230h] [rbp-F0h]
- char access_code[129]; // [rsp+250h] [rbp-D0h]
- char *content; // [rsp+2D8h] [rbp-48h]
- char *token; // [rsp+2E0h] [rbp-40h]
- char *delim; // [rsp+2E8h] [rbp-38h]
- char *content_0; // [rsp+2F0h] [rbp-30h]
- char *real_authcode; // [rsp+2F8h] [rbp-28h]
- uint32_t chksum; // [rsp+304h] [rbp-1Ch]
- FILE *fp; // [rsp+308h] [rbp-18h]
- int rval; // [rsp+310h] [rbp-10h]
- uint8_t wordcount; // [rsp+317h] [rbp-9h]
- char *str; // [rsp+318h] [rbp-8h]
- access_code[128] = 0;
- memset(access_code, 0, 0x80uLL);
- rval = -1;
- fp = (FILE *)_bss_start;
- chksum = -1;
- init_authtoken(authtoken);
- printf("Dear subscriber,\n", 0LL);
- printf("\n");
- printf("thank you for choosing our service. Your usage fee will be subtracted shortly\n");
- printf("form your account.\n");
- printf("\n");
- printf("We promise to keep your data save and never reveal it to any undisclosed third\n");
- printf("parties.\n");
- printf("\n");
- printf("=== Advertisement ===\n");
- printf("You have lots of data and don't know what to do with it? Give it to us and\n");
- printf("our advanced machine learning algorithms will reveal to you great insight well\n");
- printf("worth your money. Send us as much data as you can (only small chunks allowed)\n");
- printf("and gaze at the wonders revealed.\n");
- printf("=== Advertisement ===\n");
- printf("\n");
- printf("Your service team of wcaaS.\n");
- printf("\n");
- fprintf(fp, "Enter text:\n");
- fflush(fp);
- rval = fread(access_code, 1uLL, 0x80uLL, stdin);
- fprintf(fp, access_code);
- fprintf(fp, "\n");
- fflush(fp);
- chksum = crossum(access_code, rval);
- if ( chksum == *authtoken )
- {
- if ( (unsigned int)__isoc99_sscanf(access_code, "%10s ", flag_id, v1) != 1 )
- return;
- sprintf(filename, "%10s", flag_id);
- content = read_file(filename);
- fprintf(fp, "FLG: %s\n", content);
- goto LABEL_18;
- }
- if ( access_code[0] == 33 && access_code[1] == 115 )
- {
- if ( (unsigned int)__isoc99_sscanf(&access_code[2], "%10s %50s %50s ", flag_id, authcode) != 3 )
- return;
- sprintf(filename, "%10s_authcode", flag_id);
- new_file(filename, authcode);
- sprintf(filename, "%10s", flag_id);
- new_file(filename, flag);
- goto LABEL_14;
- }
- if ( access_code[0] != 33 || access_code[1] != 103 )
- {
- LABEL_14:
- delim = " ";
- wordcount = 0;
- for ( str = access_code; ; str = 0LL )
- {
- token = strtok_r(str, delim, &saveptr);
- if ( !token )
- break;
- ++wordcount;
- }
- fprintf(fp, "+++ Your text contains %d words.+++\n", wordcount);
- LABEL_18:
- fflush(fp);
- return;
- }
- if ( (unsigned int)__isoc99_sscanf(&access_code[2], "%10s %50s ", flag_id, authcode) == 2 )
- {
- sprintf(filename_0, "%10s_authcode", flag_id);
- real_authcode = read_file(filename_0);
- if ( !strcmp(authcode, real_authcode) )
- {
- sprintf(filename_0, "%10s", flag_id);
- content_0 = read_file(filename_0);
- fprintf(fp, "FLG: %s\n", content_0);
- goto LABEL_14;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement