Commit Graph

31 Commits

Author SHA1 Message Date
emoose
bbb5c938ec [CPU] Fix XexModule::FindSaveRest not finding functions properly 2018-11-01 15:50:56 +00:00
Dr. Chat
7443b7e61f [CPU] Rename ImportLibrary fields to follow naming conventions 2018-10-28 09:41:31 -05: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
Dr. Chat
a148b965f1 KernelState should handle module launching 2016-10-24 11:01:10 -05:00
Ben Vanik
5e08889d93 More style cleanup. 2015-08-06 20:17:01 -07:00
Ben Vanik
eaa1a8ee3a Refactoring SymbolInfo/FunctionInfo/Function into Symbol/Function. 2015-08-05 21:50:02 -07:00
Ben Vanik
12a29371e3 Clang fixes. 2015-07-19 18:32:48 -07:00
Dr. Chat
f9977a25af Use std::vector to hold the xex header instead of new/delete 2015-07-06 19:45:10 -05:00
Dr. Chat
0388d17a72 Formatting 2015-07-06 10:57:32 -05:00
Dr. Chat
93f24d2047 XexModule keep track of whether it's loaded into memory or not 2015-07-06 10:40:35 -05:00
Dr. Chat
7f53b1d630 Allow unloading of user modules 2015-07-05 14:03:00 -05:00
Dr. Chat
0211135fd6 Fix potential corruption for GetOptHeader 2015-07-03 10:41:43 -05:00
Dr. Chat
362a521c79 Rewrite XexModule to drop dependency on old xex2 headers for imports 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
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
08770a4ec0 Mass renaming. I love clang-format. 2015-05-31 16:58:12 -07:00
Dr. Chat
589e672d20 XexModule: Resolve user library imports 2015-05-18 01:31:59 -05:00
Ben Vanik
ade5388728 bool-ifying xe::cpu 2015-05-05 18:52:54 -07:00
Ben Vanik
78921c1a7e Merging Runtime into Processor. 2015-05-03 22:28:25 -07: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
9281d62106 Moving cpu/runtime/ to cpu/. 2015-03-24 08:25:58 -07:00
Ben Vanik
29912f44c0 Moving alloy/ into xenia/cpu/ to start simplifying things. 2015-03-24 07:46:18 -07:00
Ben Vanik
00e4a4fe1b Fix #include format. 2015-01-31 22:49:47 -08:00
Ben Vanik
a0eebf8898 Removing old run loop/ref/core/etc. 2014-12-31 19:26:51 -08:00
Ben Vanik
9437d0b564 Sprucing up some of alloy. 2014-07-13 21:15:37 -07: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
Ben Vanik
dcd9f8b6ff Module info in json. 2013-12-24 17:25:29 -08:00
Ben Vanik
fdb6a5cfa3 Initial Alloy implementation.
This is a regression in functionality and performance, but a much better
foundation for the future of the project (I think). It can run basic
apps under an SSA interpreter but doesn't support some of the features
required to do real 360 apps yet.
2013-12-06 22:57:16 -08:00