Commit Graph

30 Commits

Author SHA1 Message Date
emoose
c889a8af3f [CPU] Load alt-title-ids XEX header into XexModule::opt_alternate_title_ids_ 2021-06-25 23:48:25 -05:00
gibbed
38c3db1afb [CPU/Kernel] Transparently byteswap xex2_version. 2021-05-01 17:29:05 -05:00
aerosoul
bc8b629092 [Kernel] Enable XEX1 loading 2019-11-20 18:09:28 -06:00
gibbed
207589e5a1 [CPU/Kernel] Correct parsing of XEX_HEADER_IMPORT_LIBRARIES. 2018-11-24 04:05:41 -06:00
emoose
bbb5c938ec [CPU] Fix XexModule::FindSaveRest not finding functions properly 2018-11-01 15:50:56 +00:00
emoose
265903fe66 [CPU] Add XEXP support to XexModule, if XEXP is in same folder as XEX
This was a headache to work out, big thanks to the lack of documentation on .xexp files... a ton of guesswork was involved here but luckily it turned out well.

I did have to make some pretty major changes to the way XEX files are loaded though.
Previously it'd just load everything in one go: XEX headers -> decrypt/decompress data -> load imports/symbols -> set loader data table entries, etc...

Now it's changed to something like this:
- Load base XEX headers + decrypted/decompressed image data, return X_STATUS_PENDING
- In the LoadFromFile call used to load the XEX, search for XEXP patch file (only .xexp in same folder atm)
- If patch exists: load XEXP, decrypt headers/data, apply patch to base XEX, dispose of XEXP
- Finish XEX load via LoadXexContinue() (handles imports/symbols/loader data...)

This saves us from needing to reset the imports/function/symbol stuff after patching (since all the XEX code will be a lot different), but I'm not really sure if I went about it the best way.
2018-10-20 04:36:21 +01:00
emoose
0b7f7e1657 [CPU] Move XEX2 code into XexModule class, autodetect XEX key
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?)
2018-10-20 04:18:18 +01:00
gibbed
4cc2aaf5b9 Remove unnecessary usage of xe::be. 2018-05-27 16:35:01 -05:00
Dr. Chat
f5ee6f4cf5 XEX2 lan key header 2015-09-25 18:38:10 -05:00
Ben Vanik
8b0d4fb51c Linux tweaks. 2015-08-18 14:18:00 -07:00
Ben Vanik
14beb27ebc xb style. 2015-08-07 07:56:57 -07:00
Ben Vanik
ecd4af10c9 Fixing some clang warnings/errors. 2015-07-15 23:26:58 -07:00
Dr. Chat
e58bb5ad9f ReImplement XexModule::GetProcAddress 2015-07-03 18:29:14 -05:00
Dr. Chat
800f982a4d XEX2 Security Page Descriptors 2015-07-03 10:58:33 -05:00
Dr. Chat
82ec1c345d Dump all xex2 headers in XUserModule (minus a couple) 2015-07-03 08:17:24 -05:00
Dr. Chat
be5f8d3aa4 Simplify some logic in parsing import libraries
Change struct used in export lookups
2015-07-03 08:17:23 -05:00
Dr. Chat
029babaf5d Drop dependency on old-style xex2 headers 2015-07-03 08:15:53 -05:00
Dr. Chat
fe87c08424 Shuffle some code around. 2015-07-03 08:15:53 -05:00
Dr. Chat
944b39c51d Apply some lint n' stuff 2015-06-27 22:50:08 -05:00
Dr. Chat
c228c0fa73 Add some native xex2 structs and handling functions 2015-06-27 21:32:16 -05:00
Ben Vanik
fb1f4906d9 xb format --all (we are now format clean). Buildbot will yell at you. 2015-06-22 22:26:51 -07:00
Ben Vanik
4411a4499d XEX-style exports, dumping exports, and prepping kernel export lookup. 2015-05-09 00:59:03 -07:00
Dr. Chat
49c8efdc6d XexGetProcedureAddress by name implemented. 2015-05-04 18:02:57 -05:00
Ben Vanik
30f7effa73 Code cleanup: removing common.h 2015-05-02 01:25:59 -07:00
Ben Vanik
281abea955 Converting addresses in xe::cpu to 32bit. 2015-03-24 19:41:29 -07:00
Ben Vanik
00e4a4fe1b Fix #include format. 2015-01-31 22:49:47 -08:00
Ben Vanik
447b5bf316 Fixing xex loading into 4k pages. 2014-09-13 19:32:37 -07:00
Ben Vanik
1c4dcd5e0e clang-format on most of kernel/ 2014-08-17 13:13:03 -07:00
Ben Vanik
0bc49621d4 Properly parsing resource infos and implementing XexGetModuleSection. 2014-01-19 00:53:22 -08:00
Ben Vanik
4d92720109 Moving all kernel files around just to fuck with whoever's keeping track ;) 2014-01-04 17:12:46 -08:00