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

path in the breakpoint expression no working #3256

Open
lies2020 opened this issue Oct 28, 2023 · 4 comments
Open

path in the breakpoint expression no working #3256

lies2020 opened this issue Oct 28, 2023 · 4 comments
Labels
bug The issue describes a bug. It does not mean the bug has been reproduced by a developer.

Comments

@lies2020
Copy link

lies2020 commented Oct 28, 2023

Operating System

Windows 10

x64dbg Version

Oct 29 2023

Describe the issue

when you edit the breakpoint,the back slash("\") in string is converted into an escape character("\\")
edit the breakpoint again, escape character("\\") is converted into "\\\\"

Steps to reproduce

  1. set breakpoints at <kernel32.dll.CreateFileW>, edit breakpoint, break condition: streq(utf16(arg(0)),"D:\FSViewer\FSIV02.fslang"}
  2. save, break condition become: streq(utf16(arg(0)),"D:\\FSViewer\\FSIV02.fslang"}
  3. Run debug, when reaching breakpoint, can not break and log show "Error when evaluating break condition."
  4. Edit breakpoint again, do nothing and save, break condition become: streq(utf16(arg(0)),"D:\\\\FSViewer\\\\FSIV02.fslang"}

Attachments

No response

@lies2020 lies2020 added the bug The issue describes a bug. It does not mean the bug has been reproduced by a developer. label Oct 28, 2023
@shocoman
Copy link
Contributor

Does anybody know a reason for escaping backslashes here? Except that they affect the quote character (").
It seems even before my last PR , which certainly exacerbated this problem, there was an issue when the Edit Breakpoint dialog would turn a normal expression like streq(utf8(AABBCCDD),"A\B\C") into an invalid one like streq(utf8(AABBCCDD),"A\\B\\C")

@mrexodia
Copy link
Member

Previously the \ just turned back into a \ after processing I think. It was an oversight that the quoting isn’t adjusted accordingly

@shocoman
Copy link
Contributor

Previously the \ just turned back into a \ after processing I think. It was an oversight that the quoting isn’t adjusted accordingly

It looks like Markdown ate some of your backslashes.

If currently those double backslashes stay unchanged in the interpreter (or wherever they go), would it be okay if this dialog simply did not escape \s?
I've also noticed that it's impossible to create a quoted string that would end with just \" (as two separate characters), because \" turns into ", \\" into \\, and \\\" into \\".

@mrexodia
Copy link
Member

Yeah there was a change recently in the command parser that likely caused this to become so problematic: #3217. The parser is meant for commands where it needs to kinda guess the 'intent' of the user. For example you do not want to have a user type InitDebug "C:\\my\\path\\blah.exe". As a result shortcuts are taken with the quoting, but these issues are compounding with the complex expressions that are possible for the breakpoints...

I'm not sure what the best solution is. Probably it would be some for of round-trip thing where a quoting function is exposed by the debugger. Then we can test if this actually works for all strings...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue describes a bug. It does not mean the bug has been reproduced by a developer.
Projects
None yet
Development

No branches or pull requests

3 participants