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

MIPS missing XREFS #8795

Closed
sixeltek opened this issue Nov 6, 2017 · 5 comments
Closed

MIPS missing XREFS #8795

sixeltek opened this issue Nov 6, 2017 · 5 comments
Labels
MIPS MIPS architecture support issues

Comments

@sixeltek
Copy link

sixeltek commented Nov 6, 2017

Hi!

I am new to radare2, so maybe it is something i'm doing wrong. When disassembling MIPS32, some functions are missing from the XREF.

Below is the analyis from the busybox entry point

/ (fcn) entry0 88
| entry0 ();
| ; var int local_0h @ sp+0x0
| ; var int local_10h @ sp+0x10
| ; var int local_14h @ sp+0x14
| ; var int local_18h @ sp+0x18
| 0x00403fa0 03e00021 move zero, ra
| 0x00403fa4 04110001 bal 0x403fac
| 0x00403fa8 00000000 nop
| ; CALL XREF from 0x00403fa4 (entry0)
| 0x00403fac 3c1c0045 lui gp, 0x45
| 0x00403fb0 279cd2c0 addiu gp, gp, -0x2d40
| 0x00403fb4 0000f821 move ra, zero
| 0x00403fb8 8f848064 lw a0, -0x7f9c(gp)
| 0x00403fbc 8fa50000 lw a1, (sp)
| 0x00403fc0 27a60004 addiu a2, sp, 4
| 0x00403fc4 2401fff8 addiu at, zero, -8
| 0x00403fc8 03a1e824 and sp, sp, at
| 0x00403fcc 27bdffe0 addiu sp, sp, -0x20
| 0x00403fd0 8f878060 lw a3, -0x7fa0(gp)
| 0x00403fd4 8f8885c8 lw t0, -0x7a38(gp)
| 0x00403fd8 afa80010 sw t0, 0x10(sp)
| 0x00403fdc afa20014 sw v0, 0x14(sp)
| 0x00403fe0 afbd0018 sw sp, 0x18(sp)
| 0x00403fe4 8f998520 lw t9, -0x7ae0(gp) ; [0x42b1d0:4]=0x8f998010 ; sym.imp.__uClibc_main
| 0x00403fe8 0320f809 jalr t9
| 0x00403fec 00000000 nop

The instruction in 0x00403fd0 should be identified as 'lw a3,_init_proc', and the next one as 'lw t0,_term_proc'. Those symbols do not appear in the symbol table.

I attach the executable. I am using radare2 from git (latest)
busybox.tar.gz

.

Thank you very much!

@Maijin Maijin added the MIPS MIPS architecture support issues label Nov 6, 2017
@enovella
Copy link
Contributor

enovella commented Nov 7, 2017

Same issue opened: #8245

@stale
Copy link

stale bot commented Jun 16, 2020

This issue has been automatically marked as stale because it has not had recent activity. Considering a lot has changed since its creation, we kindly ask you to check again if the issue you reported is still relevant in the current version of radare2. If it is, update this issue with a comment, otherwise it will be automatically closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 16, 2020
@XVilka XVilka removed the wontfix label Jun 16, 2020
@ret2libc
Copy link
Contributor

This seems to be fixed:

[0x00403fa0 [xAdvc]0 0% 220 ./busybox]> pd $r @ entry0                                                                                                                                        
            ;-- entry0:                                                                                                                                                                       
            ;-- _ftext:                                                                                                                                                                       
            ;-- pc:                                                                                                                                                                           
            0x00403fa0      03e00021       move zero, ra                                                                                                                                      
            0x00403fa4      04110001       bal 0x403fac                ;[1]                                                                                                                   
            0x00403fa8      00000000       nop                                                                                                                                                
            0x00403fac      3c1c0045       lui gp, 0x45                                                                                                                                       
            0x00403fb0      279cd2c0       addiu gp, gp, -0x2d40                                                                                                                              
            0x00403fb4      0000f821       move ra, zero                                                                                                                                      
            0x00403fb8      8f848064       lw a0, -main(gp)            ; [0x445324:4]=0x404120 sym.main                                                                                       
            0x00403fbc      8fa50000       lw a1, (sp)                                                                                                                                        
            0x00403fc0      27a60004       addiu a2, sp, 4                                                                                                                                    
            0x00403fc4      2401fff8       addiu at, zero, -8                                                                                                                                 
            0x00403fc8      03a1e824       and sp, sp, at                                                                                                                                     
            0x00403fcc      27bdffe0       addiu sp, sp, -0x20                                                                                                                                
            0x00403fd0      8f878060       lw a3, -sym._init(gp)       ; [0x445320:4]=0x403f2c sym._init                                                                                      
            0x00403fd4      8f8885c8       lw t0, -sym._fini(gp)       ; [0x445888:4]=0x42bc10 sym._fini                                                                                      
            0x00403fd8      afa80010       sw t0, 0x10(sp)                                                                                                                                    
            0x00403fdc      afa20014       sw v0, 0x14(sp)                                                                                                                                    
            0x00403fe0      afbd0018       sw sp, 0x18(sp)                                                                                                                                    
            0x00403fe4      8f998520       lw t9, -sym.imp.__uClibc_main(gp)    ; [0x4457e0:4]=0x42b1d0 sym.imp.__uClibc_main       

@radare
Copy link
Collaborator

radare commented Jun 24, 2020 via email

@ret2libc
Copy link
Contributor

Not with the many already fixed issues that are around and I'm recently looking at, sorry. If possible, it would be great if the reporter could help us with that. cc @sixeltek would you be willing to help us avoid possible regressions in the future? https://github.com/radareorg/radare2/tree/master/test should help on how to write a test for this. Thanks in any case :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MIPS MIPS architecture support issues
Projects
None yet
Development

No branches or pull requests

6 participants