Part 23 – Boolean Variables

For a complete table of contents of all the lessons please click below as it will give you a brief of each lesson in addition to the topics it will cover. https://github.com/mytechnotalent/Reverse-Engineering-Tutorial

The next stage in our journey is that of Boolean variables. The name goes back to the great George Boole to which all modern computer science has derived.

At the lowest level a value is either 0 or 1, false or true, + < 5 volts or +5 volts, etc.

Let’s examine our code.

  1. #include <iostream>
  2. int main(void) {
  3. bool isHacked = false;
  4. std::cout << isHacked << std::endl;
  5. return 0;
  6. }

Part 23 – Boolean Variables - 图1

To compile this we simply type:

  1. g++ example4.cpp -o example4
  2. ./example4

Part 23 – Boolean Variables - 图2

SUCCESS! We see 0 printed to the standard output or terminal!

Let’s break it down:

We create a boolean variable called isHacked to which we assign a value of false or 0. When we run the binary we clearly see the value 0 that successfully was echoed to the standard output.

Next week we will dive into Debugging Boolean Variables.