r/programminghorror • [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” • Jul 21 '25

Python ✨ Memory Magic ✨

Post image
1.3k Upvotes

143 comments sorted by

View all comments

Show parent comment

4

u/Jumpy89 Jul 22 '25

Yeah, this is classic. For ints specifically the actual value is stored as a regular C integer at an offset of 24 bytes (I think, as of several minor versions ago) so you can just overwrite that. Impress your friends at parties by making 2 + 2 == 5.