Commit Graph

101 Commits

Author SHA1 Message Date
Gliniak
d78fd19ab4 Fixed incorrect hash generation + lint fixes 2022-04-29 20:33:21 +02:00
Triang3l
f540c188bf [Lint] Revert incorrect clang-format changes 2021-08-26 21:18:18 +03:00
Triang3l
7edfdc2672 Merge branch 'master' into linux_windowing 2021-08-26 22:58:14 +03:00
Joel Linn
d87bf995e1 Satisfy linter
Apply changes suggested by clang-format-12
2021-06-27 16:33:35 -05:00
emoose
c889a8af3f [CPU] Load alt-title-ids XEX header into XexModule::opt_alternate_title_ids_ 2021-06-25 23:48:25 -05:00
emoose
e3c14419f6 [CPU/XEX] Use correct size for XEXP-patched header buffer 2021-06-06 04:50:21 -05:00
Joel Linn
a86d7173e1 Refactor FourCC magic uses
- Use new fourcc_t type
- Improves compiler compatibility by removing multi chars
2021-06-02 22:28:43 -05:00
gibbed
38c3db1afb [CPU/Kernel] Transparently byteswap xex2_version. 2021-05-01 17:29:05 -05:00
emoose
bb7c5b8266 [CPU/XEX] Move SecurityInfo conversion code to ReadSecurityInfo & call that during ApplyPatch 2021-01-31 23:18:54 -06:00
Silent
f775fe8c83 [CPU] Fix off-by-one in max ordinals check 2020-04-12 21:53:46 -05:00
gibbed
a48bb71c2f Overhaul logging. 2020-04-07 16:09:41 -05:00
gibbed
5bf0b34445 C++17ification.
C++17ification!

- Filesystem interaction now uses std::filesystem::path.
- Usage of const char*, std::string have been changed to
  std::string_view where appropriate.
- Usage of printf-style functions changed to use fmt.
2020-04-07 16:09:41 -05:00
gibbed
cc47704a6b [CPU] Use reserved form of sc for imports. 2020-02-11 06:45:57 -06:00
aerosoul
bc8b629092 [Kernel] Enable XEX1 loading 2019-11-20 18:09:28 -06:00
Sandy Carter
3c3709dbe7 [CPU] Use c++ style cast 2019-08-14 06:42:30 -05:00
Jonathan Goyvaerts
c1af632562 Replace all gflag implementations with cvar implementations 2019-08-03 02:34:07 +02:00
gibbed
5f764fc752 [CPU] Move LZX code to its own files. 2018-11-24 15:02:03 -06:00
gibbed
dd3a049b23 [CPU] Oops. 2018-11-24 15:00:00 -06:00
gibbed
207589e5a1 [CPU/Kernel] Correct parsing of XEX_HEADER_IMPORT_LIBRARIES. 2018-11-24 04:05:41 -06:00
gibbed
7226c9e047 Update mspack, add to premake, and fix missing license. Fixes #1252. 2018-11-23 15:32:55 -06:00
emoose
ab53cf2a82 [CPU] Fix some compressed XEXs decompressing past the image size 2018-11-05 19:47:18 +00:00
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
6e74ba93d6 [CPU] Add support for delta patches using *_offset fields 2018-10-22 12:26:14 +01:00
emoose
d2fd109af3 [CPU] Add more asserts for XEXP descriptor (+ log a warning) 2018-10-20 05:08:14 +01: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
ad5748f3e7 Handle cases where the optional import header isn't present :P 2017-02-25 20:28:45 -06:00
Ben Vanik
9473f20c7f Fixing travis lint diff. 2016-01-13 22:55:28 -08:00
Dr. Chat
36372d1eae Enforce xex memory protections 2016-01-13 01:47:06 -06: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
3eb602c93a Assert library name index is in range of the string table
As suggested by @DrChat
2016-01-09 17:55:57 +00:00
x1nixmzeng
6530b9dc49 Added callback when new module is launched
This avoids having to guess the display window title format
Also manually fixed the linting errors picked out by travis which do not
get picked up using xb format locally
2016-01-09 17:36:46 +00: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
Ben Vanik
948aa2400d Formatting all code. Too gnarly to rebase properly. 2015-12-29 13:13:34 -08:00
Dr. Chat
db8eb83057 Track export data on Guest Functions 2015-12-29 12:32:47 -08:00
Ben Vanik
0e58208add Dropping elemental-forms and swapping out with imgui.
Too much code for such little use. This should simplify porting.
2015-12-26 20:25:24 -08:00
Ben Vanik
15816327b4 Renaming xe::cpu::frontend to xe::cpu::ppc. 2015-12-14 21:17:55 -08:00
Dr. Chat
57a823ae39 Add (commented out) code to setup page protections for xex modules. 2015-12-01 19:53:17 -06:00
Ben Vanik
e5fbf840d2 Shuffling kernel/. 2015-09-06 18:07:52 -07:00
Ben Vanik
b80a028589 Much better errors on undefined externs. 2015-08-30 15:27:12 -07:00
Ben Vanik
87094b8257 Adding XamUserContentRestriction* functions. 2015-08-30 15:00:04 -07:00
Dr. Chat
d2f672b2c5 Shift export ordinal back by the base to avoid false positive error 2015-08-14 20:02:39 -05:00
Ben Vanik
a92566dfc5 More style. 2015-08-07 21:29:03 -07: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
Ben Vanik
5c7f42e9d1 Fix for unknown kernel modules. 2015-07-19 10:55:12 -07:00
Ben Vanik
91d7acf59e Fixing some particularly bad /W4. 2015-07-18 23:04:21 -07:00