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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
| name " mini_projet_22"
org 100h
data :
msg1 db 0Dh,0Ah, " programme va se fermer$"
msg2 db 0dh,0ah, "entrer A si votre choix est d'arreter le programme ou N sinon$"
msg3 db 0dh,0ah, "succes du detournement$"
OldInt20hOffset dw 0000h
OldInt20hSegment dw 0000h
code :
afficher_msg macro (msg1)
mov cx,5
ecrire:
mov dx, offset msg1
mov ah, 9
int 21h
loop ecrire
afficher_msg endm
routine_deroutement macro (msg2)
mov ah,9
mov dx,offset msg2
int 21h
mov ah,1
int 21h
cmp al,'a'
je fin
jne non_fin
fin:
fin_propre
non_fin:
afficher_msg msg1
fin_propre
routine_deroutement endm
redirect_int macro
mov ah, 35h
mov al, 20h
int 21h
mov OldInt20hOffset, bx
mov OldInt20hSegment, es
push ds
push cs
pop ds
mov ah, 25h
mov al, 20h
int 21h
push cs
pop ds
redirect_int endm
push ds
mov ah, 25h
mov al, 20h
mov dx,offsetnew_routine
int 21h
fin_propre macro (oldint20hoffset,oldint20hsegment)
mov ah, 25h
mov al, 20h
mov bx, OldInt20hOffset
mov es, OldInt20hSegment
int 20h
fin_prope endm
success_detournement macro (msg3)
mov ah,9
mov dx offset msg3
int 21h
success_detournement endm
new_routine macro
success_detournement msg3
routine_detournement msg2
new_routine endm
main proc
redirect_int |
Partager