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

推荐订阅源

Recent Announcements
Recent Announcements
雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
人人都是产品经理
人人都是产品经理
博客园 - 【当耐特】
量子位
有赞技术团队
有赞技术团队
博客园 - 三生石上(FineUI控件)
博客园 - Franky
M
MIT News - Artificial intelligence
U
Unit 42
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
The Cloudflare Blog
J
Java Code Geeks
V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
MyScale Blog
MyScale Blog
T
Tailwind CSS Blog
T
The Blog of Author Tim Ferriss
V
V2EX

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
Binalyzer: Phase 3 is now complete!
Angel Bandre · 2026-05-03 · via DEV Community
Cover image for Binalyzer: Phase 3 is now complete!

Angel Bandres

comparando el análisis de secciones entre ELF y PE, explicando las diferencias de formato y cómo las abordaste.

At last, Phase 3 for Binalyzer is now complete! It now lists sections for both PE and ELF files. I'll keep it short and sweet this time since most of the information can be already understood from reading my previous post, so I'll keep the key takeaways of what I did here.

What did you do?

I thought you'd never ask.

Reading format

Obviously, since ELF and PE are both for fundamentally different operating systems, reading and parsing these fields for each section is different from eachother. I looked up on the documentation for PE's section format to be able to figure out how to read it and did the usual with methods like read() and unpack() to do some of the heavy lifting for me.

Make sure that you're reading every single field of the section, otherwise, you might get into trouble since the data will be displaced

Reading names

Reading the names for each section was a similar process. Since they are padded with null bytes (x\00), I had to remove them with the replace() method.

Getting flags

I couldn't have thought of the proper solution without AI for this one (and I'm genuinely ashamed of this one tbh), since each flag value is stored in a hexadecimal digit, and more importantly, some digits might be the sum of two or more flag values; so I had no idea whatsoever to solve this little puzzle myself. Turns out, using bitwise AND (&) does the trick. You just check the comparison of characteristics & flag == flag and store the flag in a flags dictionary as the key (with the description being the value, you will see and example later on)

What is the output for these PEs then?

Here you go.

cmd.exe: Header and first three sections

File path: /mnt/c/Windows/system32/cmd.exe
Filetype: PE
Magic number 0x20b
PE Header :
    COFF Offset : 248
    Signature : b'PE\x00\x00'
    File Header :
        Machine : x64
        NumberOfSections : 8
        TimeDateStamp : 2091-09-06 23:01:06+00:00
        PointerToSymbolTable : 0
        NumberOfSymbols : 0
        SizeOfOptionalHeader (bytes) : 240
        Characteristics :
            0x2 : Executable file
            0x20 : Can handle >2GB addresses
    Optional Header :
        Standard Fields :
            Magic : PE32+
            MajorLinkerVersion : 14
            MinorLinkerVersion : 38
            SizeOfCode : 233472
            SizeOfInitializedData : 217088
            SizeOfUnitizializedData : 0
            AddressOfEntryPoint : 162592
            BaseOfCode (address) : 4096
Sections :
    [0]
    Name : .text
    VirtualSize : 0x37db6
    VirtualAddress : 0x1000
    SizeOfRawData : 0x38000
    PointerToRawData : 0x1000
    PointerToRelocations : 0x0
    PointerToLinenumbers : 0x0
    NumberOfRelocations : 0x0
    NumberOfLinenumbers : 0x0
    Characteristics :
        0x0 : Reserved for future use
        0x20 : Contains executable code
        0x20000000 : Can be executed as code
        0x40000000 : Can be read

    [1]
    Name : fothk
    VirtualSize : 0x1000
    VirtualAddress : 0x39000
    SizeOfRawData : 0x1000
    PointerToRawData : 0x39000
    PointerToRelocations : 0x0
    PointerToLinenumbers : 0x0
    NumberOfRelocations : 0x0
    NumberOfLinenumbers : 0x0
    Characteristics :
        0x0 : Reserved for future use
        0x20 : Contains executable code
        0x20000000 : Can be executed as code
        0x40000000 : Can be read

    [2]
    Name : .rdata
    VirtualSize : 0x9b38
    VirtualAddress : 0x3a000
    SizeOfRawData : 0xa000
    PointerToRawData : 0x3a000
    PointerToRelocations : 0x0
    PointerToLinenumbers : 0x0
    NumberOfRelocations : 0x0
    NumberOfLinenumbers : 0x0
    Characteristics :
        0x0 : Reserved for future use
        0x40 : Contains initialized data
        0x40000000 : Can be read

Enter fullscreen mode Exit fullscreen mode

If you want to check out more details on this update, check out the releases on my GitHub repo. I will start Phase 4 very soon. Ta ta!