HACKvent 2016: Day 5
Challenge
Santa found a paper with some strange logical stuff on it. On the back of it there is the hint: "use 32 bit".
He has no clue what this means - can you show him, what "???" should be?
Solution
This seems like a series of boolean logical operators. As the hint tell use to use 32 bits, we will solve this problem with a quick C++ program so we can guarantee the data type used is 32 bits. Furthermore, we will try both signed and unsigned variants, it turns out that we need to use signed integers for this problem.
We come up with C++ code (splitting up the operations into 3 steps):
#include <iostream>
int main(int argc, char **argv)
{
int32_t answer;
answer = (4 | 7) ^ (1337 & 424242);
answer = ~answer;
answer |= 0xB055;
std::cout << answer;
return 0;
}
We run the program and the the printed result is:
-291
I enter this into the ball-o-matic and get the daily QR code and daily flag!
Flag:
HV16-2wGq-wOX3-T2oe-n8si-hZ0A