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

Fixed command-line parsing for arguments in GUI application, Added ability to specify execution working directory #2

Merged
merged 2 commits into from
Dec 23, 2022

Conversation

alphillips-lab
Copy link
Contributor

This is a really simple fix, but I ran into an issue that caused the GM utility to crash when trying to use it to execute programs from within the GUI when the program arguments start with a dash ("-"). It is because of an outstanding issue attached to the CommandLine dependency. #690

It doesn't seem like this is going to be merged over there any time soon, so the work-around is to use the equals ("=") operator so the dependency can parse it properly.

@alphillips-lab alphillips-lab changed the title Fixed command-line parsing for arguments in GUI application Fixed command-line parsing for arguments in GUI application, Added ability to specify execution working directory Dec 22, 2022
@alphillips-lab
Copy link
Contributor Author

I also created another argument in both the GM utility and GUI that should allow the user to specify the working directory of the program being executed via the StartInfo options. I am proposing to add this specifically for the use case of dumping a DLL via a proxy DLL Loader such as SharpDllLoader. I found this to be useful when dealing with DLLs that reference relative paths.

It is an optional argument, so if the user does not specify a path, then the default will be according to the MS documentation: https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.workingdirectory?view=net-7.0#system-diagnostics-processstartinfo-workingdirectory

@turkja turkja merged commit be40ac5 into WithSecureLabs:master Dec 23, 2022
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.

2 participants