It seems that you can change the command line arguments using the File menu. But there is no way to do something similar to change the starting directory.
So far, the only way I found to change the starting directory was to restart X64dbg from the command line, explicitly passing in the command line and startup directory parameters.
So is there a way to simply add a second text box to the "Change Command Line" dialog box to specify the initial directory?
Using the "chd" command in the debugger does not affect the startup directory for the debugged application.
The text was updated successfully, but these errors were encountered:
This came up in a discussion a while back too. There are currently two ways:
Use x96dbg.exe (the launcher) to start your application from the directory you want
This has the issue of not remembering the working directory on restart
Use the init command to specify the command line and working directory. This won't remember the working directory on restart either, but at least you can favorite the command.
I think it's a good idea to add functionality to change the working directory (similar to the command line), and then also handle saving the working directory in a similar way.
Hi @mrexodia I am planning on attempting to implement this feature, below is the description of the possibility I am thinking:
Add an action to change the initial directory to file menu.
Get the absolute path from the user, which should be set as current folder.
Set the current folder using current folder member in INIT_STRUCT using dbgcreatedebugthread.
When using the run action or restart as admin, we will use this path to pass to ShellExecuteW() function as current working directory.
I didn't get the last part "saving the working directory". Can you please explain it and please let me know what you think of my approach. And also if possible can you assign this issue to me.
The option changes the command line while the process is running (by modifying the UNICODE_STRING in the PEB). This is a bit more flexible and it makes it so you don’t have to worry about the CreateProcess call used to start the debuggee.
Perhaps you can start by implementing a command that sets the working directory, the GUI should only be a few lines from there.
Feature type
Quality of life
Describe the feature
It seems that you can change the command line arguments using the File menu. But there is no way to do something similar to change the starting directory.
So far, the only way I found to change the starting directory was to restart X64dbg from the command line, explicitly passing in the command line and startup directory parameters.
So is there a way to simply add a second text box to the "Change Command Line" dialog box to specify the initial directory?
Using the "chd" command in the debugger does not affect the startup directory for the debugged application.
The text was updated successfully, but these errors were encountered: