From 77d070fe7384bfb0c6dece81e4900e603b13ee6c Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sat, 24 Sep 2016 23:36:13 +0200 Subject: Windows Bootloader: for MBR bootloader, reset position pointers to keystroke buffer after password or PIM is entered to avoid leaking length information --- src/Boot/Windows/BootConsoleIo.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Boot') diff --git a/src/Boot/Windows/BootConsoleIo.cpp b/src/Boot/Windows/BootConsoleIo.cpp index 2fee84fc..60305ea1 100644 --- a/src/Boot/Windows/BootConsoleIo.cpp +++ b/src/Boot/Windows/BootConsoleIo.cpp @@ -299,6 +299,12 @@ void ClearBiosKeystrokeBuffer () mov cx, 32 cld rep stosb + + // reset position pointers at 0x41A and 0x41C to the begining + // of keyboard buffer to avoid revealing password/PIM length + mov ax, 0x001e + mov es:[0x41a], ax + mov es:[0x41c], ax pop es } } -- cgit v1.2.3