<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Angel Bandres</title>
    <description>The latest articles on DEV Community by Angel Bandres (@angban2x).</description>
    <link>https://dev.to/angban2x</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3826186%2F9217e431-f285-4a06-b15d-40d893e4b420.png</url>
      <title>DEV Community: Angel Bandres</title>
      <link>https://dev.to/angban2x</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/angban2x"/>
    <language>en</language>
    <item>
      <title>How I built a binary ELF/PE analyzer (Phase 2)</title>
      <dc:creator>Angel Bandres</dc:creator>
      <pubDate>Thu, 02 Apr 2026 03:31:06 +0000</pubDate>
      <link>https://dev.to/angban2x/how-i-built-a-binary-elfpe-analyzer-phase-2-2fao</link>
      <guid>https://dev.to/angban2x/how-i-built-a-binary-elfpe-analyzer-phase-2-2fao</guid>
      <description>&lt;h2&gt;
  
  
  Introduction and Motivation
&lt;/h2&gt;

&lt;p&gt;If you've read my previous post on Phase 1, you probably have already an idea of the evolution of this project. If you haven't let me explain briefly.&lt;/p&gt;

&lt;p&gt;I've been wanting to learn about Cybersecurity, Reversing and Low-level development, and this is the very first step, the very tip of the iceberg if you will; to have some fun and hopefully land a job in this vast and fascinating area. I've named this project "Binalyzer" as a spiritual succesor to my first junior Full Stack project "Textalyzer" (completely vibecoded and barely knowing a thing or two about HTML). &lt;/p&gt;

&lt;p&gt;This time around, I wanted to do things on my own, with little to no use of AI for the development of this project, so I can properly learn everything relevant to this project (namely, binary file structure and Python). I've decided to do this in Python since I didn't know much about the language and development speed is overall much faster in comparison with C/C++. Also, it's a surprisingly powerful and expressive language and there's always more to learn about it. Documentation is also interesting and relatively easy to digest too.&lt;/p&gt;

&lt;h3&gt;
  
  
  Now, what is Binalyzer?
&lt;/h3&gt;

&lt;p&gt;As the name might imply, it's simply a CLI binary file analyzer. As of right now, you need Python to run it, and the command you need to use to run is&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python main.py filepath_to_bin -a&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What's with all these phases?
&lt;/h3&gt;

&lt;p&gt;Each phase represents a new functionality of the script. Phase 1 involved basic detection of the file type (ELF or PE, for the time being). Now, phase 2 involves header parsing of these files, which I'm very proud about.&lt;/p&gt;

&lt;h2&gt;
  
  
  Now now, what are PE and ELF? Do ELF files have ears? Is PE the Pocket Edition of Minecraft?
&lt;/h2&gt;

&lt;p&gt;Answering the last two questions, no, unfortunately. But, Binalyzer kinda "hears" the inner structure and, since you can run Python in your phone, it's technically "pocketable" ig.&lt;/p&gt;

&lt;h3&gt;
  
  
  Damn... what is ELF then?
&lt;/h3&gt;

&lt;p&gt;According to the Linux manpages (which I read recommend to read for further information, but not exclusively), it is a:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;format of Executable and Linking Format files&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This structure is fairly straightfoward, defined almost entirely by unsigned integers (size depending on the architecture), and maybe a few arrays here and there.&lt;/p&gt;

&lt;h3&gt;
  
  
  Alright then, what about PE?
&lt;/h3&gt;

&lt;p&gt;PE stands for Portable Executable. And that's all you need to know&lt;/p&gt;

&lt;p&gt;Both files are dynamic in size (shocking!) and are structured in very different ways (what?!), but PE is more complicated (even more than I can think of).&lt;/p&gt;

&lt;h3&gt;
  
  
  How can you tell which one is which?
&lt;/h3&gt;

&lt;h4&gt;
  
  
  ELF
&lt;/h4&gt;

&lt;p&gt;Check the first 4 bytes of the binary. It's a magic number. If it's "\0x7F E L F", then it's an ELF file.&lt;/p&gt;

&lt;h4&gt;
  
  
  PE
&lt;/h4&gt;

&lt;p&gt;Check the first 2 bytes. If it's "MZ" then it's a DOS file. This is done to preserve compatibility with older DOS programs. Then, check bytes 61 to 64 (indices 60 to 63), that is the signature. If it's "P E \0 \0", then it's a valid PE file.&lt;/p&gt;

&lt;p&gt;Thought: there are many other types of binaries and I assume that each and every one of them has a different way of being read. This may be important if I want to scale my detection capabilites for other types of binaries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Alright. Now, tell me more about the structure of these "headers".
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ELF Header
&lt;/h3&gt;

