Writing an IR from Scratch and survive to write a post

In this post, I discuss creating the first version of the Intermediate Representation for the Kunai Static Analyzer, a library for analyzing Dalvik bytecode. As part of my PhD project, I aimed to enhance my programming skills and delve into the Dalvik file format. Despite the library’s discontinuation and the development of a new version called Shuriken, I wanted to share my experience constructing the IR and implementing various algorithms to convert Dalvik bytecode to IR. Inspired by Androguard’s limitations, I named the IR MjolnIR after Thor’s hammer, with a structure resembling Medium Level IL. The IR includes Control-Flow instructions, Expressions, and different types of operations and values.


To top