mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-10 07:06:34 +00:00
creport: Add another code region locating improvement.
This commit is contained in:
parent
36530a5501
commit
7d729e1836
1 changed files with 19 additions and 1 deletions
|
@ -102,7 +102,25 @@ void CodeList::AddCodeRegion(u64 debug_handle, u64 code_address) {
|
||||||
bool CodeList::TryFindCodeRegion(Handle debug_handle, u64 guess, u64 *address) {
|
bool CodeList::TryFindCodeRegion(Handle debug_handle, u64 guess, u64 *address) {
|
||||||
MemoryInfo mi;
|
MemoryInfo mi;
|
||||||
u32 pi;
|
u32 pi;
|
||||||
if (R_FAILED(svcQueryDebugProcessMemory(&mi, &pi, debug_handle, guess)) || mi.perm != Perm_Rx) {
|
if (R_FAILED(svcQueryDebugProcessMemory(&mi, &pi, debug_handle, guess))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mi.perm == Perm_Rw) {
|
||||||
|
guess = mi.addr - 4;
|
||||||
|
if (R_FAILED(svcQueryDebugProcessMemory(&mi, &pi, debug_handle, guess))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mi.perm == Perm_R) {
|
||||||
|
guess = mi.addr - 4;
|
||||||
|
if (R_FAILED(svcQueryDebugProcessMemory(&mi, &pi, debug_handle, guess))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mi.perm != Perm_Rx) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue