📄 m_chandl.inc
字号:
; 屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯屯 COM FILE HANDLiNG
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪 exefile?
lea dx, FileName
mov ax, 3D02
int 21 ; open inputfile
jc Error
mov [FileHandle], ax
mov bx, [FileHandle]
mov cx, 2
mov dx, offset cexeheader
mov ax, 3f00
int 21 ; read inputfile for exe/com
jc Error
cmp word ptr [cexeheader], 'MZ'
je thru8
cmp word ptr [cexeheader], 'ZM'
je thru8
mov byte ptr [isexe],0
jmp thru12
thru8: mov byte ptr [isexe],1
mov bx,[FileHandle]
mov ah,3e ; close file again
int 21
mov byte ptr [whicherror],0
jmp handleexe ; exe file renamed as com file
thru12: mov word ptr [cexeheader], 'ZM'
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪 new mem segment
inc [whicherror]
mov ax,ds
add ax,1000 ; next 64 kB. typical for coms :)
mov bp,2
cmp [bp],ax
jb error
mov fs,ax
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪 filesize < 60000 bytes
inc [whicherror]
mov al, 02
mov bx, [FileHandle]
xor cx, cx
xor dx, dx
mov ah, 42
int 21 ; goto end of inputfile
jc error
mov [FileLength], ax
mov bx,0FFFF
sub bx,scramlength ; bx= max length comfile
cmp ax,bx
ja Error
cmp dx,0
jne Error
showstrc haakje1
mov ax, [FileLength]
showstrn
showstrc haakje2
mov ax,5700
mov bx,[FileHandle]
int 21
mov word ptr [Time],cx
mov word ptr [Date],dx ; get date/time
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪 backupfile
inc [whicherror]
lea dx, BakName
mov ax, 3C02
mov cx, 00100000b
int 21 ; create bakfile
jc Error
mov [BakHandle], ax
xor al,al
xor cx,cx
xor dx,dx
mov bx, [FileHandle]
mov ah, 42
int 21 ; goto start of inputfile
jc error
mov bx, [FileHandle]
mov cx, [FileLength]
push ds
push fs
pop ds
cbuffer equ 100 ; new buffer starts at ds+1000:100 !
mov dx, offset cbuffer
mov ax, 3f00
int 21 ; read inputfile for bakfile
pop ds
jc Error
mov bx, [BakHandle]
mov cx, [FileLength]
push ds
push fs
pop ds
mov dx, offset cbuffer
mov ax, 4000
int 21 ; write bakfile
pop ds
jc Error
mov bx, [BakHandle]
mov cx, word ptr [Time]
mov dx, word ptr [Date]
mov ax, 5701
int 21 ; restore date and time of outputfile
mov bx, [BakHandle]
mov ah, 3e
int 21 ; close bakfile
jc Error
showstrc WhatBackup
showstrz BakName
showstr crlf
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪 encryption
inc [whicherror]
mov ax, [FileLength] ; NOT odd!
and ax, 1
jz NoAddByte
mov ax, [FileLength]
inc ax
mov [FileLength], ax
NoAddByte: xor al, al
mov bx, [FileHandle]
xor cx, cx
xor dx, dx
mov ah, 42
int 21 ; goto begin
jc error
mov bx, [FileHandle]
mov cx, [FileLength]
push ds
push fs
pop ds
mov dx, offset cbuffer
add dx, scramlength
mov ax, 3f00
int 21 ; read inputfile for encryption
pop ds
jc Error
showstrc EncryptMsg ; length decryptor
mov ax, [scramlength]
showstrn
showstrc haakje2
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪 encrypt file + layers
call CryptBuffer
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪 write to disk
xor al, al
mov bx, [FileHandle]
xor cx, cx
xor dx, dx
mov ah, 42
int 21 ; goto begin
jc error
showstrc WriteMsg
cmp [becomeexe],1
jne thru26
; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -