Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upFunction analysis regression #14157
Closed
Function analysis regression #14157
Comments
This comment has been minimized.
This comment has been minimized.
Thats totally unrelated to analysis. Its because rbin is now switching to use rbuf and the debugger reports file sizes of ut64max which some plugs consider invalid. Please help me track down all those regressions. Ive been working on this huge refavtoring for 3 weeks and i need more hands to get it right for the release
… On 25 May 2019, at 22:27, davidpolverari ***@***.***> wrote:
On the latest commits, r2 -dA or using aaa after loading a file on debugger doesn't resolve function names to addresses.
It seems 680340c is the offending commit on this case, as everything was working normally on the previous commit (3e3d97b).
Work environment
Questions Answers
OS/arch/bits (mandatory) Debian 9 (stretch) amd64
File format of the file you reverse (mandatory) ELF
Architecture/bits of the file (mandatory) x86/64
r2 -v full output, not truncated (mandatory) radare2 3.6.0-git 22430 @ linux-x86-64 git.3.5.1-88-g7d449419b commit: 7d44941 build: 2019-05-25__15:20:05
Expected behavior
$ r2 -dA /bin/true
Process with PID 29761 started...
= attach 29761 29761
bin.baddr 0x55fec6530000
Using 0x55fec6530000
asm.bits 64
[x] Analyze all flags starting with sym. and entry0 (aa)
[Warning: Invalid range. Use different search.in=? or anal.in=dbg.maps.x
Warning: Invalid range. Use different search.in=? or anal.in=dbg.maps.x
[x] Analyze function calls (aac)
[Warning: Invalid range. Use different search.in=? or anal.in=dbg.maps.x
[x] find and analyze function preludes (aap)
[x] Analyze len bytes of instructions for references (aar)
[x] Check for objc references
[x] Check for vtables
[TOFIX: aaft can't run in debugger mode.ions (aaft)
[x] Type matching analysis for all functions (aaft)
[x] Use -AA or aaaa to perform additional experimental analysis.
-- Save your projects with 'Ps <project-filename>' and restore then with 'Po <project-filename>'
[0x7f5890a35c20]> s main
Cannot seek to unknown address 'main'
[0x7f5890a35c20]>
Actual behavior
$ r2 -dA /bin/true
Process with PID 29761 started...
= attach 29761 29761
bin.baddr 0x55fec6530000
Using 0x55fec6530000
asm.bits 64
[x] Analyze all flags starting with sym. and entry0 (aa)
[Warning: Invalid range. Use different search.in=? or anal.in=dbg.maps.x
Warning: Invalid range. Use different search.in=? or anal.in=dbg.maps.x
[x] Analyze function calls (aac)
[Warning: Invalid range. Use different search.in=? or anal.in=dbg.maps.x
[x] find and analyze function preludes (aap)
[x] Analyze len bytes of instructions for references (aar)
[x] Check for objc references
[x] Check for vtables
[TOFIX: aaft can't run in debugger mode.ions (aaft)
[x] Type matching analysis for all functions (aaft)
[x] Use -AA or aaaa to perform additional experimental analysis.
-- Save your projects with 'Ps <project-filename>' and restore then with 'Po <project-filename>'
[0x7f5890a35c20]> s main
[0x<address_of_main>]>
Steps to reproduce the behavior
Call r2 to debug the file and analyze it;
Try to seek the position of a well known function in the file.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This comment has been minimized.
This comment has been minimized.
@radare This seems to fix it. I never touched bin before so i don't know what I'm doing
|
This comment has been minimized.
This comment has been minimized.
Try it in a PR to verify if its breaking something pls
… On 26 May 2019, at 20:37, GustavoLCR ***@***.***> wrote:
@radare This seems to fix it. I never touched bin before so i don't know what I'm doing
diff --git a/libr/bin/bin.c b/libr/bin/bin.c
index 4b98eebf8..978331633 100644
--- a/libr/bin/bin.c
+++ b/libr/bin/bin.c
@@ -354,6 +354,7 @@ R_API bool r_bin_open_io(RBin *bin, RBinOptions *opt) {
bin->file = fname;
opt->sz = R_MIN (file_sz, opt->sz);
ut64 seekaddr = is_debugger? opt->baseaddr: opt->loadaddr;
+#if 0
if (seekaddr > 0 && seekaddr != UT64_MAX) {
// slice buffer if necessary
RBuffer *nb = r_buf_new_slice (buf, seekaddr, opt->sz);
@@ -362,6 +363,7 @@ R_API bool r_bin_open_io(RBin *bin, RBinOptions *opt) {
buf = nb;
}
}
+#endif
if (bin->use_xtr && !opt->pluginname && (st64)opt->sz > 0) {
// XXX - for the time being this is fine, but we may want to
// change the name to something like
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This comment has been minimized.
This comment has been minimized.
Try in a PR
… On 26 May 2019, at 20:37, GustavoLCR ***@***.***> wrote:
@radare This seems to fix it. I never touched bin before so i don't know what I'm doing
diff --git a/libr/bin/bin.c b/libr/bin/bin.c
index 4b98eebf8..978331633 100644
--- a/libr/bin/bin.c
+++ b/libr/bin/bin.c
@@ -354,6 +354,7 @@ R_API bool r_bin_open_io(RBin *bin, RBinOptions *opt) {
bin->file = fname;
opt->sz = R_MIN (file_sz, opt->sz);
ut64 seekaddr = is_debugger? opt->baseaddr: opt->loadaddr;
+#if 0
if (seekaddr > 0 && seekaddr != UT64_MAX) {
// slice buffer if necessary
RBuffer *nb = r_buf_new_slice (buf, seekaddr, opt->sz);
@@ -362,6 +363,7 @@ R_API bool r_bin_open_io(RBin *bin, RBinOptions *opt) {
buf = nb;
}
}
+#endif
if (bin->use_xtr && !opt->pluginname && (st64)opt->sz > 0) {
// XXX - for the time being this is fine, but we may want to
// change the name to something like
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On the latest commits, r2 -dA or using
aaa
after loading a file on debugger doesn't resolve function names to addresses.It seems 680340c is the offending commit on this case, as everything was working normally on the previous commit (3e3d97b).
Work environment
Expected behavior
Actual behavior
Steps to reproduce the behavior