this post was submitted on 27 May 2025
656 points (99.4% liked)

Programmer Humor

23530 readers
1741 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] pooberbee@lemmy.ml 50 points 2 days ago (2 children)
[–] HiddenLayer555@lemmy.ml 39 points 2 days ago (2 children)

When you write code for a "runtime" that wasn't intended to run your code.

https://www.youtube.com/watch?v=8Dcj19KGKWM

[–] pooberbee@lemmy.ml 33 points 2 days ago (1 children)

Seems like not a real programming paradigm, and I don't mean in a No True Scotsman way. It really is in a separate category of thing. Could've said logic programming or stack-oriented programming.

[–] HiddenLayer555@lemmy.ml 8 points 2 days ago* (last edited 2 days ago) (2 children)

Yeah fair enough now that I think more about it. IDK I just find the concept really cool so I included it.

[–] barsoap@lemm.ee 7 points 2 days ago

It's fine memes are permitted to make jokes and it's more of a paradigm than vibe coding.

The one paradigm that's actually missing is logic programming, I would've gotten rid of unstructured to include it. The whole paradigm thing really only started with Dijkstra's rant about unstructured gotos (not the ones C has, in C you can't jump to the middle of another function).

[–] Aatube@kbin.melroy.org 8 points 2 days ago (1 children)

you could've had declarative (e.g. ReactJS, Jetpack Compose) lol

[–] abbadon420@lemm.ee 1 points 2 days ago
[–] Speiser0@feddit.org 13 points 2 days ago

When you write code for a “runtime” that wasn’t intended to run your code.

That definition would be too broad, as includes any type of exploit.

In ROP, you modify the stack to write return addresses and then return to jump to the first of these addresses, the return addresses go to parts of the executable that end with a return instruction (gadgets), so it will always return to the next of your return address.

(That video is maybe not the easiest introduction to ROP.)

Having ROP in here as normal programming paradigm, as opposed to vibe coding, made the meme so much better.

[–] TheKMAP@lemmynsfw.com 1 points 1 day ago* (last edited 1 day ago)

Do you know what a memory stack and assembly are?

If you want code that does assembly operations A, B, and then C, you might be able to accomplish it by scanning loaded memory (or its corresponding binary) for bits that, when translated into assembly, do:

A

D

return

This set of three instructions is a gadget. In practice, it's a location in memory.

And then you find another gadget.

B

C

return

Then, if you don't care about D, or D does something irrelevant that won't screw up what you're trying to do, or won't crash the program, you can replace the stack with the addresses of gadgets one and two. When gadget one returns, the stack is popped and then gadget two executes.

Since the computer did ADBC and D was irrelevant, the system executed your ABC malware and now you win.

Is finding gadgets that execute actual malware hard? Surprisingly not!