var s:string='var s:string=;begin insert(#39+s+#39,s,14);write(s)end.';begin insert(#39+s+#39,s,14);write(s)end.
program MyProgram; begin write('Hello, world'); end.
D:\FPC\2.6.4\bin\i386-win32\data2inc.exe -B -A myProg.pp myProg.inc MyArray
const MyArray : array[1..407] of byte=( $2F,$2F,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D, $2D,$2D,$2D,$2D,$2D,$2D,$2D,$0D,$0A,$2F,$2F,$20,$80,$A2,$E2, $AE,$E0,$3A,$20,$49,$76,$61,$6E,$54,$61,$6D,$65,$72,$6C,$61, $6E,$0D,$0A,$2F,$2F,$20,$76,$6B,$2E,$63,$6F,$6D,$2F,$49,$76, $61,$6E,$54,$61,$6D,$65,$72,$6C,$61,$6E,$0D,$0A,$2F,$2F,$2D, $2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D, $2D,$2D,$2D,$2D,$0D,$0A,$70,$72,$6F,$67,$72,$61,$6D,$20,$4D, $79,$51,$75,$69,$6E,$65,$3B,$0D,$0A,$7B,$24,$6D,$6F,$64,$65, $20,$6F,$62,$6A,$66,$70,$63,$7D,$0D,$0A,$76,$61,$72,$20,$69, $3A,$20,$69,$6E,$74,$65,$67,$65,$72,$3B,$0D,$0A,$20,$20,$20, $20,$73,$31,$2C,$20,$73,$32,$3A,$20,$50,$43,$68,$61,$72,$3B, $0D,$0A,$0D,$0A,$66,$75,$6E,$63,$74,$69,$6F,$6E,$20,$4D,$79, $46,$75,$6E,$63,$53,$75,$6D,$28,$61,$2C,$62,$3A,$69,$6E,$74, $65,$67,$65,$72,$29,$3A,$69,$6E,$74,$65,$67,$65,$72,$3B,$0D, $0A,$62,$65,$67,$69,$6E,$0D,$0A,$20,$72,$65,$73,$75,$6C,$74, $3A,$3D,$61,$2B,$62,$3B,$0D,$0A,$65,$6E,$64,$3B,$0D,$0A,$0D, $0A,$62,$65,$67,$69,$6E,$0D,$0A,$20,$69,$3A,$3D,$20,$4D,$79, $46,$75,$6E,$63,$53,$75,$6D,$28,$31,$31,$32,$2C,$31,$30,$30, $35,$30,$30,$29,$3B,$20,$2F,$2F,$20,$AA,$A0,$AA,$A0,$EF,$2D, $E2,$AE,$20,$E4,$E3,$AD,$AA,$E6,$A8,$EF,$2E,$0D,$0A,$20,$73, $31,$3A,$3D,$27,$8A,$A0,$AF,$E0,$A0,$AB,$2C,$20,$AC,$EB,$20, $AF,$E0,$AE,$A8,$A3,$E0,$A0,$AB,$A8,$21,$27,$3B,$0D,$0A,$20, $73,$32,$3A,$3D,$27,$20,$AD,$A0,$AC,$20,$AD,$A5,$20,$E3,$A4, $A0,$AB,$AE,$E1,$EC,$20,$AE,$E2,$AF,$E0,$A0,$A2,$A8,$E2,$EC, $20,$E8,$A8,$E4,$E0,$AE,$A2,$AA,$E3,$20,$AD,$A0,$20,$E5,$A0, $A1,$E0,$A5,$20,$3D,$28,$27,$3B,$0D,$0A,$20,$77,$72,$69,$74, $65,$6C,$6E,$28,$73,$31,$2C,$73,$32,$29,$3B,$0D,$0A,$65,$6E, $64,$2E);
//-------------------- // : IvanTamerlan //-------------------- program myQuine; {$mode objfpc} var i:integer; const N = 00407; K = 00407; MyArray : array[1..N] of byte = ( $2F,$2F,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D, $2D,$2D,$2D,$2D,$2D,$2D,$2D,$0D,$0A,$2F,$2F,$20,$80,$A2,$E2, $AE,$E0,$3A,$20,$49,$76,$61,$6E,$54,$61,$6D,$65,$72,$6C,$61, $6E,$0D,$0A,$2F,$2F,$20,$76,$6B,$2E,$63,$6F,$6D,$2F,$49,$76, $61,$6E,$54,$61,$6D,$65,$72,$6C,$61,$6E,$0D,$0A,$2F,$2F,$2D, $2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D,$2D, $2D,$2D,$2D,$2D,$0D,$0A,$70,$72,$6F,$67,$72,$61,$6D,$20,$4D, $79,$51,$75,$69,$6E,$65,$3B,$0D,$0A,$7B,$24,$6D,$6F,$64,$65, $20,$6F,$62,$6A,$66,$70,$63,$7D,$0D,$0A,$76,$61,$72,$20,$69, $3A,$20,$69,$6E,$74,$65,$67,$65,$72,$3B,$0D,$0A,$20,$20,$20, $20,$73,$31,$2C,$20,$73,$32,$3A,$20,$50,$43,$68,$61,$72,$3B, $0D,$0A,$0D,$0A,$66,$75,$6E,$63,$74,$69,$6F,$6E,$20,$4D,$79, $46,$75,$6E,$63,$53,$75,$6D,$28,$61,$2C,$62,$3A,$69,$6E,$74, $65,$67,$65,$72,$29,$3A,$69,$6E,$74,$65,$67,$65,$72,$3B,$0D, $0A,$62,$65,$67,$69,$6E,$0D,$0A,$20,$72,$65,$73,$75,$6C,$74, $3A,$3D,$61,$2B,$62,$3B,$0D,$0A,$65,$6E,$64,$3B,$0D,$0A,$0D, $0A,$62,$65,$67,$69,$6E,$0D,$0A,$20,$69,$3A,$3D,$20,$4D,$79, $46,$75,$6E,$63,$53,$75,$6D,$28,$31,$31,$32,$2C,$31,$30,$30, $35,$30,$30,$29,$3B,$20,$2F,$2F,$20,$AA,$A0,$AA,$A0,$EF,$2D, $E2,$AE,$20,$E4,$E3,$AD,$AA,$E6,$A8,$EF,$2E,$0D,$0A,$20,$73, $31,$3A,$3D,$27,$8A,$A0,$AF,$E0,$A0,$AB,$2C,$20,$AC,$EB,$20, $AF,$E0,$AE,$A8,$A3,$E0,$A0,$AB,$A8,$21,$27,$3B,$0D,$0A,$20, $73,$32,$3A,$3D,$27,$20,$AD,$A0,$AC,$20,$AD,$A5,$20,$E3,$A4, $A0,$AB,$AE,$E1,$EC,$20,$AE,$E2,$AF,$E0,$A0,$A2,$A8,$E2,$EC, $20,$E8,$A8,$E4,$E0,$AE,$A2,$AA,$E3,$20,$AD,$A0,$20,$E5,$A0, $A1,$E0,$A5,$20,$3D,$28,$27,$3B,$0D,$0A,$20,$77,$72,$69,$74, $65,$6C,$6E,$28,$73,$31,$2C,$73,$32,$29,$3B,$0D,$0A,$65,$6E, $64,$2E); MyHEX : array[0..15] of byte=( $30,$31,$32,$33,$34,$35,$36,$37, $38,$39,$41,$42,$43,$44,$45,$46); function ByteToHex (const b:byte):string; begin result := #$24 + char(MyHEX[b div 16]) + char(MyHEX[b mod 16]); end; begin for i:=1 to K do write(char(MyArray[i])); write(#$0D#$0A#$20#$20); for i:=1 to N do begin if ((i mod 10) = 0) then write(#$0D#$0A#$20#$20); write(ByteToHex(MyArray[i])); if i<N then write(', '); end; for i:=K + 1 to N do write(char(MyArray[i])); end.
Source: https://habr.com/ru/post/253653/
All Articles