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

Feature - CheatEngine like search #103

Closed
disconnect3d opened this issue Aug 7, 2016 · 7 comments
Closed

Feature - CheatEngine like search #103

disconnect3d opened this issue Aug 7, 2016 · 7 comments
Labels
enhancement For enhancements to existing features help wanted

Comments

@disconnect3d
Copy link
Member

disconnect3d commented Aug 7, 2016

Hey,

It would be cool to have a similar feature like CheatEngine provides - the possibility to re-search the addresses found in last search, for a given value.

There's also a plugin for that on https://github.com/ItayGarin/gdb-cheat-engine but imho we need something that is easier to use (like -n or --next flag in search command).

@zachriggle
Copy link
Contributor

Can you give me an example of how this feature would work when in use? I'm not familiar with the workflow for this.

@Grazfather
Copy link
Contributor

@disconnect3d Check out PINCE

@zachriggle: You'd need to maintain some bucket of addresses and their values at last search. Support a feature that allows filtering on the list by their current value. Ideally not sure on their current value, but with the option to filter on how they changed.

e.g.

  1. Find all 4byte dwords (regions, alignment, etc configurable) whose value is 0xcafebabe. Get this list and hold it.
  2. Next find all 4 byte dwords within that list whose new value is 0xdeadbeef
  3. Repeat 2 until this list is small enough that I can guess which is the value I want.

Ideally instead of just searching for values that were 0xcafebabe and changed to 0xdeadbeef, you could do something like find values that were 0xcafebabe and changed since last search, or didn't, or increased.

My manipulating a known value (e.g. your health in the context of a game) this search helps you narrow down where its stored in memory

I suggest you play with Cheat Engine for a bit if you're interested in understanding the features.

@disconnect3d
Copy link
Member Author

disconnect3d commented Aug 25, 2016

@Grazfather Thanks for the link and explanation.

I didn't forget about the issue and the feature is quite simple to implement, however we will have to agree on the command interface.
I will post a prototype of this soon. @zachriggle you can assign me to it.

@zachriggle zachriggle added help wanted enhancement For enhancements to existing features labels Sep 7, 2016
zachriggle added a commit that referenced this issue Sep 13, 2016
zachriggle added a commit that referenced this issue Sep 13, 2016
@disconnect3d
Copy link
Member Author

disconnect3d commented Sep 20, 2016

@zachriggle I see you have started working on the issue.

I am not sure whether we need the --save argument. Imho the search results could be saved each time a search is done and if -n or --next is passed, only the "last found addresses" should be searched.

I am attaching a git patch I have made like a month ago. I haven't added it earlier because I didn't really like the global variable solution, however, probably that's the easiest way to have the results saved.
(Also the patch fails to apply right now)

search.patch.txt

PS: I had to change the extension from .patch to .txt since github doesn't support that.

@Grazfather
Copy link
Contributor

@zachriggle cool thanks for that.

@zachriggle
Copy link
Contributor

For @disconnect3d, I also added a config option.

pwndbg> config
Name                   Value (Def)    Documentation
---------------------------------------------------
auto-save-search       False          automatically pass --save to "search" command
...

@disconnect3d
Copy link
Member Author

@zachriggle That's exactly what I wanted to ask for like 5 minutes ago.
Cool! Thanks :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement For enhancements to existing features help wanted
Development

No branches or pull requests

3 participants