mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-24 23:22:25 +01:00
byuu says: Basically just a project rename, with s/bsnes/higan and the new icon from lowkee added in. It won't compile on Windows because I forgot to update the resource.rc file, and a path transform command isn't working on Windows. It was really just meant as a starting point, so that v091 WIPs can flow starting from .00 with the new name (it overshadows bsnes v091, so publicly speaking this "shouldn't exist" and will probably be deleted from Google Code when v092 is ready.)
33 lines
1012 B
C++
Executable File
33 lines
1012 B
C++
Executable File
#ifndef NALL_PUBLIC_CAST_HPP
|
|
#define NALL_PUBLIC_CAST_HPP
|
|
|
|
//this is a proof-of-concept-*only* C++ access-privilege elevation exploit.
|
|
//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."
|
|
//usage example:
|
|
|
|
//struct N { typedef void (Class::*)(); };
|
|
//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
|
|
|
|
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;
|
|
|
|
template<typename T, typename T::type P> struct public_cast<T, P> {
|
|
static typename T::type value;
|
|
};
|
|
|
|
template<typename T, typename T::type P> typename T::type public_cast<T, P>::value = public_cast<T>::value = P;
|
|
}
|
|
|
|
#endif
|