-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Display More Symbols in Trace #321
Comments
|
I hacked this together, notice two assignments to ebx (one for the symbol, one for the address) and _stdout+0x10 for the memory write
It would be harder to put symbols in the actual disassembly, because the disassembler backend (capstone) doesn't trivially support symbols. |
That is definitely quite good and would be very helpful |
https://github.com/lunixbochs/usercorn/tree/sym-ui Usercorn has a very nice execution trace format that the UI uses (the stream UI doesn't need access to the actual running CPU, it does everything using only the trace!), you can also write your own programs to analyze it. The file format is here: https://github.com/lunixbochs/usercorn/blob/master/go/models/trace/PROTOCOL.md You can generate trace files with |
After I reinstalled, I get the following error when I try and run it
|
What command are you running? |
|
You only need -trace. -mtrace and -rtrace are implied by trace. filename must not be an executable. Did you overwrite it or something? |
It must not be an executable? I think my problem was that is wasn't one. But now I just don't get the new outputs. Is that only for display afterwards or can I have run |
|
Thanks. I will look at maybe trying to figure out why some of the mem writes are not showing up on the right side later, but it does look that loading into registers does print. |
There are two outputs for memory writes - membatch, which is the hexdump, and mtrace, which is the R / W addrs. I would be very surprised if an assembly instruction accessed memory and there wasn't a corresponding mtrace output for it. |
So I was talking about what usercorn outputs:
what is in the assembly file:
|
is STATIC_Boolean_MAX_VALUE an actual symbol that ended up in the file? |
usercorn doesn't have any way of seeing the assembly file, it just parses debug information from the executable. |
Yes, running
|
what is |
|
You should look into how Go loads symbols from an ELF file and make sure that symbol is there? You can import fmt and put some prints in the loops in this function https://github.com/lunixbochs/usercorn/blob/master/go/loader/elf.go#L164 |
In my example, these symbols are in the same area and work fine:
If you run In my case:
If I run
And:
|
Trace already has access to symbols, but it would be very useful to be able see the label names when they are used (in the assembly) for jumps, loads, and addressing.
Example:
.s:
usercorn trace:
The text was updated successfully, but these errors were encountered: