[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference noted::hackers_v1

Title:-={ H A C K E R S }=-
Notice:Write locked - see NOTED::HACKERS
Moderator:DIEHRD::MORRIS
Created:Thu Feb 20 1986
Last Modified:Mon Aug 03 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:680
Total number of notes:5456

231.0. "The smallest VAX worm?" by EAGLE1::LEONARD () Mon Apr 14 1986 09:50

;
; WORM - a program that copies itself through memory.
;
; This one has the features that:
;
; 1. It's a legal VAX worm.  That is, it follows the rules in the VAX 
;    architecture specification.  In particular, it flushes the IB (by 
;    executing REI) after writing memory and before executing it.
; 2. The code is five bytes long.
; 3. If started at one end of memory (the high end) it will go all the way to
;    the other end without tripping over anything (like its stack, or an SCB).
; 4. There are no in-memory data structures.
;
; It has the non-features that:
;
; 1. It makes a copy only every eight bytes, not every five.
; 2. It uses four registers besides SP and PC.  (All legal VAX worms use SP and
;    PC.)
;

setup:	.word	0
	movpsl	r0			; Put a usable PSL in r0.
	movq	worm, r1		; Put a copy of the worm in r1 and r2.
	movl	sp, r3			; Put new worm's address + 8 into r3.

worm:	pushr	#^m<r0, r1, r2>		; Push the worm (in eight bytes), then
					; the PSL, onto the stack.
	pushaq	-(r3)			; Decrement r3 to point to the new
					; worm's start, then push that address.
	rei				; Start the new worm.

.end	setup
T.RTitleUserPersonal
Name
DateLines
231.1EAGLE1::LEONARDMon Apr 14 1986 13:182
    I'm disregarding the possibility of running MOV -(PC), -(PC) in
    PDP-11 compatibility mode as untrue to the spirit of the venture.