&lt;p&gt;Made of&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;e_ident: a 16 byte (unsigned char) array that identifies how the file  must be interpreted as.&lt;/li&gt;
&lt;li&gt;e_type: Object file type&lt;/li&gt;
&lt;li&gt;e_machine: Required architecture of an individual file&lt;/li&gt;
&lt;li&gt;e_version: File version&lt;/li&gt;
&lt;li&gt;e_entry: Point of entry. If you know a thing or two about operating systems and files, it's the address of the file where the system starts the process related to it.&lt;/li&gt;
&lt;li&gt;e_phoff: Program Header table OFFset (address)&lt;/li&gt;
&lt;li&gt;e_shoff: Section Header table OFFset&lt;/li&gt;
&lt;li&gt;e_flags: processor-specific flags associated with the file&lt;/li&gt;
&lt;li&gt;e_ehsize: ELF Header SIZE (in bytes)&lt;/li&gt;
&lt;li&gt;e_phentsize: Program Header table ENTry SIZE&lt;/li&gt;
&lt;li&gt;e_phnum: Program Header table's NUMber of entries&lt;/li&gt;
&lt;li&gt;e_shentsize: Section Header table ENTry size&lt;/li&gt;
&lt;li&gt;e_shnum: Section Header table's NUMber of entries&lt;/li&gt;
&lt;li&gt;e_shstrndx: Section Header table's section name STRing table iNDeX. Basically, there's a table of strings in the section name, in the section header table, and that table contains an index.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  PE header
&lt;/h3&gt;

&lt;p&gt;This one is more complicated, as it contains multiple "sub-headers". Fortunately, the names of these fields within these sub-headers are clearer. Here are some of the sub-headers that I've managed to parse as of right now in phase 2:&lt;/p&gt;

&lt;h4&gt;
  
  
  File Header
&lt;/h4&gt;

&lt;p&gt;Contains static information (metadata) on the moment the binary was compiled. These fields are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Machine: The type of CPU the binary was made for.&lt;/li&gt;
&lt;li&gt;NumberOfSections&lt;/li&gt;
&lt;li&gt;TimeDateStamp&lt;/li&gt;
&lt;li&gt;PointerToSymbolTable&lt;/li&gt;
&lt;li&gt;NumberOfSymbols&lt;/li&gt;
&lt;li&gt;SizeOfOptionalHeader&lt;/li&gt;
&lt;li&gt;Characteristics: flags in hex that determine additional aspects of the binary&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Optional Header
&lt;/h4&gt;

&lt;p&gt;This header is not fixed in size per se, since it has the instructions on how the system should expand and run the binary in RAM. But, contains some standard fields which are the same in every PE file:&lt;/p&gt;

&lt;h5&gt;
  
  
  Standard Fields
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Magic: The architecture of the binary, might be 32-bit (0x10b) or 64-bit (0x20b).&lt;/li&gt;
&lt;li&gt;MajorLinkerVersion and MinorLinkerVersion&lt;/li&gt;
&lt;li&gt;SizeOfCode (bytes)&lt;/li&gt;
&lt;li&gt;SizeOfInitializedData&lt;/li&gt;
&lt;li&gt;SizeOfUnitializedData&lt;/li&gt;
&lt;li&gt;AddressOfEntryPoint&lt;/li&gt;
&lt;li&gt;BaseOfCode (address): Start of the code section when the file is loaded into memory.&lt;/li&gt;
&lt;li&gt;BaseOfData (address, 32-bit Magic only): Same for BaseOfCode, but for the data section.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These fields are based on custom integer types called WORDs (2 bytes) and DWORDs (4 bytes).&lt;/p&gt;

&lt;h2&gt;
  
  
  How did you do implement this in Python?
&lt;/h2&gt;

&lt;p&gt;Now we're talking. I first took the file and read the header as a string of bytes. For both files, I used the &lt;code&gt;struct&lt;/code&gt; module and its method &lt;code&gt;struct.unpack()&lt;/code&gt;, using specific string formats depending on the architecture and endianness:&lt;/p&gt;

&lt;h3&gt;
  
  
  ELF Header Unpacking String Formats
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;32-bit, little endian: &lt;code&gt;"&amp;lt;16BHHIIIIIHHHHHH"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;32-bit, big endian: &lt;code&gt;"&amp;gt;16BHHIIIIIHHHHHH"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;64-bit, little endian: &lt;code&gt;"&amp;lt;16BHHIQQQIHHHHHH"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;64-bit, big endian: &lt;code&gt;"&amp;gt;16BHHIQQQIHHHHHH"&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Since I treated the header as a string, I had some troubles with the indices when determining the architecture and endianness, so make sure you're using the right ones! Here are the ones&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;architecture = header[4] # fifth byte
endianness = header[5] # sixth byte
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  PE Header Unpacking String Formats
&lt;/h3&gt;

&lt;p&gt;They are all little endian.&lt;/p&gt;

&lt;h4&gt;
  
  
  File Header: architecture-independent
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;"&amp;lt;HHIIIHH"&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Optional Header: Magic-dependent
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;32-bit: &lt;code&gt;"&amp;lt;HBBIIIIII"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;64-bit: &lt;code&gt;"&amp;lt;HBBIIIII"&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;32-bit uses an additional field for BaseOfData.&lt;/p&gt;

