PATH:
opt
/
bitninja-threat-hunting
/
node_modules
/
node-pty
/
deps
/
winpty
/
misc
/* * This test demonstrates that putting a console into selection mode does not * block the low-level console APIs, even though it blocks WriteFile. */ #define _WIN32_WINNT 0x0501 #include "../src/shared/DebugClient.cc" #include <windows.h> #include <stdio.h> const int SC_CONSOLE_MARK = 0xFFF2; CALLBACK DWORD writerThread(void*) { CHAR_INFO xChar, fillChar; memset(&xChar, 0, sizeof(xChar)); xChar.Char.AsciiChar = 'X'; xChar.Attributes = 7; memset(&fillChar, 0, sizeof(fillChar)); fillChar.Char.AsciiChar = ' '; fillChar.Attributes = 7; COORD oneCoord = { 1, 1 }; COORD zeroCoord = { 0, 0 }; while (true) { SMALL_RECT writeRegion = { 5, 5, 5, 5 }; WriteConsoleOutput(GetStdHandle(STD_OUTPUT_HANDLE), &xChar, oneCoord, zeroCoord, &writeRegion); Sleep(500); SMALL_RECT scrollRect = { 1, 1, 20, 20 }; COORD destCoord = { 0, 0 }; ScrollConsoleScreenBuffer(GetStdHandle(STD_OUTPUT_HANDLE), &scrollRect, NULL, destCoord, &fillChar); } } int main() { CreateThread(NULL, 0, writerThread, NULL, 0, NULL); trace("marking console"); HWND hwnd = GetConsoleWindow(); PostMessage(hwnd, WM_SYSCOMMAND, SC_CONSOLE_MARK, 0); Sleep(2000); trace("reading output"); CHAR_INFO buf[1]; COORD bufSize = { 1, 1 }; COORD zeroCoord = { 0, 0 }; SMALL_RECT readRect = { 0, 0, 0, 0 }; ReadConsoleOutput(GetStdHandle(STD_OUTPUT_HANDLE), buf, bufSize, zeroCoord, &readRect); trace("done reading output"); Sleep(2000); PostMessage(hwnd, WM_CHAR, 27, 0x00010001); Sleep(1100); return 0; }
[-] DebugServer.py
[edit]
[+]
Font-Report-June2016
[-] Win32Echo1.cc
[edit]
[-] font-notes.txt
[edit]
[-] ShowArgv.cc
[edit]
[-] SetCursorPos.cc
[edit]
[-] UnicodeDoubleWidthTest.cc
[edit]
[-] SetBufferSize.cc
[edit]
[-] GetFont.cc
[edit]
[-] FreezePerfTest.cc
[edit]
[-] color-test.sh
[edit]
[+]
..
[-] ShowConsoleInput.cc
[edit]
[-] MouseInputNotes.txt
[edit]
[-] DebugClient.py
[edit]
[-] ScreenBufferTest2.cc
[edit]
[-] Win10WrapTest1.cc
[edit]
[-] VeryLargeRead.cc
[edit]
[-] FormatChar.h
[edit]
[-] ChangeScreenBuffer.cc
[edit]
[-] IdentifyConsoleWindow.ps1
[edit]
[-] DumpLines.py
[edit]
[-] EnableExtendedFlags.txt
[edit]
[-] TestUtil.cc
[edit]
[-] MoveConsoleWindow.cc
[edit]
[-] ClearConsole.cc
[edit]
[-] IsNewConsole.cc
[edit]
[-] ConoutMode.cc
[edit]
[-] SetWindowRect.cc
[edit]
[-] ConinMode.cc
[edit]
[-] WindowsBugCrashReader.cc
[edit]
[-] WriteConsole.cc
[edit]
[-] UnicodeWideTest1.cc
[edit]
[-] Notes.txt
[edit]
[-] Win32Test2.cc
[edit]
[-] ScreenBufferFreezeInactive.cc
[edit]
[-] GetConsolePos.cc
[edit]
[-] VkEscapeTest.cc
[edit]
[-] Win32Test1.cc
[edit]
[-] winbug-15048.cc
[edit]
[-] Win32Write1.cc
[edit]
[-] ScreenBufferTest.cc
[edit]
[-] OSVersion.cc
[edit]
[-] BufferResizeTests.cc
[edit]
[-] Spew.py
[edit]
[-] build32.sh
[edit]
[-] build64.sh
[edit]
[-] SetFont.cc
[edit]
[-] SelectAllTest.cc
[edit]
[-] UnixEcho.cc
[edit]
[-] ConinMode.ps1
[edit]
[-] Utf16Echo.cc
[edit]
[-] UnicodeWideTest2.cc
[edit]
[-] FontSurvey.cc
[edit]
[-] GetCh.cc
[edit]
[-] Win10WrapTest2.cc
[edit]
[-] Win32Echo2.cc
[edit]
[-] Win32Test3.cc
[edit]
[-] Win10ResizeWhileFrozen.cc
[edit]