From 3f1b2fcccbfaf0c42b934f61e4cd30c2f32e7d7f Mon Sep 17 00:00:00 2001 From: tinyAdapter Date: Fri, 1 Feb 2019 22:18:07 +0800 Subject: [PATCH] repair stdout flush issue (#85) --- GUI/host/cli.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GUI/host/cli.cpp b/GUI/host/cli.cpp index 8b4dd86..c672b7e 100644 --- a/GUI/host/cli.cpp +++ b/GUI/host/cli.cpp @@ -9,9 +9,11 @@ int main() _setmode(_fileno(stdout), _O_U16TEXT); _setmode(_fileno(stdin), _O_U16TEXT); wprintf_s(L"Usage: {'attach'|'detach'|hookcode} -Pprocessid\n"); + fflush(stdout); Host::Start([](auto) {}, [](auto) {}, [](auto) {}, [](auto) {}, [](TextThread* thread, std::wstring& output) { wprintf_s(L"[%I64X:%I32X:%I64X:%I64X:%I64X:%s] %s\n", thread->handle, thread->tp.processId, thread->tp.addr, thread->tp.ctx, thread->tp.ctx2, thread->name.c_str(), output.c_str()); + fflush(stdout); return false; }); wchar_t input[500] = {};