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

Missing argument in ARMv7 function derived from DWARF #3548

Closed
Tracked by #3565 ...
XVilka opened this issue Jun 2, 2023 · 6 comments · Fixed by #3703
Closed
Tracked by #3565 ...

Missing argument in ARMv7 function derived from DWARF #3548

XVilka opened this issue Jun 2, 2023 · 6 comments · Fixed by #3703

Comments

@XVilka
Copy link
Member

XVilka commented Jun 2, 2023

Note missing long int *p from the arguments list

$ rizin -A test/bins/elf/float_ex1_arm
[0x000004a4]> pdf @ dbg._start_c
            ; CALL XREF from entry0 @ 0x4b8
            ;-- _start_c:
╭ void dbg._start_c(long int *p);
│           ; var int16_t var_10h @ stack - 0x10
│           ; var int16_t var_ch @ stack - 0xc
│           0x000004c0      13b5           push  {r0, r1, r4, lr}      ; void _start_c(long int *p);
│           0x000004c2      094a           ldr   r2, [data.000004e8]   ; [0x4e8:4]=0x10ade
│           0x000004c4      0949           ldr   r1, [aav.0x0000004c]  ; [0x4ec:4]=76 ; "L"
│           0x000004c6      7a44           add   r2, pc                ; 0x10fa8
│                                                                      ; obj._GLOBAL_OFFSET_TABLE
│           0x000004c8      5458           ldr   r4, [r2, r1]
│           0x000004ca      0021           movs  r1, 0
│           0x000004cc      084b           ldr   r3, [aav.0x0000003c]  ; [0x4f0:4]=60 ; "<"
│           0x000004ce      d358           ldr   r3, [r2, r3]          ; 0x411
│                                                                      ; aav.0x00000411 ; void *init
│           0x000004d0      0191           str   r1, [var_ch]
│           0x000004d2      0849           ldr   r1, [aav.0x00000050]  ; [0x4f4:4]=80 ; "P"
│           0x000004d4      5258           ldr   r2, [r2, r1]          ; 0x7cd
│                                                                      ; aav.0x000007cd
│           0x000004d6      0092           str   r2, [sp]
│           0x000004d8      0168           ldr   r1, [r0]              ; int argc
│           0x000004da      021d           adds  r2, r0, 4             ; aav.0x00000004 ; char **ubp_av
│           0x000004dc      2046           mov   r0, r4                ; void *main
╰           0x000004de      fff7d6ef       blx   sym.imp.__libc_start_main ; sym.imp.__libc_start_main ; int __libc_start_main(void *main, int argc, char **ubp_av, void *init, void *fini, void *rtld_fini, void *stack_end)
[0x000004a4]> afv @  dbg._start_c
var int16_t var_10h @ stack - 0x10
var int16_t var_ch @ stack - 0xc
[0x000004a4]>

Please do not fix it in the Tricore PR, wait until it's merged first, then could be addressed, to avoid preventing fixes from Tricore PR being merged as soon as possible.

@XVilka XVilka added this to the 0.6.0 milestone Jun 2, 2023
@XVilka
Copy link
Member Author

XVilka commented Jun 6, 2023

Now this could be addressed separately too.

@XVilka XVilka mentioned this issue Jun 6, 2023
5 tasks
@imbillow
Copy link
Contributor

imbillow commented Jun 6, 2023

This is because the .debug_loclists section is not parsed, but this is DWARF5 content and should be fixed later when DWARF5 support is added,

@XVilka
Copy link
Member Author

XVilka commented Jun 6, 2023

Understood, it can be addressed later then.

@XVilka
Copy link
Member Author

XVilka commented Jun 7, 2023

@imbillow could you please start addressing this once Tricore analysis PR is merged (#3463) but before continuing Tricore RzIL conversion? It's quite important issue since I found many ARM binaries have the same problem.

Probably could be done together with the #3535

@imbillow
Copy link
Contributor

imbillow commented Jun 7, 2023

@imbillow could you please start addressing this once Tricore analysis PR is merged (#3463) but before continuing Tricore RzIL conversion? It's quite important issue since I found many ARM binaries have the same problem.

Probably could be done together with the #3535

Yes

@XVilka
Copy link
Member Author

XVilka commented Jun 8, 2023

Maybe this could be helpful too: https://github.com/gimli-rs/gimli/blob/master/src/read/loclists.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants