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

Bug: Continuous '-c' Argument doesnt seem to be working #70

Open
TheJaysH opened this issue Jan 6, 2022 · 3 comments
Open

Bug: Continuous '-c' Argument doesnt seem to be working #70

TheJaysH opened this issue Jan 6, 2022 · 3 comments

Comments

@TheJaysH
Copy link

TheJaysH commented Jan 6, 2022

Hi,

Had great success with the project many times. However, I am using it in an automated manner and the -c argument isnt working as intended. Unfortunatly I am still getting the "Press any key to continue..." message. And thus the process waits for input before it closes.

Thank you for the project! Great work btw 👍

As a

User who uses the application in a programmatic fashion

I expect

The application to exit automatically when the -c argument is used

So that

I do not have to watch STDOUT to find out when the application has finished.

Arguments used:
UWPInjector.exe -c -p 1234 -d "C:\Folder"
UWPInjector.exe -p 1234 -d "C:\Folder" -c

@TheJaysH
Copy link
Author

TheJaysH commented Jan 6, 2022

just like to add this is upon a successful dump.

@Wunkolo
Copy link
Owner

Wunkolo commented Jan 6, 2022

Strange... All instances of the Press any key to continue...(called by system("pause")) should be guarded by the -c flag. Especially on a successful dump.

std::cout << "\033[0m" << std::flush;
std::wstring CurMessage;
CurMessage.reserve(IPC::MessageEntry::StringSize);
while( IPC::GetTargetThread() != IPC::InvalidThread )
{
while( IPC::PopMessage(CurMessage) )
{
std::wcout << CurMessage << "\033[0m";
if( Logging )
{
LogFile << CurMessage << std::flush;
}
}
}
if( Logging ) LogFile.close();
if( !Continuous ) {
// Open Tempstate folder for user
std::filesystem::path DumpFolderPath(LocalAppData);
DumpFolderPath = DumpFolderPath / "Packages" / PackageFileName / "TempState";
ShellExecuteW(
nullptr, L"open", DumpFolderPath.c_str(), nullptr, nullptr,
SW_SHOWDEFAULT
);
system("pause");
}
return EXIT_SUCCESS;
}

You say you see Press any key to continue... even after it has finished dumping? It should immediately exit if you haven't seen that message any time up to that point already either. Does it do this even when you call the above commands directly from the terminal?

@TheJaysH
Copy link
Author

TheJaysH commented Jan 9, 2022

I havent had chance to work on my project this week, so will do some more testing once i get chance. Thanks for looking into this for me 👍

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

No branches or pull requests

2 participants