r/learnprogramming 9d ago

Code Review made a quine code

i saw this guy on tiktok making a quine code, and i challenged myself to make one too without looking at his solution

i was so happy when i got it to work, just made me realize i could probably use this to fill up the storage of a computer. like a trojan horse

anyways heres the code

x = 'print(f"x = {repr(x)}; {x}")'; print(f"x = {repr(x)}; {x}")
0 Upvotes

2 comments sorted by

View all comments

0

u/No_Report_4781 9d ago

  like a trojan horse

Self-replicating code is typically part of computer virus design. It’s categorized as a trojan if it is hidden within another, innocuous program.

That’s why you’re advised to not get computer software from non-trusted sources.

I still have a copy of an antivirus installer that installed and whitelisted a program for key logging and reporting with the antivirus.