homer512 icon

Owning string_view

homer512 | PRO | 11/25/24 10:19:13 AM UTC | 0 ⭐ | 11118 👁️ | Never ⏰ | []
C++ |

1.08 KB

|

None

|

0 👍

/

0 👎

#include <cstdlib>
// using std::free
#include <string_view>
#include <utility>
// using std::exchange
 
 
 
class CSView
{
  std::string_view view;
public:
  explicit CSView(char* ptr) noexcept
    : view(ptr)
  {}
  CSView(CSView&& o) noexcept
    : view(std::exchange(o.view, std::string_view{}))
  {}
  ~CSView()
  { std::free(const_cast<char*>(view.data())); }
 
  void swap(CSView& o) noexcept
  { view.swap(o.view); }
 
  friend void swap(CSView& left, CSView& right) noexcept
  { left.swap(right); }
 
  CSView& operator=(CSView&& o) noexcept
  {
    CSView tmp = std::move(o);
    swap(tmp);
    return *this;
  }
  const std::string_view& operator*() const noexcept
  { return view; }
  
  const std::string_view* operator->() const noexcept
  { return &view; }
};
 
 
#include <cstring>
// using std::strcpy
#include <iostream>
// using std::cout
 
int main()
{
  char* ptr = static_cast<char*>(std::malloc(80));
  std::strcpy(ptr, "Hello World\n"); 
  CSView cs { ptr };
  
  std::cout << "World at " << cs->find("World")
        << " in " << *cs;
}
 

Comments

  • Borfidorn icon
    03/29/26 09:44:31 PM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
     
    This made me $13,000 in 2 days.
     
    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 25% — they will simply correct the exchange rate.
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    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 verification from SimpleSwap — instant swap).