You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use dvars to retrieve the value of variables from my executable but this fails.
My executable is non-PIC I've cross_compiled on Mac using x86_64-linux-musl-gcc, so the base_addr should not be set.
state.dvars["myvar"] returns None even when it should return a value. It returns None as the address_range being checked (low_pc and high_pc) is not set correctly.
When running the following:
project.kb.dvars.load_from_dwarf()
the low_pc and high_pc are set incorrectly in debug_variables.py line 217:
I believe in this case either obj.mapped_base should be 0 or it should not be added to the low_pc/high_pc retrieved from dwarf info.
Steps to reproduce the bug
Compile a simple c file (e.g. example.c) with variables declared in a function using x86_64-linux-musl-gcc (it may be the case for any non-PIC executable).
Retrieve state.dvars["myvar"] after stepping into the function.
Environment
angr running on Mac on a cross-compiled binary:
using x86_64-linux-musl-gcc
Additional context
No response
The text was updated successfully, but these errors were encountered:
jornlp
changed the title
load_from_dwarf with a PIC executable fails to correctly set low_pc and high_pc for dears
load_from_dwarf with a PIC executable fails to correctly set low_pc and high_pc for dvars
Apr 12, 2024
jornlp
changed the title
load_from_dwarf with a PIC executable fails to correctly set low_pc and high_pc for dvars
load_from_dwarf with a non-PIC executable fails to correctly set low_pc and high_pc for dvars
Apr 22, 2024
Description
I want to use dvars to retrieve the value of variables from my executable but this fails.
My executable is non-PIC I've cross_compiled on Mac using x86_64-linux-musl-gcc, so the base_addr should not be set.
state.dvars["myvar"] returns None even when it should return a value. It returns None as the address_range being checked (low_pc and high_pc) is not set correctly.
When running the following:
the low_pc and high_pc are set incorrectly in debug_variables.py line 217:
I believe in this case either obj.mapped_base should be 0 or it should not be added to the low_pc/high_pc retrieved from dwarf info.
Steps to reproduce the bug
Compile a simple c file (e.g. example.c) with variables declared in a function using x86_64-linux-musl-gcc (it may be the case for any non-PIC executable).
Retrieve state.dvars["myvar"] after stepping into the function.
Environment
angr running on Mac on a cross-compiled binary:
using x86_64-linux-musl-gcc
Additional context
No response
The text was updated successfully, but these errors were encountered: