mirror of
https://dev.lirent.ru/Vatrog/vm-introspection-engine.git
synced 2026-07-09 00:46:36 +03:00
Scope gva_code_xref by an explicit prot_any argument
It hard-coded VR_X, so a target whose page tables expose no executable region silently yielded zero xrefs. Callers now pass the scope (VR_X to restrict to code, VR_R when the X bit is unavailable); the decoder and exact target match remain the correctness gate. Mirrors the prot_any parameter gva_imm_xref already carries.
This commit is contained in:
@@ -115,10 +115,10 @@ static int xref_sweep_cb(void* u, const uint8_t* data, size_t len,
|
||||
}
|
||||
|
||||
int gva_code_xref(vmie_mem* m, uintptr_t cr3, uint64_t lo, uint64_t hi,
|
||||
uint64_t target_va, uint64_t* out, int max) {
|
||||
uint32_t prot_any, uint64_t target_va, uint64_t* out, int max) {
|
||||
struct xref_cb c; memset(&c, 0, sizeof c);
|
||||
c.target = target_va; c.out = out; c.max = max;
|
||||
if (gva_sweep(m, cr3, lo, hi, VR_X, X86_MAX_INSN, xref_sweep_cb, &c) < 0) {
|
||||
if (gva_sweep(m, cr3, lo, hi, prot_any, X86_MAX_INSN, xref_sweep_cb, &c) < 0) {
|
||||
return -1;
|
||||
}
|
||||
return c.n;
|
||||
|
||||
Reference in New Issue
Block a user