Part 11 - Hacking Character 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 char from the last lesson.

Let’s fire up radare2 in write mode.

  1. radare2 -w ./0x03_asm64_char_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 0x000009ec and specify a new char of our choosing.

  1. [0x000009e4]> wa movz w0, 0x66 @ 0x000009ec
  2. Written 4 byte(s) (movz w0, 0x66) = wx c00c8052
  3. [0x000009e4]>

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

  1. [0x000009e4]> q
  2. kali@kali:~/Documents/0x03_asm64_char_primitive_datatype$ ./0x03_asm64_char_primitive_datatype
  3. f

As you can see we successfully and permanently hacked the binary! It is very trivial but when you take the last series of lessons together with each new successive lesson you build a real skill-set!

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