Skip to content

Commit

Permalink
Added quotation mark check in files::pathFromWindows (#77)
Browse files Browse the repository at this point in the history
* Added quotation mark check in files::pathFromWindows

* Moved quotation mark logic to createprocess argument processing code
  • Loading branch information
Exant64 authored Jul 23, 2024
1 parent 701134e commit bcc6eae
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions dll/kernel32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,20 @@ namespace kernel32 {
// to prevent from doubling up on the target executable name
// (it appears as lpApplicationName, and as the first token in lpCommandLine)
arg = strtok(NULL, " ");

if (arg) {
// Trim all quotation marks from the start and the end of the string
while(*arg == '\"') {
arg++;
}

char* end = arg + strlen(arg) - 1;
while(end > arg && *end == '\"') {
*end = '\0';
end--;
}
}

argv[current_arg_index++] = arg;
}

Expand Down

0 comments on commit bcc6eae

Please sign in to comment.