, , .
: , . , . . , .
, MS-DOS .
() , , - . , . , (), .
. . ( ) , , . , .
( ) ( auto C/C++): . ( , , ), , , . , , , .
|
|
. , . ( ):
is_active DB 0;-
Int_Handler PROC FAR
cmp cs:is_active, 0;
jz work
iret;
work:
inc cs:is_active;
;
inc cs:is_active;
Int_Handler ENDP
() , . , . x86 xchg , , . , IF, .
. . () , , , . () , , , ; , . , .
, .
: . BIOS , ( ). DOS .
DOS int 21h. , . .
InDOS ( DOS) CriticalError ( ). InDOS int 21h AH = 34h ( ), CriticalError int 21h AX = 6D06h. . DOS InDOS . CriticalError InDOS.
|
|
int 28h , DOS -. int 28h DOS 0Ch .
: DOS .
, DOS . , -. .
, DOS , , . PSP, , DOS, PSP ( AH = 62h) ( AH = 50h), .
, . :
, , , (, , , );
/ , ;
, .
:
( ), , ;
, / ;
/ .
, , ( ) int 2Fh.
int 2Fh. . , . int 2Fh: , , . , , .
, . : () . MS‑DOS .
. , , , , , , . , :
|
|
old_handler_off DW?
old_handler_seg DW?
is_enabled DB?
Int_Handler PROC FAR
cmp cs:is_enabled, 0
jnz work
iret
work:
;
Int_Handler ENDP
, .
, ( ):
act_handler_off DW?
act_handler_seg DW?
old_handler_off DW?
old_handler_seg DW?
;
Int_Handler PROC FAR
jmp dword ptr cs:act_handler_off
Int_Handler ENDP
;
Handler_Work PROC FAR
call dword ptr cs:old_handler_off
Handler_Work ENDP
act_handler Handler_Work . , , , .
, . int 21h AH = 4Ch. DOS , PSP PSP . .
. , , : .
, . , , , , , : , . . .
1) .
2) .
3) .
4) .
5) .
6) DOS.
. ( 20 .) spy.txt. .
DOS . DOS. ( , ). ( ).
6
Windows Win 32 API
:
1) Windows ;
2) Win 32 API Window Messages , , ;
3) ;
4) .