Gistrec

Access to private value [reinterpret_cast]

Jan 11th, 2018
450
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.80 KB | None | 0 0
  1. /*
  2. struct Cls {
  3.     Cls(char c, double d, int i);
  4. private:
  5.     char c;
  6.     double d;
  7.     int i;
  8. };
  9.  
  10. Как видно, все поля этого класса закрытые, ваша задача реализовать несколько функций, которые дают полный доступ к этим полям (см. шаблон кода), несмотря на то, что они закрытые.
  11. */
  12.  
  13. struct FakeCls {
  14.     FakeCls(char c, double d, int i) {
  15.         this->c = c;
  16.         this->d = d;
  17.         this->i = i;
  18.     }
  19. public:
  20.     char c;
  21.     double d;
  22.     int i;
  23. };
  24.  
  25. // Эта функция должна предоставить доступ к полю c объекта cls.
  26. // Обратите внимание, что возвращается ссылка на char, т. е.
  27. // доступ предоставляется на чтение и запись.
  28. char &get_c(Cls &cls) {
  29.     FakeCls* fakeCls = reinterpret_cast<FakeCls*>(&cls);
  30.     return fakeCls->c;
  31. }
  32.  
  33. // Эта функция должна предоставить доступ к полю d объекта cls.
  34. // Обратите внимание, что возвращается ссылка на double, т. е.
  35. // доступ предоставляется на чтение и запись.
  36. double &get_d(Cls &cls) {
  37.     FakeCls* fakeCls = reinterpret_cast<FakeCls*>(&cls);
  38.     return fakeCls->d;
  39. }
  40.  
  41. // Эта функция должна предоставить доступ к полю i объекта cls.
  42. // Обратите внимание, что возвращается ссылка на int, т. е.
  43. // доступ предоставляется на чтение и запись.
  44. int &get_i(Cls &cls) {
  45.     FakeCls* fakeCls = reinterpret_cast<FakeCls*>(&cls);
  46.     return fakeCls->i;
  47. }
Advertisement
Comments
  • Izleo
    62 days
    # CSS 0.85 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 38% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without any verification from Swapzone — instant swap).
Add Comment
Please, Sign In to add comment