Part 14 - Hacking Boolean Primitive Datatype

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/hacking\_c-\_arm64

Today we hack the boolean from the last lesson.

Let’s fire up radare2 in write mode.

  1. radare2 -w ./0x04_asm64_boolean_primitive_datatype

Let’s auto analyze.

  1. aaa

Seek to main.

  1. s main

View disassembly.

  1. v

Let’s get back to the terminal view.

  1. q

All we have to do is write assembly to 0x00000009bc and specify 0x0.

  1. [0x000009b4]> wa movz w0, 0x0 @ 0x00000009bc
  2. Written 4 byte(s) (movz w0, 0x0) = wx 00008052
  1. [0x000009b4]>

Let’s quit and run the new binary from the terminal.

  1. [0x000009b4]> q
  2. kali@kali:~/Documents/0x04_asm64_boolean_primitive_datatype$ ./0x04_asm64_boolean_primitive_datatype
  1. 0

As you can see we successfully and permanently hacked the binary! What was originally true or 1 is now false _or _0.

In our next lesson we will work with the integer primitive datatype.