mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-13 00:26:35 +00:00
creport: tabs -> spaces
This commit is contained in:
parent
6c8a1a39e1
commit
326d58e28c
2 changed files with 41 additions and 41 deletions
|
@ -38,12 +38,12 @@ void CodeList::ReadCodeRegionsFromProcess(Handle debug_handle, u64 pc, u64 lr) {
|
||||||
this->code_infos[this->code_count].end_address = mi.addr + mi.size;
|
this->code_infos[this->code_count].end_address = mi.addr + mi.size;
|
||||||
GetCodeInfoName(debug_handle, mi.addr, mi.addr + mi.size, this->code_infos[this->code_count].name);
|
GetCodeInfoName(debug_handle, mi.addr, mi.addr + mi.size, this->code_infos[this->code_count].name);
|
||||||
GetCodeInfoBuildId(debug_handle, mi.addr + mi.size, this->code_infos[this->code_count].build_id);
|
GetCodeInfoBuildId(debug_handle, mi.addr + mi.size, this->code_infos[this->code_count].build_id);
|
||||||
if (this->code_infos[this->code_count].name[0] == '\x00') {
|
if (this->code_infos[this->code_count].name[0] == '\x00') {
|
||||||
snprintf(this->code_infos[this->code_count].name, 0x1F, "[%02x%02x%02x%02x]", this->code_infos[this->code_count].build_id[0],
|
snprintf(this->code_infos[this->code_count].name, 0x1F, "[%02x%02x%02x%02x]", this->code_infos[this->code_count].build_id[0],
|
||||||
this->code_infos[this->code_count].build_id[1],
|
this->code_infos[this->code_count].build_id[1],
|
||||||
this->code_infos[this->code_count].build_id[2],
|
this->code_infos[this->code_count].build_id[2],
|
||||||
this->code_infos[this->code_count].build_id[3]);
|
this->code_infos[this->code_count].build_id[3]);
|
||||||
}
|
}
|
||||||
this->code_count++;
|
this->code_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,44 +90,44 @@ void CodeList::GetCodeInfoName(u64 debug_handle, u64 rx_address, u64 rodata_addr
|
||||||
|
|
||||||
/* Clear name. */
|
/* Clear name. */
|
||||||
memset(name, 0, 0x20);
|
memset(name, 0, 0x20);
|
||||||
|
|
||||||
/* Check whether this NSO *has* a name... */
|
/* Check whether this NSO *has* a name... */
|
||||||
{
|
{
|
||||||
u64 rodata_start[0x20/sizeof(u64)];
|
u64 rodata_start[0x20/sizeof(u64)];
|
||||||
MemoryInfo mi;
|
MemoryInfo mi;
|
||||||
u32 pi;
|
u32 pi;
|
||||||
u64 rw_address;
|
u64 rw_address;
|
||||||
|
|
||||||
/* Verify .rodata is read-only. */
|
/* Verify .rodata is read-only. */
|
||||||
if (R_FAILED(svcQueryDebugProcessMemory(&mi, &pi, debug_handle, rodata_addr)) || mi.perm != Perm_R) {
|
if (R_FAILED(svcQueryDebugProcessMemory(&mi, &pi, debug_handle, rodata_addr)) || mi.perm != Perm_R) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* rwdata is after rodata. */
|
/* rwdata is after rodata. */
|
||||||
rw_address = mi.addr + mi.size;
|
rw_address = mi.addr + mi.size;
|
||||||
|
|
||||||
/* Read start of .rodata. */
|
/* Read start of .rodata. */
|
||||||
if (R_FAILED(svcReadDebugProcessMemory(rodata_start, debug_handle, rodata_addr, sizeof(rodata_start)))) {
|
if (R_FAILED(svcReadDebugProcessMemory(rodata_start, debug_handle, rodata_addr, sizeof(rodata_start)))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if name section is present. */
|
/* Check if name section is present. */
|
||||||
if (rodata_start[0] == (rw_address - rx_address)) {
|
if (rodata_start[0] == (rw_address - rx_address)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read name out of .rodata. */
|
/* Read name out of .rodata. */
|
||||||
if (R_FAILED(svcReadDebugProcessMemory(name_in_proc, debug_handle, rodata_addr + 8, sizeof(name_in_proc)))) {
|
if (R_FAILED(svcReadDebugProcessMemory(name_in_proc, debug_handle, rodata_addr + 8, sizeof(name_in_proc)))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start after last slash in path. */
|
/* Start after last slash in path. */
|
||||||
int ofs = strnlen(name_in_proc, sizeof(name_in_proc));
|
int ofs = strnlen(name_in_proc, sizeof(name_in_proc));
|
||||||
while (ofs >= 0 && name_in_proc[ofs] != '/' && name_in_proc[ofs] != '\\') {
|
while (ofs >= 0 && name_in_proc[ofs] != '/' && name_in_proc[ofs] != '\\') {
|
||||||
ofs--;
|
ofs--;
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy(name, name_in_proc + ofs + 1, 0x20);
|
strncpy(name, name_in_proc + ofs + 1, 0x20);
|
||||||
name[0x1F] = '\x00';
|
name[0x1F] = '\x00';
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,9 +11,9 @@ void CrashReport::BuildReport(u64 pid, bool has_extra_info) {
|
||||||
this->has_extra_info = has_extra_info;
|
this->has_extra_info = has_extra_info;
|
||||||
if (OpenProcess(pid)) {
|
if (OpenProcess(pid)) {
|
||||||
ProcessExceptions();
|
ProcessExceptions();
|
||||||
this->code_list.ReadCodeRegionsFromProcess(this->debug_handle, this->crashed_thread_info.GetPC(), this->crashed_thread_info.GetLR());
|
this->code_list.ReadCodeRegionsFromProcess(this->debug_handle, this->crashed_thread_info.GetPC(), this->crashed_thread_info.GetLR());
|
||||||
this->thread_list.ReadThreadsFromProcess(this->debug_handle, Is64Bit());
|
this->thread_list.ReadThreadsFromProcess(this->debug_handle, Is64Bit());
|
||||||
this->crashed_thread_info.SetCodeList(&this->code_list);
|
this->crashed_thread_info.SetCodeList(&this->code_list);
|
||||||
this->thread_list.SetCodeList(&this->code_list);
|
this->thread_list.SetCodeList(&this->code_list);
|
||||||
|
|
||||||
if (IsApplication()) {
|
if (IsApplication()) {
|
||||||
|
@ -287,10 +287,10 @@ void CrashReport::SaveToFile(FILE *f_report) {
|
||||||
CrashReport::Memdump(f_report, " Dying Message: ", this->dying_message, this->dying_message_size);
|
CrashReport::Memdump(f_report, " Dying Message: ", this->dying_message, this->dying_message_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf(f_report, "Code Region Info:\n");
|
fprintf(f_report, "Code Region Info:\n");
|
||||||
this->code_list.SaveToFile(f_report);
|
this->code_list.SaveToFile(f_report);
|
||||||
fprintf(f_report, "\nThread Report:\n");
|
fprintf(f_report, "\nThread Report:\n");
|
||||||
this->thread_list.SaveToFile(f_report);
|
this->thread_list.SaveToFile(f_report);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Lifted from hactool. */
|
/* Lifted from hactool. */
|
||||||
|
|
Loading…
Reference in a new issue