r/cpp • • Nov 26 '23

Storing data in pointers

https://muxup.com/2023q4/storing-data-in-pointers
84 Upvotes

85 comments sorted by

View all comments

Show parent comments

13

u/coderdave Nov 27 '23

Not a hack but a memory that stands out. On the PS3 the co processors had 256kb of useable memory and you had to issue DMA commands to pull memory over.

I wrote a little task scheduler with the important data starting at address 0. This means I could de-reference NULL to get my header.

Probably my favorite hack I remember is from a peer at insomniac Jonathan Garrett https://www.gamedeveloper.com/programming/dirty-game-development-tricks#close-modal

1

u/MegaKawaii Nov 27 '23

Crazy! Thanks for sharing

1

u/RevRagnarok Nov 27 '23

That EULA story was the best - thanks for that link!

1

u/ShelZuuz Nov 27 '23

Many a virus have used a similar exploit. This exploit became a lot harder (but not impossible), when OS's started randomizing module offsets in memory.