Source Code:
.MODEL SMALL
.CODE
START:
original_header DB 32 DUP(0)
fsize1 dw ?
fsize2 dw ?
db 0
O_SS DW ?
O_SP DW ?
O_IP DW ?
O_CS DW ?
LENCX DW ?
LENDX DW ?
handle dw ?
ACTION:
;
;disable critical error
;
mov dx,offset cs:newint24
mov ah,25h
mov al,24h
int 21h
mov ah,62h
int 21h
mov ds,bx
mov ax,word ptr ds:[02ch]
mov ds,ax
mov si,0
seek1:
inc si
mov al,ds:[si]
cmp al,0
jne seek1
inc si
mov aL,ds:[si]
cmp al,0
jne seek1
add si,3
;
;open file
;
mov dx,si
mov ah,3dh
mov al,2
int 21h
mov cs:handle,ax
mov ah,42h
mov al,0
mov bx,cs:handle
mov cx,0
mov dx,2
int 21h
mov ah,3fh
mov bx,cs:handle
mov cx,4
lea dx,cs:fsize1
int 21h
mov si,offset cs:original_header
mov ax,[si+3]
cmp ax,cs:fsize1
jne recover
mov ax,[si+5]
cmp ax,cs:fsize1
jne recover
jmp close
;
;write original header to file
;
recover:
mov ax,cs
mov ds,ax
mov ah,40h
mov bx,cs:handle
mov cx,32
lea dx,cs:original_header
int 21h
;
;write to file bottom
;
mov ah,42h
mov al,0
mov cx,cs:lencx
mov dx,cs:lendx
mov bx,cs:handle
int 21h
mov ah,40h
mov bx,cs:handle
mov cx,0
int 21h
;
;close file
;
close: mov ah,3eh
mov bx,cs:handle
int 21h
;
;execute original file
;
mov ah,62h
int 21h
mov ax,cs:o_cs
add ax,bx
add ax,010h
mov cs:o_cs,ax
jmp dword ptr cs:o_ip
db 'EXE Protector Written by Plus
Lin'
newint24:
mov al,0
iret
END START
END