&lt;p&gt;To whom may concern, this is the structure of the project, pretty self-explanatory tbh.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu2fn3z88tggu4et7rxps.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu2fn3z88tggu4et7rxps.png" alt="Project structure" width="197" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  No pics no clicks! Where are the examples?
&lt;/h2&gt;

&lt;p&gt;Here they are!&lt;/p&gt;

&lt;h3&gt;
  
  
  PE: Windows Notepad
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgl8r11cpzfiudf5qe9g7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgl8r11cpzfiudf5qe9g7.png" alt="Binalyzer output on Windows Notepad" width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  ELF: ls (Linux)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9074dopzmcrq43erav1k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9074dopzmcrq43erav1k.png" alt="Binalyzer output on Linux's ls" width="450" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Comparing to a standardized program: &lt;code&gt;readelf -h&lt;/code&gt;, the resulting values are the same:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frr97pox9h3xmqq810naq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frr97pox9h3xmqq810naq.png" alt="readelf's output on Linux's ls" width="572" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  And now what?
&lt;/h2&gt;

&lt;p&gt;I will be very soon starting development on phase 3, which will include a listing of the sections of the binary, so stay tuned for more!&lt;/p&gt;

&lt;p&gt;If you want to check out the project, it's on &lt;a href="https://github.com/AngBan2x/binalyzer/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am open to any questions, comments, suggestions and constructive criticism.&lt;/p&gt;

</description>
      <category>lowlevel</category>
      <category>reversing</category>
      <category>cybersecurity</category>
      <category>python</category>
    </item>
    <item>
      <title>My first Low-Level project</title>
      <dc:creator>Angel Bandres</dc:creator>
      <pubDate>Tue, 17 Mar 2026 14:11:58 +0000</pubDate>
      <link>https://dev.to/angban2x/my-first-low-level-project-3fam</link>
      <guid>https://dev.to/angban2x/my-first-low-level-project-3fam</guid>
      <description>&lt;p&gt;As I'm getting into low-level and combining it with cybersecurity, yesterday I've started a project that analyzes binary files and their structure. Introducing:&lt;/p&gt;

&lt;h2&gt;
  
  
  Binalyzer: A simple binary file analyzer that shows information on their structure.
&lt;/h2&gt;

&lt;p&gt;Currently, I've completed the first out of five phases of this project, which is the simple &lt;strong&gt;detection and validation of either PE or ELF files&lt;/strong&gt;. I'm making this in Python so I can learn more of the language and its more simple syntax. Here are some use cases:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6tnrde3babi9ibpl32yw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6tnrde3babi9ibpl32yw.jpg" alt="PE File analysis example" width="746" height="55"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ol6vomti5epo6ix2ucq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1ol6vomti5epo6ix2ucq.png" alt="ELF File analysis example" width="647" height="55"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Check out and follow the project for future updates, here on &lt;a href="https://github.com/AngBan2x/binalyzer" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am open to any feedback, thanks for reading :)&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>learning</category>
    </item>
    <item>
      <title>My First FullStack project</title>
      <dc:creator>Angel Bandres</dc:creator>
      <pubDate>Tue, 17 Mar 2026 00:06:08 +0000</pubDate>
      <link>https://dev.to/angban2x/my-first-fullstack-project-g6e</link>
      <guid>https://dev.to/angban2x/my-first-fullstack-project-g6e</guid>
      <description>&lt;p&gt;Coming from a background in C++ and Data Structures, I recently challenged myself to dive into the web ecosystem. The result? Textalyzer — a high-performance REST API and web client for real-time text analysis. &lt;br&gt;
Throughout this project, I focused heavily on optimization and architecture. Here are the main technical hurdles I overcame:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; Algorithmic Efficiency: Refactored the character frequency logic from a naive $O(N^2)$ approach to $O(N)$ by implementing custom Hash Maps, drastically improving processing time for large texts.&lt;/li&gt;
&lt;li&gt;Data Persistence &amp;amp; Resilience: Integrated a serverless PostgreSQL database (Neon). When I encountered "Cold Start" connection drops on the cloud, I implemented Connection Pooling (pg.Pool) to ensure the server gracefully handles disconnections without crashing.&lt;/li&gt;
&lt;li&gt;Clean Architecture: Applied Separation of Concerns by modularizing the Node.js backend logic, and separating the frontend into clean HTML, CSS, and Vanilla JavaScript files.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Tech Stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Backend: Node.js, Express, PostgreSQLFrontend: HTML5, CSS3, Asynchronous JS (Fetch API)&lt;/li&gt;
&lt;li&gt;DevOps: Git (SemVer), WSL2, Render (PaaS)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check out the live project &lt;a href="https://textalyzer.onrender.com" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftmrhxcw6dzwdbxpjfjpg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftmrhxcw6dzwdbxpjfjpg.png" alt="Textlyzer example" width="800" height="627"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Dive into the code on Github, &lt;a href="https://github.com/AngBan2x/textalyzer" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Excited for the next challenge! Always open to feedback from the community. 👇&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>fullstack</category>
    </item>
  </channel>
</rss>
