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

"go to address" in the assembly window doesn't work #255

Closed
epasveer opened this issue Oct 12, 2024 · 5 comments · Fixed by #258
Closed

"go to address" in the assembly window doesn't work #255

epasveer opened this issue Oct 12, 2024 · 5 comments · Fixed by #258
Assignees
Labels
bug Something isn't working

Comments

@epasveer
Copy link
Owner

epasveer commented Oct 12, 2024

From #127, the user reports this:

Also, I tried the "go to address" in the assembly window, but it wasn't working, the view didn't move.

This is more than likely because the address given in not in the current page of assembly. If so, Seer should get a new page of assembly around the address.

@epasveer epasveer added the bug Something isn't working label Oct 12, 2024
@epasveer epasveer self-assigned this Oct 12, 2024
@epasveer epasveer pinned this issue Oct 12, 2024
@epasveer
Copy link
Owner Author

Hi @kevinferrare,

So I worked some more on the problem of the view not changing when you enter an address. The bug was it was expecting the address in the current view. Now it refreshes the assembly around the address you give it.

However, I have a question. In your work flow, do you just have a list of valid addresses somewhere? How do you know what address to enter?

I found a pure assembly test program that had a "main" (start address of '_start') and it called a assembly function called 'square'. Two separate ".s" source file. Quite simple.

I used the "objdump" program to give me the addresses.

$ objdump -t square_test

square_test:     file format elf32-i386

SYMBOL TABLE:
00000000 l    df *ABS*  00000000 isolated_square.o
08048070 l       .text  00000000 end_square
08048067 g     F .text  00000000 square
08048054 g       .text  00000000 _start
08049074 g       .text  00000000 __bss_start
08049074 g       .text  00000000 _edata
08049074 g       .text  00000000 _end

Seer works when I find "0x08048054" or "0x08048067". They live into two different ".s" files.

But my question is this what you do?

gdb, if it has the proper debug information, can be given an address and it will figure out the start and end address of the function. In this mode, if you give it an address that is not in the middle of a function, it will report an error. This is what Seer does too. The address you're trying to "go to" needs to be in the middle of some function.

So I suppose you compile your ".s" files with "-g"?

gdb has another mode where you give it some address and it will give you the assembly at that point plus N number of instructions. There's is no notion of a "start function" or "end function" in this mode.

Anyway, give this branch a kick and let me know. Many thanks.

https://github.com/epasveer/seer/tree/255-go-to-address-in-the-assembly-window-doesnt-work

@kevinferrare
Copy link

Hello and thanks for checking that!

My workflow is quite different from that, I connect GDB to an emulator so there is no source code, just raw memory with mixed data and machine code.
I also don't compile anything. I just need to:

  • Put breakpoints at places of interest (determined from crash logs / other debugging sessions)
  • Inspect registers / memory / stack to confirm the machine code is doing what I expect it to do

I just recompiled your branch, and I confirm it is working, I can browse and disassemble code by entering manually an address or an expression like $pc+3

@epasveer
Copy link
Owner Author

Cool. Thanks.

Sounds like I can close this task?

@kevinferrare
Copy link

Yes, it's working fine now thanks 😉

@epasveer
Copy link
Owner Author

Cool. Many thanks.

@epasveer epasveer linked a pull request Oct 29, 2024 that will close this issue
@epasveer epasveer unpinned this issue Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants