Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty base handling #15

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/osi/windows/windows_handles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ uint64_t resolve_base_x64(struct WindowsProcessOSI *posi, uint64_t value, uint32
// fall through
}
case 0:
if (base == 0){
// couldn't read vmem, skipping
break;
}
base = base + (handle_obj.LowIndex * HANDLE_ENTRY_SIZE_64);
break;
default:
Expand Down Expand Up @@ -61,6 +65,10 @@ uint32_t resolve_base_x86(struct WindowsProcessOSI *posi, uint32_t value, uint32
// fall through
}
case 0:
if (base == 0){
// couldn't read vmem, skipping
break;
}
base = base + (handle_obj.LowIndex * HANDLE_ENTRY_SIZE_32);
break;
default:
Expand Down Expand Up @@ -93,6 +101,9 @@ osi::i_t resolve_handle_table_entry(struct WindowsProcessOSI* posi, uint64_t han
static_cast<uint32_t>(table_base));
}

if (!entry)
return osi::i_t();

uint64_t header = obj.set_address(entry).getu() & TABLE_MASK;
return obj.set_address(header).set_type("_OBJECT_HEADER");
}
Expand Down