Presentation is loading. Please wait.

Presentation is loading. Please wait.

Another Example: #include<BIOS.H> #include<DOS.H>

Similar presentations


Presentation on theme: "Another Example: #include<BIOS.H> #include<DOS.H>"— Presentation transcript:

1 Another Example: #include<BIOS.H> #include<DOS.H>
char st[80] ={"Hello World$"}; char st1[80] ={"Hello Students!$"}; void interrupt (*oldint65)( ); void interrupt newint65( ); void main() { oldint65 = getvect(0x65); setvect(0x65, newint65); keep(0, 1000); }

2 Continued: void interrupt newint65( ) { if (( _AH ) = = 0) _AH = 0x09;
_DX = (unsigned int) st; geninterrupt (0x21); } else if (( _AH ) = = 1) _DX = (unsigned int) st1;

3 #include<BIOS.H> #include<DOS.H> void main() {
2nd Program: #include<BIOS.H> #include<DOS.H> void main() { _AH = 1; geninterrupt (0x65); _AH = 0; }

4 Interrupt Interception Hooks/Stealing

5 Execution Interrupted
ISR Perform I/O Normal Execution of Interrupt

6 New Routine Original Routine Interrupt Interception

7 Original Routine New Routine Other form of Interrupt Interception

8 void Interrupt newint();
void Interrupt (*old)(); void main() { old=getvect(0x08); Setvect(0x08,newint); Keep(0,1000); } void interrupt newint () (*old)();

9 Timer Interrupt

10 Hardware Interrupts Invoked by Means of Hardware Approximately occurs 18.2 times per second

11 BIOS Data Area 0040:0000

12 Keyboard Status Word 7 6 5 4 3 2 1 40:17H Insert key Caps Lock Key
40:17H Insert key Caps Lock Key Num Lock key Scroll lock key Right Shift key Left Shift Key Ctrl Key Alt Key Keyboard Status Word

13 #include <dos.h>
void Interrupt (*old)(); void Interrupt new(); Char far *scr=(char far* ) 0x ; Void main() { old=getvect(0x08); Setvect(0x08,new); Keep(0,1000); } Void interrupt new (){ *scr=64; (*old)();

14 New Routine Original Routine Interrupt Interception

15 Memory Mapped Isolated I/O

16 Isolated I/O M P I/O IN OUT

17 Memory Mapped I/O MOV M I/O P MOV

18 Memory Mapped I/O ON Monitor
B8OO:0002 B8OO:0003 B8OO:0000 B8OO:0001 Low Byte = ASCII CODE High Byte =Attribute Byte

19 Memory Mapped I/O ON Monitor
fore color X Blink Back Color Color Bold 000 Black 100 Red 010 Green 001 Blue 111 White Low Byte = Ascii Code High Byte = Attribute Byte

20 unsigned int far *scr=0xb8000000;
void main() { (*scr)=0x0756; (*(scr+1))=0x7055; }


Download ppt "Another Example: #include<BIOS.H> #include<DOS.H>"

Similar presentations


Ads by Google