HACKvent 2016: Day 5

Hackvent 20165340

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?

Hackvent 2016 Day 5 EveryBitisImportant Logical Operator Image

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!

Hackvent 2016 Day 5 Solution Ball

Flag:

HV16-2wGq-wOX3-T2oe-n8si-hZ0A

Leave a comment

(required)(will not be published)(required)

Comments

There are no comments yet. Be the first to add one!