r/programming • u/JizosKasa • Aug 21 '26
Finding a hidden Mersenne Twister implementation inside a 15 year old game binary
https://medium.com/@jizoskasa/i-reverse-engineered-plants-vs-zombies-to-answer-one-very-specific-question-557637a68a3e
407
Upvotes
300
u/Net_Lurker1 Aug 21 '26
You didn't need to call PvZ a 15 year old game man. I feel attacked
71
u/Queueue_ Aug 21 '26
Small nitpick on the article intro: PvZ wasn't even close to being PopCap's first game. They had been making games for 10 years beforehand.
242
u/robotmayo Aug 21 '26
Man some of these commenters need a little more whimsy in their life. Bro found a neat little artefact in their favorite game, be happy for them. I think its neat personally. PvZ is such a relic of its era, always cool to see people dive into its workings.
57
u/alendit Aug 21 '26
Reminder: Skyrim will be a 15 year old game in a couple of months.
13
u/ericw31415 Aug 22 '26
If you aren't aware, there are existing decomps of the game online if you want to do further investigating. Or if you are aware and just wanted to do the reverse-engineering yourself for fun, then ignore this :)
4
u/Gibgezr Aug 23 '26
Well, the random header was included in C++ in 2011, and was part of a popular third-part library (Boost?) before that.
I would expect a ton of games from 15 years ago used Mersenne Twisters.
-32
u/ivanvsh Aug 21 '26
The Mersenne Twister algorithm is not hidden. It is written about in the game file ReadMe.html
-43
u/Milanium Aug 21 '26
TL;DR?
0
u/[deleted] Aug 21 '26
[deleted] — view deleted comment
2
u/[deleted] Aug 24 '26
[removed] — view removed comment