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

Introduced dump to trace #3098

Open
wants to merge 37 commits into
base: development
Choose a base branch
from

Conversation

torusrxxx
Copy link
Member

This fixes #2378
There's obviously a lot more to do. This pull request is here only for those who desperately want to dump from a trace or want to become alpha testers.
Right click on an instruction in the trace, and click the "Information" menu to get full dump of the trace up to the selected instruction into the log view.

@torusrxxx torusrxxx force-pushed the patch000000dc branch 2 times, most recently from cebbd21 to 6d182cb Compare June 11, 2023 04:20
@torusrxxx
Copy link
Member Author

The trace dump index is working and tested on a 136MB huge trace.
Speed is lightening. Search constant takes 10 seconds and memory reference search takes 46ms. When memory reference search is used for the first time it takes 17s including reading the trace file and building the index.
Memory usage is moderate. It saves a record in trace for every byte, so memory usage could be improved by saving a record for every dword instead. This is more complex due to special treatment needed for unaligned memory access. Currently it uses about 567MB for the 136MB test trace, may be acceptable.
Next step will be the GUI part.

@mrexodia
Copy link
Member

Would you like this to be merged into development or will you continue development on this branch? Currently the format checks are failing, so merging is blocked...

@torusrxxx
Copy link
Member Author

I think those new files are already formatted, no idea why appveyor doesn't like that. I'll pause development for a while, but I don't think this feature is completed. The aim of this pull request is to bring in dump and stack windows, not to merely accelerate memory reference search. Of course I support merging it if you think merging this would allow other people to use this feature and contribute to it. Possibly disable the debug feature of dumping the trace memory in log view when clicking on "information" menu, it should be available in the dump tab instead.

@torusrxxx torusrxxx force-pushed the patch000000dc branch 2 times, most recently from 42d600b to 37e4416 Compare July 17, 2023 09:09
@torusrxxx torusrxxx force-pushed the patch000000dc branch 2 times, most recently from 8d6f503 to 6f551fc Compare July 27, 2023 09:34
@torusrxxx
Copy link
Member Author

Dump widget has been added to trace, now it looks almost like the CPU view. There are still tons of usability problems and random crashes.

@torusrxxx torusrxxx force-pushed the patch000000dc branch 2 times, most recently from 52a6d98 to 7a6c225 Compare August 27, 2023 03:45
@torusrxxx torusrxxx marked this pull request as draft August 27, 2023 03:59
@mrexodia
Copy link
Member

It looks like this is conflicting with the changes in #3192 a bit. I will try to properly refactor the HexDump to take an AbstractMemoryPage with pure virtual read/write functions, since this will be useful for other projects as well.

@mrexodia
Copy link
Member

The following files are causing the formatting checks error btw:

src/gui/Src/Tracer/TraceDump.cpp
src/gui/Src/Tracer/TraceDump.h
src/gui/Src/Tracer/TraceFileDump.cpp
src/gui/Src/Tracer/TraceFileDump.h

Might be CRLF vs LF?

@AppVeyorBot
Copy link

Download x64dbg 1.0.1711 (commit ab2a69cd13 by @torusrxxx)

@AppVeyorBot
Copy link

Download x64dbg 1.0.1725 (commit 3d0e2654a9 by @torusrxxx)

@torusrxxx
Copy link
Member Author

Maybe refactor HexDump first, and then we continue from that?

@AppVeyorBot
Copy link

Download x64dbg 1.0.1726 (commit f02671aeb3 by @torusrxxx)

@mrexodia
Copy link
Member

🥳 will give it a try ASAP!

@AppVeyorBot
Copy link

Download x64dbg 1.0.1867 (commit 40e9c822bf by @torusrxxx)

@AppVeyorBot
Copy link

Download x64dbg 1.0.1870 (commit a3a59e37b1 by @torusrxxx)

@torusrxxx
Copy link
Member Author

Xrefs dialog is added so you can quickly find out what accessed this memory location. Extremely easy and fast.

@AppVeyorBot
Copy link

Download x64dbg 1.0.1871 (commit b12e9ee114 by @torusrxxx)

@AppVeyorBot
Copy link

Download x64dbg 1.0.1873 (commit 0a1fb28928 by @torusrxxx)

@torusrxxx
Copy link
Member Author

This was waiting for review for a very long time. What do you think about this?

@x64dbg x64dbg deleted a comment from thug-shaker Jul 7, 2024
@mrexodia
Copy link
Member

mrexodia commented Jul 7, 2024

Yeah I've been busy recently, just got around to doing some x64dbg maintenance today. The changes look good to me, but I think the disabling functionality could be better.

For me the ideal user experience would be:

  • Disable the trace dump per default
  • Whenever the user triggers an action that requires it, build the dump
  • Allow enabling per default

This way no resources are consumed when it's not needed. But if you don't have time to implement this I will take a look at it later and we can just merge it as-is.

@torusrxxx
Copy link
Member Author

Ok, I'm going to improve that soon.

@AppVeyorBot
Copy link

Download x64dbg 1.0.1883 (commit 833ab6da54 by @torusrxxx)

@torusrxxx
Copy link
Member Author

I'm adding support for tab detaching in new tabbed trace view. Currently there's crashing with certain user action sequences.

@AppVeyorBot
Copy link

Download x64dbg 1.0.1887 (commit 45dc8108a2 by @torusrxxx)

@torusrxxx
Copy link
Member Author

Now the dump is disabled, and a "load dump" button appears there. Clicking on the button will load the dump view.
Searching will also load the dump view automatically. This makes future searches faster.
And #3390 is fixed. Now the user can go to a virtual address. If multiple executions of the same virtual address are found, the xrefs dialog is displayed. The search uses the dump index to find all the indices instantly.

@AppVeyorBot
Copy link

Download x64dbg 1.0.1889 (commit 8f89bb542c by @torusrxxx)

@AppVeyorBot
Copy link

Download x64dbg 1.0.1892 (commit 9b5ba2f485 by @torusrxxx)

@AppVeyorBot
Copy link

Download x64dbg 1.0.1893 (commit 4df0db215f by @torusrxxx)

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

Successfully merging this pull request may close these issues.

Stack and memory dump in trace browser
3 participants