home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Interdit
/
pc-interdit.iso
/
motpasse
/
pwmodul.asm
< prev
Wrap
Assembly Source File
|
1994-10-18
|
4KB
|
137 lines
.386p
.MODEL TPASCAL
keyb_off macro
push ax
in al,21h
or al,02
out 21h,al
pop ax
endm
keyb_on macro
push ax
in al,21h
and al,0Fdh
out 21h,al
pop ax
endm
.DATA
extrn iterations_restantes
extrn Pchoisir_nouveau_motdepasse : dword
extrn Pdessiner_cadre_de_saisie : dword
extrn Pdemander_motdepasse : dword
extrn Parreter_systeme : dword
extrn motdepasse_correct : byte
extrn variable_bidon1 : word
extrn variable_bidon2 : word
.CODE
extrn Main_Programm : far
public boucle_de_saisie
boucle_de_saisie proc pascal
keyb_off
;coup de la PIQ
int 3
mov cs:word ptr [@int_21_fonct1],4CB4h ; Fonction arrêter programme
@int_21_fonct1:
mov ah,30h ; fonction version de DOS
int 21h
@saisie_loop:
keyb_off
call dword ptr Pchoisir_nouveau_motdepasse
cmp variable_bidon1,5
jbe @destination_bidon1a
;coup de la PIQ
int 3
mov cs:word ptr [@int_21_fonct2],4CB4h ; fonction arrêter le programme
@int_21_fonct2:
mov ah,30h ; fonction version de DOS
int 21h
mov cs:word ptr [@int_21_fonct2],30B4h ; fonction arrêter le programme
call dword ptr Pdessiner_cadre_de_saisie
jmp @destination_bidon1b
@destination_bidon1a:
;coup de la PIQ
int 3
mov cs:word ptr [@int_21_fonct2],4CB4h ; fonction arrêter le programme
@int_21_fonct2a:
mov ah,30h ; fonction version de DOS
int 21h
mov cs:word ptr [@int_21_fonct2a],30B4h ; Fonction arrêter le programme
call dword ptr Pdessiner_cadre_de_saisie
@destination_bidon1b:
keyb_on
cmp variable_bidon2,10
jbe @destination_bidon2a
dec byte ptr iterations_restantes
; coup du mode protégé
pusha
cli ; désactive les interruptions
mov eax,cr0 ; passe dans le mode protégé
or eax,1
mov cr0,eax
jmp PROTECTION_ENABLED ; efface le canal d'exécution
PROTECTION_ENABLED:
and al,0FEh ; revient au mode réel
mov cr0,eax ; pas de raz du processeur
jmp PROTECTION_DISABLED ; efface le canal d'exécution
PROTECTION_DISABLED:
sti ;rétablit les interruptions
popa
call dword ptr Pdemander_motdepasse
jmp @destination_bidon2b
@destination_bidon2a:
dec byte ptr iterations_restantes
; coup du mode protégé
pusha
cli ; désactive les interruptions
mov eax,cr0 ; passe dans le mode protégé
or eax,1
mov cr0,eax
jmp PROTECTION_ENABLED2a ; efface le canal d'exécution
PROTECTION_ENABLED2a:
and al,0FEh ; rétablit le mode réel
mov cr0,eax ; pas de raz du processeur
jmp PROTECTION_DISABLED2a ; efface le canal d'exécution
PROTECTION_DISABLED2a:
sti ; restaure les interruptions
popa
call dword ptr Pdemander_motdepasse
@destination_bidon2b:
cmp byte ptr motdepasse_correct,1
je @demande_OK
jmp @demande_pas_OK
@demande_OK:
call Main_Programm
@demande_pas_OK:
cmp byte ptr iterations_restantes,54
ja @saisie_loop
call dword ptr Parreter_systeme
ret
boucle_de_saisie endp
END