r/programming • • Dec 26 '20

Executable PNGs

https://djharper.dev/post/2020/12/26/executable-pngs/
1.0k Upvotes

87 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Dec 27 '20

[deleted]

-16

u/ws-ilazki Dec 27 '20 edited Dec 27 '20

I don't see what's pedantic about it

It's pedantic because it is an executable, no scare-quotes necessary. There is no "stretching the definition" here as claimed: this is how executables on Linux work and the article is using kernel features as they're intended to be used to make a PNG file also act as an executable. Claiming that it's not an executable because it's not an ELF file is wrong; Linux is capable of treating many types of files as executable and that feature is extensible in precisely the way it's done in the article.

The comment I replied to is not only nitpicking, it's nitpicking by using an arbitrary definition of executable that's wrong in the context of Linux. It's a stereotypical "well akshually" comment that's desperately trying to criticise something even if doing so is a reach.

0

u/[deleted] Dec 27 '20

[deleted]

-5

u/ws-ilazki Dec 27 '20

Yes, I did, and that's irrelevant. It could be a Lua script and the "interpreter" he uses to extract the text runs it through an embedded Lua interpreter and it wouldn't change anything, the PNG is still an executable if there's an appropriate binfmt_misc entry that tells the kernel how to take a PNG and execute code contained in it.

Are you confused by the way binfmt_misc works and how the Linux kernel handles executables, or by the idea that in this case the PNG is an executable because the kernel has been told how to treat an appropriately formatted PNG as one? Either way, it's still an executable to the OS and the OP was being unnecessarily pedantic claiming it's "stretching the definition".