mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-30 06:25:20 -04:00
loader: refactor ro manager/improve accuracy
This commit is contained in:
parent
d8a36e39f2
commit
d9dc04318d
24 changed files with 328 additions and 218 deletions
|
@ -56,8 +56,8 @@ namespace ams::patcher {
|
|||
/* Read module id from name. */
|
||||
std::memset(out_module_id, 0, sizeof(*out_module_id));
|
||||
for (unsigned int name_ofs = 0, id_ofs = 0; name_ofs < name_len - extension_len && id_ofs < sizeof(*out_module_id); id_ofs++) {
|
||||
out_module_id->build_id[id_ofs] |= ConvertHexNybble(name[name_ofs++]) << 4;
|
||||
out_module_id->build_id[id_ofs] |= ConvertHexNybble(name[name_ofs++]);
|
||||
out_module_id->data[id_ofs] |= ConvertHexNybble(name[name_ofs++]) << 4;
|
||||
out_module_id->data[id_ofs] |= ConvertHexNybble(name[name_ofs++]);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -76,7 +76,7 @@ namespace ams::patcher {
|
|||
bool IsIpsFileForModule(const char *name, const ro::ModuleId *module_id) {
|
||||
const size_t name_len = std::strlen(name);
|
||||
|
||||
/* The path must be correct size for a build id (with trailing zeroes optionally trimmed) + ".ips". */
|
||||
/* The path must be correct size for a module id (with trailing zeroes optionally trimmed) + ".ips". */
|
||||
if (!(IpsFileExtensionLength < name_len && name_len <= ModuleIpsPatchLength)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -330,7 +330,7 @@ namespace ams::scs {
|
|||
Result PrepareToLaunchProgram(ncm::ProgramId program_id, const void *args, size_t args_size) {
|
||||
/* Set the arguments. */
|
||||
R_TRY_CATCH(ldr::SetProgramArgument(program_id, args, args_size)) {
|
||||
R_CATCH(ldr::ResultTooManyArguments) {
|
||||
R_CATCH(ldr::ResultArgumentCountOverflow) {
|
||||
/* There are too many arguments already registered. Flush the arguments queue. */
|
||||
R_TRY(ldr::FlushArguments());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue