Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.72 KB | None | 0 0
  1. int __cdecl main(int argc, const char **argv, const char **envp)
  2. {
  3.   signed __int64 v3; // rdi@1
  4.   __int64 v4; // rdx@2
  5.   unsigned __int64 i; // [sp+18h] [bp-18h]@1
  6.   __int64 v7; // [sp+20h] [bp-10h]@2
  7.  
  8.   v3 = 4197200LL;
  9.   puts("\n\nWelcome to BabyRev can you crack the code???\n");
  10.   for ( i = 0LL; i <= 0x63; ++i )
  11.   {
  12.     v7 = rand();
  13.     v4 = get_number();
  14.     if ( (unsigned __int8)check(v7, v4) ^ 1 )
  15.       lose(v7);
  16.     v3 = 4197248LL;
  17.     puts("YAAAY Keep GOING !!");
  18.   }
  19.   win(v3);
  20.   return 0;
  21. }
  22.  
  23. __int64 get_number()
  24. {
  25.   __int64 result; // rax@1
  26.   __int64 v1; // rcx@1
  27.   char s; // [sp+0h] [bp-90h]@1
  28.   __int64 v3; // [sp+88h] [bp-8h]@1
  29.  
  30.   v3 = *MK_FP(__FS__, 40LL);
  31.   fgets(&s, 128, _bss_start);
  32.   result = strtol(&s, 0LL, 10);
  33.   v1 = *MK_FP(__FS__, 40LL) ^ v3;
  34.   return result;
  35. }
  36.  
  37. __int64 win()
  38. {
  39.   FILE *stream; // [sp+8h] [bp-98h]@1
  40.   char s; // [sp+10h] [bp-90h]@2
  41.   __int64 v3; // [sp+98h] [bp-8h]@1
  42.  
  43.   v3 = *MK_FP(__FS__, 40LL);
  44.   stream = fopen("flag.txt", "r");
  45.   if ( stream )
  46.   {
  47.     fgets(&s, 128, stream);
  48.     printf("Here's your flag, friend: %s\n", &s);
  49.   }
  50.   else
  51.   {
  52.     puts("ERROR: no flag found. If you're getting this error on the remote system, please message the admins. If you're seeing this locally, run it on the remote system! You solved the challenge, and need to get the flag from there!");
  53.   }
  54.   return *MK_FP(__FS__, 40LL) ^ v3;
  55. }
  56.  
  57. void __noreturn lose()
  58. {
  59.   puts("Not Quite ): KEEEEEP TRYYYIINNG !!!");
  60.   exit(100);
  61. }
  62.  
  63. bool __fastcall check(signed __int64 a1, __int64 a2)
  64. {
  65.   return 3
  66.        * (a2 ^ (a1
  67.               - 100
  68.               * (((signed __int64)(((unsigned __int128)(0x0A3D70A3D70A3D70BLL * a1) >> 64) + a1) >> 6) - (a1 >> 63)))) == 4920;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement