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

izz seems to ignore memory maps for binaries without header #19524

Closed
cavedon opened this issue Dec 21, 2021 · 6 comments
Closed

izz seems to ignore memory maps for binaries without header #19524

cavedon opened this issue Dec 21, 2021 · 6 comments
Assignees
Milestone

Comments

@cavedon
Copy link

cavedon commented Dec 21, 2021

Environment

Radare 5.5.4 (or today's master, 0c6d40c) on Ubuntu focal 64 bit

Description

% echo "this is string" > textfile
% r2 -m 0x1000 textfile 
Warning: using oba to load the syminfo from different mapaddress.
 -- Mind that the 'g' in radare is silent
[0x00001000]> izz
[Strings]
nth paddr      vaddr      len size section type  string
―――――――――――――――――――――――――――――――――――――――――――――――――――――――
0   0x00000000 0x00000000 15  15           ascii this is string\n

[0x00001000]> om
* 1 fd: 3 +0x00000000 0x00001000 - 0x0000100e r-x 
[0x00001000]> xs 0x1000
- offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF
0x00001000  7468 6973 2069 7320 7374 7269 6e67 0aff  this is string..
0x00001010  ffff ffff ffff ffff ffff ffff ffff ffff  ................
 ...
[0x00001000]> xs 0x0
[0x00001000]> 

I expect the vaddr in the output of izz to be 0x1000 instead of 0x0.

This is a follow up from https://discord.com/channels/698492940917538878/788195469636796446/922220406822281226

@cavedon
Copy link
Author

cavedon commented Dec 21, 2021

I found out that if set

ret->has_va = 1;

in RBinInfo *info(RBinFile *bf) in bin_any.c, then the vaddr column in izz output is correct.
Should that be set whenever -m is passed?
I can create a patch, but it is not clear to me how know if the file was mapped at a different address from inside bin_any.c...

@cavedon cavedon changed the title izz seems to ignore memory maps izz seems to ignore memory maps for binaries without header Dec 22, 2021
@trufae trufae added this to the 5.6.2 milestone Feb 7, 2022
@trufae
Copy link
Collaborator

trufae commented Feb 7, 2022

Can you make a PR with this change? thanks!

@radare
Copy link
Collaborator

radare commented Feb 11, 2022

im on it

@radare radare self-assigned this Feb 11, 2022
@trufae
Copy link
Collaborator

trufae commented Feb 11, 2022

#19684

1 similar comment
@trufae
Copy link
Collaborator

trufae commented Feb 11, 2022

#19684

@trufae trufae modified the milestones: 5.6.2, 5.7.0, 5.6.4 Feb 15, 2022
@trufae
Copy link
Collaborator

trufae commented Feb 16, 2022

ill finish the pr for the next release. couldnt merge before that because ther was enough critical bugs accumulated :D

@trufae trufae closed this as completed Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants