*Originally posted by Wololo
This is to discuss the best way to port HBL to other games, while keeping the changes as minimal as possible. From J416's port, after a quick glance, here's what I saw, and how I plan to merge it:
Basic idea: a specific included ".h" file for each exploit, in which we will put game-specific variables whenever needed
I believe in compile-time settings (.h file), at least for a first version. "config files" imply that the user should be able to tweak to their exploit, which IMO means they are ok programmers. In that case, I think compile-time configuration is as good (better?) than runtime configuration
- hardcoded Addresses in memory.c (list of threads to delete, etc...) -> move to "patapon.h", "minna1.h", etc... (+ need explanations on how to retrieve those values with psplink)
- stubs defined in eLoaderConf.rb (generate config/*) -> create a new eLoaderconf.rb for each exploit? will need memdumps from users on various firmwares + explanations on how to retrieve the stubs
- hardcoded load address in loader.h (where to load HBL in Ram) -> move to patapon.h etc...
- Makefile -> one makefile per exploit. defines which .h to load + other stuff. Ideally calls a common "Makefile" that defines everything that is shared by all games
- Firmware version computation + PSP Go detection (in utils.c ?) -> requires to get a bunch of user memdumps with various models/firmwares, and compare them
- Function Hooks: need to be conditionally compiled. (1 flag per function???). The flags will be defined in patapon.h, minna1.h, etc... (for example: #define HOOK_PEEK_POSITIVE_WITH_READ_POSITIVE or that kind of stuff). Let's define flags only if needed, as game exploits get discovered, we don't need thousands flags if all games use the hooks anyways.
Everything that is "game specific" (such as the sdk.S, generated config files, eLoaderconf.rb) should be moved in a game-specific subfolder (except the makefiles ?)
That's pretty much all I can think about for now, will update as I start working on the merges. Comments welcome
Important note: at least h.bin needs to be recompiled for each game. For this reason, I believe it is not worth the effort to move game-specific things into config files (versus .h files, I mean). In all cases, we will need to distribute different archives to avoid confusing the users anyways. (Firmware-specific things, on the other hand, are ok in config files, because of Ram usage constraints, we don't want to distribute one HBL per firmware, AND we don't want to store in Ram all information for all firmwares, I guess)
Advertising