Code is mainly just copy/pasted from kernel/util/xex2.cc, I've tried fixing it up to work better in a class, but there's probably some things I missed. Also includes some minor improvements to the XEX loader, like being able to try both XEX keys (retail/devkit) automatically, and some fixes to how the base address is determined. (Previously there was code that would get base address from optional header, code that'd get it from xex_security_info, code that'd use a stored base address value... Now everything reads it from a single stored value instead, which is set either from the xex_security_info, or if it exists from the optional header instead. Maybe this can help improve compatibility with any weird XEX's that don't have a base address optional header?) Compressed XEX loader also has some extra checks to make sure the compressed data hash matches what's expected. Might increase loading times by a fraction, but could save reports from people unknowingly using corrupt XEXs. (still no checks for non-compressed data though, maybe need to compare data with xex_security_info->ImageHash?)
A lightweight cross-platform/compiler compatibility library.
This library presupposes C++11/14 support. As more compilers get C++14 it will assume that.
Other parts of the project use this to avoid creating spaghetti linkage. Code specific to the emulator should be kept out, as not all of the projects that depend on this need it.
Where possible, C++11/14 STL should be used instead of adding any code in here, and the code should be kept as small as possible (by reusing STL/etc). Third party dependencies should be kept to a minimum.
Target compilers:
- MSVC++ 2013+
- Clang 3.4+
- GCC 4.8+.
Target platforms:
- Windows 8+ (
_win.ccsuffix) - Mac OSX 10.9+ (
_mac.ccsuffix, falling back to_posix.cc) - Linux ? (
_posix.ccsuffix)
Avoid the use of platform-specific #ifdefs and instead try to put all platform-specific code in the appropriately suffixed cc files.