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

Is there a way to executu multiple command or a script in conditional breakpoint? #3335

Open
ShadowZzj opened this issue Apr 10, 2024 · 3 comments
Labels
question The issue is a question.

Comments

@ShadowZzj
Copy link

When the breakpoint is hit, I want to do two things. bp eax and bp ebx. Is there a way to automatically do that? I have tried conditional breakpoint, but it seems only support one command. Also, I've tried the script way using scriptload, but it just load the script and will not execute it automatically. I need to switch to the script window and execute it manually

@mrexodia
Copy link
Member

There is no (working) way to invoke a script on a breakpoint right now. But for your thing specifically you can use a ; to separate commands. Note that this doesn't scale nicely, but a command like bp eax; bp ebx should work fine. Another possibility is to write a plugin that does as many commands as you like (possibly in C# using https://github.com/x64dbg/DotX64Dbg)

@mrexodia mrexodia added the question The issue is a question. label Apr 10, 2024
@justanotheranonymoususer
Copy link
Contributor

I just discovered the ; way, it's cool that it works but it's a pain in the ass to work with.
Best I could do is to have a script that runs SetBreakpointCommand, but with each change I need to do the following:

  • save script file
  • switch to script tab
  • reload script
  • pause debugged app
  • run script
  • resume app and go back to cpu tab

If I could do all of the above in one click it would be so much better! Maybe I need to script the script runner

@torusrxxx
Copy link
Member

Current breakpoint command just runs a few commands without changing x64dbg to a paused state first, therefore some commands, like "run", could not be used. x64dbg have to properly enter a paused state before starting executing script. This has a big performance penalty. I think we need a separate property for conditional breakpoint where you can specify a label in the script to execute, so x64dbg knows it need to use a slower and different approach to properly handle this. This also means if your script contains no "run" command in this section, then the debuggee will be left in paused state.

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

No branches or pull requests

4 participants