2011-01-29 09:48:44 +00:00
|
|
|
#ifndef NALL_PUBLIC_CAST_HPP
|
|
|
|
#define NALL_PUBLIC_CAST_HPP
|
|
|
|
|
|
|
|
//this is a proof-of-concept-*only* C++ access-privilege elevation exploit.
|
2011-02-02 10:33:35 +00:00
|
|
|
//this code is 100% legal C++, per C++98 section 14.7.2 paragraph 8:
|
|
|
|
//"access checking rules do not apply to names in explicit instantiations."
|
2011-01-29 09:48:44 +00:00
|
|
|
//usage example:
|
2011-02-02 10:33:35 +00:00
|
|
|
|
2011-01-29 09:48:44 +00:00
|
|
|
//struct N { typedef void (Class::*)(); };
|
2011-02-02 10:33:35 +00:00
|
|
|
//template class public_cast<N, &Class::Reference>;
|
|
|
|
//(class.*public_cast<N>::value);
|
|
|
|
|
|
|
|
//Class::Reference may be public, protected or private
|
|
|
|
//Class::Reference may be a function, object or variable
|
2011-01-29 09:48:44 +00:00
|
|
|
|
|
|
|
namespace nall {
|
|
|
|
template<typename T, typename T::type... P> struct public_cast;
|
|
|
|
|
|
|
|
template<typename T> struct public_cast<T> {
|
|
|
|
static typename T::type value;
|
|
|
|
};
|
|
|
|
|
|
|
|
template<typename T> typename T::type public_cast<T>::value;
|
|
|
|
|
Update to v075r03 release.
byuu says:
Changelog:
- added full HexEditor widget to phoenix/Qt (has dynamic scrollbar like
phoenix/GTK, but does not yet support page up/down scrolling)
- optimized debugger to look great with either phoenix/GTK or phoenix/Qt
- fixed phoenix/Qt fullscreen mode (had to allow resizing of the layout,
and resize the container)
- fixed phoenix/Qt Window::setBackgroundColor() bug that was making
statusbar invisible
- entering fullscreen now captures mouse, leaving fullscreen releases it
- so by default, no cursor in fullscreen mode now
- F12 key was assigned the task of toggling mouse capture,
Tools->Capture Mouse was removed
- above change allows toggling mouse capture in fullscreen if you like
It wasn't my idea, but toggling the mouse capture in fullscreen also hiding the mouse cursor is what I call genius design. Two birds with one stone, and very intuitive.
Also, the default GUI on Linux for bsnes and bgameboy is now Qt, instead
of GTK+. I did this because Qt's fullscreen is far more stable, and
I fixed up the remaining bugs anyway.
2011-02-02 10:35:15 +00:00
|
|
|
template<typename T, typename T::type P> struct public_cast<T, P> {
|
2011-02-02 10:33:35 +00:00
|
|
|
static typename T::type value;
|
2011-01-29 09:48:44 +00:00
|
|
|
};
|
|
|
|
|
2011-02-02 10:33:35 +00:00
|
|
|
template<typename T, typename T::type P> typename T::type public_cast<T, P>::value = public_cast<T>::value = P;
|
2011-01-29 09:48:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|