;.code Copyright GNU
; in FASM OK
;DATE 2020-9
org 100h
start:
jmp main
db 'dos'
pass dd 'ywxq'
aa db 0
bb db 0
v1 dw 0
main:
mov ax,cs
mov ds,ax
mov ax,0b800h
mov es,ax
mov ah,0
int 16h
int 20h
error_1:
exit_gnu:
int 20h
mov si,pass
mov al,[si]
;lea di,[buff]
mov di,buff1
scan_pass:
mov cx,0
scan_1:
mov al,[di]
; 读取密码字
mov bl,[si]
cmp al,bl
; 查找位置
je scanOk
inc di
add cx,1
cmp al,0
jne scan_1
; loop scan_1
scan_1_No:
add al,1
mov [es:di],al
mov al,'E'
mov [es:22*160],al
mov al,'r'
mov [es:22*162],al
mov al,'r'
mov [es:22*164],al
mov ax,1-1
jmp scan_1_end
scanOk:
mov [v1],cx
; 位置保存
mov di,cx
mov ax,cx
scan_1_end:
ret
int 20h
mov si,buff
mov di,20*160
mov cx,80
mov al,'A'
mov [es:di],al
print_:
;push di
cmp ah,09
je print_end
mov cx,80
print_gnu:
mov al,[si]
mov [es:di],al
inc si
add di,2
loop print_gnu
print_end:
;pop di
ret
pass_:
lea si,[buff1]
lea di,[buff2]
mov ax,[v1]
;读取密码字位置
add si,ax
mov cx,ax
pass_gnu_1:
; cmp cx,28
; je pas_2
pas_2:
;将密码字起的右边全部字移到左边
mov al,[si]
mov [di],al
inc si
inc di
inc cx
cmp cx,28
jne pass_gnu_1
mov cx,[v1]
sub di,2
mov si,buff1
add cx,si
pass_gnu_2:
; 将剩下的移动到右边
mov al,[si]
mov [di],al
inc si
inc di
cmp si,cx
jne pass_gnu_2
ret
pass_to:
lea si,[buff2]
lea di,[buff3]
mov ax,[v1]
; 读取密码字反位置
mov cx,26
sub cx,ax
mov [v1],cx
; 读取密码字正位置
add si,cx
pass_to_1:
; 将头文移回密码字右边
; cmp cx,28
; je pass_to_2
pass_to_2:
mov al,[si]
mov [di],al
inc si
inc di
inc cx
cmp cx,28
jne pass_to_1
mov cx,[v1]
sub di,2
mov si,buff2
add cx,si
pass_to_3:
; 将剩下的移回左边
mov al,[si]
mov [di],al
inc si
inc di
cmp si,cx
jne pass_to_3
ret
pas3_:
mov si,buff2
;mov di,[buff3]
pas3_1:
mov cx,26
pas3_2:
mov al,[si]
inc si
mov bl,[si]
mov [si],al
dec si
mov [si],bl
add si,2
loop pas3_2
ret
pas13_:
mov si,buff2
mov cx,26
pas13_1:
mov al,[si]
inc si
mov bl,[si]
inc si
mov dl,[si]
mov [si],al
dec si
mov [si],bl
dec si
mov [si],dl
add si,3
cmp si,0ffffh
jg pas13_1
;loop pas13_1
ret
buff dw 0
buff1 db 'abcdefghijklnmopqrstuvwxyz',0
buff2 db '1234567 ',0
buff3 db ' ',0
阅读(1477) | 评论(0) | 转发(0) |