I found an unintended solution to this one, so I was pretty happy about that. The contents of the flag leads me to believe that I was intended to reverse a substitution cypher. But anyways, here is my solution. It was pretty obvious that I was dealing with some kind of cypher.
The most important function here is the one that I named
getRandStuff(). All it seemed to do was populate v5 with random bytes, which would then be used as substitutions for the characters in the flag and printed. However, the only entropy used to generate the random bytes was