LLVM Tips/Tricks

LLVM Tips/Tricks This is a collection of tips/tricks that I have learned while working with LLVM. I will keep updating this page as I learn more. (Last updated: 31st October 2022) Debugging LLVM (opt) passes with VSCode Refer to this blog post: Debugging LLVM (opt) passes with VSCode to ease the process of debugging LLVM passes using VSCode’s amazing debugging capabilities. Generating the CFG for a function Using IDA Pro for reverse engineering binaries, has made me a huge fan of CFGs, for analyzing control flows for low level applications....

October 31, 2022 · 3 min · Siddharth Muralee

Advanced GDB Debugging

Advanced GDB Debugging In this post, I would like to point out some tips/tricks to make debugging easier with GDB. I will be focusing on Linux x86_64 binaries, but most of the things should work on other architectures as well. I will try to cover both I am gonna assume basic familiarity with GDB, such as setting breakpoints/stepping through code, etc. If you are not familiar with GDB, I would recommend reading/watching some basic tutorial for GDB....

October 25, 2022 · 6 min · Siddharth Muralee

Debugging LLVM (opt) passes with VSCode

Debugging LLVM (opt) passes with VSCode In this blog, I plan to look at how to debug LLVM passes (specifically opt passes) with VSCode. I have been working with opt passes in VSCode for a while, and realized that people have a really hard time debugging them. I have had labmates switch to CLion for writting LLVM passes. So, here’s a guide on setting up VSCode for debugging llvm-opt passes....

September 4, 2022 · 5 min · Siddharth Muralee

Digging into ELFs (Part 1)

Digging into ELFs (Part 1) In this blog, I plan to look at the ELF file format, specifically the ELF headers, sections and segments. This is gonna be a part of a series that I hope to complete part-by-part this month. I am planning to use the LIEF python module to help me look at ELFs and understand what’s happening. Overview ELF file contains a header and data. The data is divided into segments, each segment can contian a number of sections....

July 26, 2022 · 7 min · Siddharth Muralee

Digging into ELFs (Part 2)

Digging into ELFs (Part 2) Last time, I spent time looking at the ELF headers. And we got a decent idea of how the ELF file format stores data in various segments and sections. Now let’s look deeper into different sections that are present in the ELF file. What are those various sections? To view the sections using the LIEF python module, we can use the following script: import lief binary = lief....

July 26, 2022 · 2 min · Siddharth Muralee