mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-16 08:04:23 -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue