Commit Graph

23 Commits

Author SHA1 Message Date
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
DrChat
e699be0118 Logging: Add a flag to specify the minimum log level
--log_level = (0=error, 1=warning, 2=info, 3=debug)
2017-03-24 16:28:41 -05:00
Dr. Chat
b66f10f2b8 Testing travis xenia powerpc testing 2017-02-06 00:40:06 -06:00
Dr. Chat
a148b965f1 KernelState should handle module launching 2016-10-24 11:01:10 -05:00
x1nixmzeng
6cc3440086 Find correct launch module for XNA-based games
Added utility to parse game information and updated launch logic to use
it
2016-07-23 18:27:13 +01:00
Ben Vanik
6777ce6668 Reconcile debugger and save state stuff into a single implementation.
Fixes #497 and fixes #496.
Still rough edges, but at least less duplication.
2016-01-18 11:48:21 -08:00
Ben Vanik
86b706d87c Merge pull request #509 from x1nixmzeng/xex-resources
Rebrand the Xenia window with module metadata
2016-01-10 08:55:47 -08:00
x1nixmzeng
06f259c87d Mask the name index instead
The maximum number of import libraries (32) is already asserted
2016-01-09 02:43:29 +00:00
x1nixmzeng
7e4fdf7669 Fixed rare crash when accessing library import by name
The library name index may only be 8-bits.

This bug was not present in the previous implementation due to a bitmask
(0xFF) - see
ea99ba8e3b/src/xenia/kernel/util/xex2.cc (L272)
2016-01-09 01:19:05 +00:00
x1nixmzeng
321e2d8873 Set the window title from the module resource pool 2016-01-07 00:58:05 +00:00
Ben Vanik
f26bea88d9 Replacing zlib with snappy in traces, adding trace header, docs. 2015-12-30 22:58:22 -08:00
Dr. Chat
4e7dfa477b Assign XModule path on load rather than in the constructor 2015-12-29 13:10:03 -08:00
Dr. Chat
bb5fd73b9e Register user-modules with the kernel in UserModule::Restore 2015-12-29 13:09:57 -08:00
Dr. Chat
3e6c70defa Fixup UserModule::LoadFromFile to use new vfs API 2015-12-29 13:09:56 -08:00
Dr. Chat
4a3773d2fb XModule Save/Restore 2015-12-29 13:09:32 -08:00
Dr. Chat
e4e1bc1060 Remove dead code from UserModule (how did this even get here?) 2015-12-29 13:09:22 -08:00
Dr. Chat
aa7919bd89 emulator.cc savestates
Change UserModule::Launch to be non-blocking (returns the main thread)
2015-12-29 13:09:17 -08:00
Ben Vanik
440c807936 Fix error state shutdown crash. 2015-11-06 16:27:07 -08:00
Dr. Chat
c33e95981b Formatting. 2015-09-25 18:46:50 -05:00
Dr. Chat
9ceab26560 Print the LAN key header
Check if the module is a XEX module before calling Unload on XexModule
2015-09-25 18:34:54 -05:00
Ben Vanik
e5fbf840d2 Shuffling kernel/. 2015-09-06 18:07:52 -07:00