惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
J
Java Code Geeks
Last Week in AI
Last Week in AI
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
C
Check Point Blog
月光博客
月光博客
腾讯CDC
Engineering at Meta
Engineering at Meta
博客园 - Franky
Vercel News
Vercel News
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Fortinet All Blogs
Microsoft Security Blog
Microsoft Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
雷峰网
雷峰网
Google DeepMind News
Google DeepMind News
Martin Fowler
Martin Fowler
GbyAI
GbyAI
B
Blog
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Building an ELF Binary analyzer in Python (Phase 3: secti...
Angel Bandre · 2026-05-02 · via DEV Community

I am back! 😀😮‍💨

I was procrastinating too much to not write this lol, I'm actually pretty lazy for writing, but stepping out of my comfort zone to do what's necessary will help me in the long run.

ANYWAYS, I made some progress a few weeks back with Phase 3 of my binary analyzer, which is listing of sections. This time, I only finished ELF binaries, since I haven't worked on PE yet (again, procrastination FTL).


Now then, how does the section table work?

The section header table in ELF files lets you localize all of the file's sections. It is an array of structures that I will show you more later on through the screenshots. That means, when reading the binary, you can opt for either parsing one by one and forgetting about it or storing the information in a linear/sequential data structure. I opted for the latter, using a list to store the information all sections (although any other sequence data structure might work just fine) and dictionaries within the list to store the information of each section, and also to make it more usable with my recursive dictionary printing function lolol.

Also, the first entry in the section header table is usually filled with zeros. Take that into consideration if you want to parse the table yourself.

How can you differentiate a section from the other one?

Each one has their own name, which can be extracted from the Section Header String Table, which is essentially a table that stores the strings for these names (these people have a way with their words istg). Originally, in these structures, the Name field is an index into this table, so it is necessary to use the ELF header to be able to localize these strings (which are null-terminated btw) through the e_shstrndx field and getting the last section .shstrtab whose offset points to section header string table.

Alright then, how does it visually represent each section?

Here's a screenshot of the first 4 sections of /bin/ls

The first four sections of /bin/ls

As you can see, the index of the entry in the table is at the top, inside square brackets and starting from 0. Then, the information for all of its fields is shown, until the next entry in the table.

Comparing my output to readelf -S:

readelf's output on /bin/ls' section listing

...I'll let you figure this out.

Will you do section listing for PE files too?

Yes! I'm on my way to doing so. Make sure to check out my Github repository here if you want to check the full source code and follow for more updates.

See you later :)