<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Devirt on Medium]]></title>
        <description><![CDATA[Stories by Devirt on Medium]]></description>
        <link>https://medium.com/@devirt?source=rss-96a56c826e16------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*k0ZhdB39OGzyOFZ-XzPXmA.png</url>
            <title>Stories by Devirt on Medium</title>
            <link>https://medium.com/@devirt?source=rss-96a56c826e16------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 04:55:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@devirt/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[PE File Format Explained: Every Header and Section, Read From a Real File]]></title>
            <link>https://medium.com/@devirt/pe-file-format-explained-every-header-and-section-read-from-a-real-file-b4d35dfe337b?source=rss-96a56c826e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4d35dfe337b</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Devirt]]></dc:creator>
            <pubDate>Fri, 13 Nov 2026 10:33:53 GMT</pubDate>
            <atom:updated>2026-11-13T10:33:53.550Z</atom:updated>
            <content:encoded><![CDATA[<p>The PE (Portable Executable) file format is the structure Windows uses for every executable, DLL and driver it loads. To explain it with real numbers instead of diagrams of a generic file, on 13 November 2026 we compiled a 13-line C# program into a 3,584-byte hello.exe and read every header with a 204-line parser we wrote for this article. All the values below come from that file, or from one stock Windows binary parsed the same way.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fi.ytimg.com%2Fvi%2FfLPV61qJuhY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f72ba16e16868844265f6683e7681c1a/href">https://medium.com/media/f72ba16e16868844265f6683e7681c1a/href</a></iframe><blockquote><strong><em>Opened a PE and the sections look wrong?</em></strong><em> Section names no compiler would choose, or a handful of imports, can mean a packer or protector got there first. Devirt’s free browser check reads a file’s details and protection indicators on your own device, with nothing uploaded, for PE, ELF and Mach-O files up to 500 MiB. If a file you’re authorized to analyze turns out to be VM-protected, Devirt recovers supported protected logic and labels what is proven and what remains unknown. </em><a href="https://devirt.re/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=pe-file-format"><em>Run the free browser check on devirt.re</em></a><em>.</em></blockquote><h3>What is the PE file format?</h3><p>The PE file format is the file structure Windows uses for executable images (EXE, DLL, SYS and others), built on the older COFF (Common Object File Format) used for object files. Microsoft’s <a href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format">PE Format specification</a> says the name “Portable Executable” refers to the fact that the format is not architecture specific: the same layout carries x86, x64 and Arm code, with a field in the header saying which.</p><p>A PE file is a set of headers followed by sections. The headers describe the file: what machine it targets, where execution starts, how to map it into memory and where its tables live. The sections hold the code, data, imports, resources and everything else. Reading the headers is the first step of nearly any <a href="https://devirt.re/research/binary-analysis?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=pe-file-format">binary analysis</a>, because they tell you what you’re looking at before you disassemble a single instruction.</p><p><strong>The two sample files:</strong></p><ul><li><strong>hello.exe</strong>, compiled on 13 November 2026 with the C# compiler that ships with .NET Framework 4 on Windows (csc.exe, version 4.8.9221.0, flags /optimize+). It&#39;s a .NET program, so it&#39;s a real PE file with a slightly unusual inside: its code is .NET bytecode rather than x86 instructions. 3,584 bytes, SHA-256 starting df360eac.</li><li><strong>sudo.exe</strong>, the stock 64-bit C:\Windows\System32\sudo.exe (file version 1.0.1) on Windows 11 build 26200. We didn&#39;t compile it. It fills in the native-code parts a .NET file doesn&#39;t show: a long import list, TLS and an embedded signature. 970,272 bytes.</li></ul><h3>The PE file layout at a glance</h3><p>A PE file on disk runs, in order: the MS-DOS header, the DOS stub, the PE signature, the COFF file header, the optional header, the section table, and then the raw data of each section. The headers are small. In hello.exe they take the first 496 bytes, padded to 512, and the three sections fill the remaining 3,072.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tWzQ738aaL1cyIxWQoEdIQ.png" /></figure><p>The diagram shows the second idea you need early: the file on disk and the image in memory are laid out differently. On disk, sections are packed at FileAlignment boundaries (512 bytes in hello.exe). In memory, the Windows loader places each one at a SectionAlignment boundary (8,192 bytes, 0x2000, in hello.exe). So the same .text section sits at file offset 0x200 and at memory address 0x2000 relative to the image base. Mixing up those two coordinate systems is the classic PE beginner mistake.</p><h3>The DOS header and DOS stub</h3><p>The DOS header is the first 64 bytes of every PE file, and it exists for MS-DOS compatibility. It starts with the two bytes 4D 5A, the letters &quot;MZ&quot;. On modern Windows, the field that matters most comes next: the 4-byte value at offset 0x3C, often called e_lfanew, which holds the file offset of the PE signature.</p><p>The DOS stub follows it: a small program that runs if someone starts the file under MS-DOS. Microsoft’s specification says its linker places a default stub that prints “This program cannot be run in DOS mode”, and both of our files carry that exact message. In hello.exe the stub is 64 bytes and e_lfanew is 0x80, so the PE signature starts at byte 128. In sudo.exe the gap is 192 bytes and e_lfanew is 0x100. The extra bytes hold a block known as the Rich header, which the specification doesn&#39;t document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WbKuZ1b_LiR6TUEf-nUbjQ.gif" /></figure><h3>The PE signature and COFF file header</h3><p>The PE signature is 4 bytes, 50 45 00 00, the letters &quot;PE&quot; followed by two null bytes, at the offset e_lfanew points to. Right after it comes the 20-byte COFF file header, the first part of what most tools call the PE header (or NT headers). Its fields, with the values from hello.exe:</p><ul><li><strong>Machine:</strong> 0x14C, Intel 386 and compatibles. sudo.exe reads 0x8664, x64.</li><li><strong>NumberOfSections:</strong> 3. Microsoft notes that the Windows loader limits this to 96.</li><li><strong>TimeDateStamp:</strong> 0x6AF6DB56, which decodes to 09:41:42 UTC on 13 November 2026, the moment we ran the compiler. The field holds seconds since 1 January 1970.</li><li><strong>PointerToSymbolTable</strong> and <strong>NumberOfSymbols:</strong> both 0, as Microsoft says they should be for an image.</li><li><strong>SizeOfOptionalHeader:</strong> 224 bytes. You need this value to find the section table.</li><li><strong>Characteristics:</strong> 0x0102, the flags EXECUTABLE_IMAGE and 32BIT_MACHINE. A DLL would also set the DLL flag.</li></ul><h3>What is in a PE header?</h3><p>A PE header is the block that tells the Windows loader how to map and run the file, and it has four parts: the DOS stub with its pointer at 0x3C, the 4-byte “PE\0\0” signature, the 20-byte COFF file header, and the optional header. The section table follows immediately. In hello.exe the signature is at 0x80, the COFF header at 0x84, the optional header at 0x98 and the section table at 0x178.</p><p>Those four offsets are the whole map. A PE parser, whether it’s a hex editor template or a disassembler’s loader, starts by reading 0x3C, checking the signature and walking forward by fixed sizes.</p><h3>The optional header</h3><p>The optional header is the largest header and, for executables, not optional at all. Microsoft explains that only object files can go without it. It has three parts: standard fields, Windows-specific fields, and the data directories. The fields worth knowing, with hello.exe values:</p><ul><li><strong>Magic:</strong> 0x10B, which means PE32.</li><li><strong>AddressOfEntryPoint:</strong> 0x236E, where execution starts, as an offset from the image base.</li><li><strong>ImageBase:</strong> 0x400000, the preferred load address and the long-standing default for executables.</li><li><strong>SectionAlignment:</strong> 0x2000 (8,192). <strong>FileAlignment:</strong> 0x200 (512), Microsoft’s default.</li><li><strong>SizeOfImage:</strong> 0x8000 (32,768 bytes once mapped, about nine times the file size, because of the alignment gaps).</li><li><strong>SizeOfHeaders:</strong> 0x200 (512).</li><li><strong>Subsystem:</strong> 3, WINDOWS_CUI, a console program.</li><li><strong>DllCharacteristics:</strong> 0x8540, including DYNAMIC_BASE (the image can be relocated at load time, which address randomization relies on) and NX_COMPAT (compatible with no-execute memory protection).</li></ul><p>The entry point holds a small surprise in a .NET file. The 6 bytes at 0x236E are FF 25 00 20 40 00, an x86 jump through the address stored at 0x402000. That address is the import table slot for _CorExeMain, so the file&#39;s native entry point does nothing but hand control to the .NET runtime.</p><h4>PE32 vs PE32+</h4><p>PE32 and PE32+ are the 32-bit and 64-bit forms of the PE format, told apart by the optional header’s Magic field: 0x10B for PE32 and 0x20B for PE32+. Microsoft’s specification says PE32+ allows a 64-bit address space while limiting the image size to 2 gigabytes. PE32+ drops the BaseOfData field and widens ImageBase and the stack and heap sizes to 8 bytes, which is why hello.exe has a 224-byte optional header and sudo.exe, a PE32+ file with ImageBase 0x140000000, has a 240-byte one.</p><h3>What are data directories?</h3><p>PE data directories are an array of 8-byte entries at the end of the optional header, each giving the address and size of a table the loader or a tool needs. The count is in NumberOfRvaAndSizes, 16 in both of our files, and the order is fixed: export table, import table, resource table, exception table, certificate table, base relocation table, debug, and so on, ending with the CLR runtime header and a reserved slot.</p><p>Five of the 16 are in use in hello.exe:</p><ul><li><strong>Import Table:</strong> at 0x2318, 83 bytes.</li><li><strong>Resource Table:</strong> at 0x4000, 1,232 bytes.</li><li><strong>Base Relocation Table:</strong> at 0x6000, 12 bytes.</li><li><strong>IAT</strong> (import address table): at 0x2000, 8 bytes.</li><li><strong>CLR Runtime Header:</strong> at 0x2008, 72 bytes. This is the entry that marks the file as .NET.</li></ul><p>sudo.exe uses nine, including the exception table, debug data, the TLS table, the load configuration table and the certificate table. Microsoft adds two warnings worth repeating: check NumberOfRvaAndSizes before reading an entry, and don&#39;t assume a table starts a section or lives in a section with a particular name.</p><h3>The section table and sections</h3><p>The section table is an array of 40-byte headers, one per section, starting right after the optional header. Each entry holds an 8-byte name, the section’s size and address in memory (VirtualSize, VirtualAddress), its size and position in the file (SizeOfRawData, PointerToRawData) and a Characteristics field of flags such as MEM_EXECUTE, MEM_READ and MEM_WRITE.</p><p>hello.exe has three sections:</p><ul><li><strong>.text:</strong> code, flags 0x60000020 (code, execute, read). 1,024 bytes on disk at 0x200, mapped at 0x2000.</li><li><strong>.rsrc:</strong> resources, flags 0x40000040 (initialized data, read). 1,536 bytes at 0x600, mapped at 0x4000.</li><li><strong>.reloc:</strong> base relocations, flags 0x42000040 (initialized data, discardable, read). 512 bytes at 0xC00, mapped at 0x6000.</li></ul><p>sudo.exe has the usual six for a native x64 program: .text, .rdata (read-only data, where the import tables live), .data, .pdata (exception data), .rsrc and .reloc. Section names are a convention, not a contract. The loader reads the flags and the data directories, not the names.</p><h4>What is an RVA?</h4><p>An RVA (relative virtual address) is an address measured from the start of the loaded image, while a file offset is a position in the file on disk, and the two almost always differ. To convert one to the other, find the section whose memory range holds the RVA, subtract its VirtualAddress and add its PointerToRawData. The entry point RVA in hello.exe, 0x236E, falls in .text (mapped at 0x2000, stored at 0x200), so on disk it sits at 0x56E.</p><p>If you want to see these fields in your own files, this 15-line Node script prints them. It reads 0x3C, checks the signature and walks the section table, exactly as described above:</p><pre>// peek.js: print the main PE header fields of any Windows file. Usage: node peek.js file.exe<br>const fs = require(&#39;fs&#39;);<br>const b = fs.readFileSync(process.argv[2]);<br>const hex = (n) =&gt; &#39;0x&#39; + n.toString(16).toUpperCase();<br>if (b.toString(&#39;latin1&#39;, 0, 2) !== &#39;MZ&#39;) throw new Error(&#39;not an MZ file&#39;);<br>const pe = b.readUInt32LE(0x3c); // e_lfanew: where the PE signature starts<br>if (b.toString(&#39;latin1&#39;, pe, pe + 4) !== &#39;PE\0\0&#39;) throw new Error(&#39;no PE signature&#39;);<br>const coff = pe + 4, opt = coff + 20, count = b.readUInt16LE(coff + 2);<br>console.log(&#39;PE signature at&#39;, hex(pe), &#39;| Machine&#39;, hex(b.readUInt16LE(coff)), &#39;| sections&#39;, count);<br>console.log(&#39;Format&#39;, b.readUInt16LE(opt) === 0x20b ? &#39;PE32+&#39; : &#39;PE32&#39;, &#39;| entry point RVA&#39;, hex(b.readUInt32LE(opt + 16)));<br>let s = opt + b.readUInt16LE(coff + 16); // the section table follows the optional header<br>for (let i = 0; i &lt; count; i++, s += 40) {<br>  const name = b.toString(&#39;latin1&#39;, s, s + 8).replace(/\0+$/, &#39;&#39;);<br>  console.log(name.padEnd(8), &#39;RVA&#39;, hex(b.readUInt32LE(s + 12)), &#39;| raw size&#39;, b.readUInt32LE(s + 16), &#39;| file offset&#39;, hex(b.readUInt32LE(s + 20)));<br>}</pre><p>Run on hello.exe, it prints the signature at 0x80, Machine 0x14C, 3 sections, PE32, entry point 0x236E, and the three section lines above.</p><h3>Imports and exports</h3><p>The import table lists every DLL a PE file needs and every function it calls from each one. It starts with an import directory table of 20-byte entries, one per DLL, each pointing to the DLL’s name, an import lookup table of function names or ordinals, and an import address table (IAT). When the loader maps the file, it overwrites the IAT slots with the real addresses of those functions, and the program’s code calls through them.</p><p>The two samples show the range. hello.exe imports exactly one function, _CorExeMain from mscoree.dll, because the .NET runtime resolves everything else itself. sudo.exe imports 185 functions from 17 DLLs, including 98 from kernel32.dll and 22 from ADVAPI32.dll. Microsoft&#39;s specification says virtually all executable files carry import information.</p><p>Exports run the other way: an export table lists the functions a file offers to others, by name and by ordinal number, and it’s mostly found in DLLs. Neither sample exports anything, so we parsed the export table of C:\Windows\System32\kernel32.dll as well: 1,697 exported functions, all with names, starting alphabetically with AcquireSRWLockExclusive.</p><h3>Relocations, TLS and resources</h3><p>Base relocations, TLS and resources are three more tables reached through the data directories, and each answers a different loader question.</p><p><strong>Base relocations</strong> are the list of places in the image that hold absolute addresses and need fixing if the file isn’t loaded at its preferred ImageBase. The table is split into blocks, one per 4 KB page. hello.exe has one block with one real entry, of type 3 (HIGHLOW, a 32-bit fix): the address inside its jump to _CorExeMain. sudo.exe has 19 blocks holding 1,422 entries of type 10 (DIR64, a 64-bit fix). Because both files set DYNAMIC_BASE, Windows may load them at a random address, and these lists are what make that possible.</p><p><strong>TLS</strong> (thread local storage) lets a program keep a separate copy of a variable for each thread, and its directory can list TLS callbacks: functions the loader calls when a process or thread starts and ends, with the same parameters as a DLL entry point. sudo.exe has a TLS directory with one callback. hello.exe has none. Analysts check this table early, because a callback is code the loader runs when the process starts, separately from the entry point.</p><p><strong>Resources</strong> live in the resource section, which holds icons, version information, manifests, dialogs and string tables, arranged as a tree with three levels by convention: type, name and language. hello.exe has two resource types, VERSION and MANIFEST, both added by the compiler. sudo.exe has seven, including icons, a string table and a message table.</p><h3>What is the overlay in a PE file?</h3><p>The overlay is any data in a PE file after the end of the last section’s raw data, which the loader doesn’t map as part of the image. <a href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format">Microsoft’s specification</a> doesn’t use the word “overlay”; it describes the area past the last section as not covered by the Authenticode image hash, and it notes that the certificate table entry is a file offset rather than an RVA because certificates aren’t loaded into memory.</p><p>hello.exe has no overlay: its last section ends at byte 3,584, the end of the file. sudo.exe has a 10,272-byte overlay, and all of it is its embedded Authenticode signature. Across all 636 .exe files in C:\Windows\System32 on our test machine, 131 had an overlay, and in every one of them it was exactly the certificate table. Installers and self-extracting archives can append their payload in the same place, which is why an overlay is worth noting, not worth alarm.</p><h3>How packers and protectors change what you see in a PE file</h3><p>A packer compresses or encrypts a program’s original code and adds a small stub that restores it in memory when the program runs. A protector is built to resist analysis instead, and the strongest ones virtualize code so the original instructions never come back. Both rewrite the PE file around their own stub, and that leaves marks in the headers.</p><p>You can tell a PE file is probably packed when several header signs line up: unusual section names, a section with entropy close to 8 bits per byte, a very short import list and an entry point in the last section. They are analyst heuristics, not rules from the specification, and one sign alone proves little, as the baseline below shows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EAN-iJccD_VCuQHAKziMmQ.png" /></figure><p>To put each sign against a baseline, we ran the same parser over all 636 .exe files in C:\Windows\System32 on the same Windows 11 machine. They are stock files as shipped with Windows, so they show what files look like as Microsoft ships them.</p><ul><li><strong>Odd section names.</strong> Compilers emit familiar names such as .text, .rdata and .data, and a packer may replace them with its own or with blank or random strings. Names alone prove little: 602 of the 636 stock Windows files contain a section called fothk, and kernel-mode files use names like PAGE and INIT. An odd name is a prompt to look closer, not a verdict.</li><li><strong>A high-entropy section.</strong> Entropy measures how random a section’s bytes are, from 0 to a maximum of 8 bits per byte. Compressed and encrypted data sits near the top of that range, while compiled code usually sits lower. In our census the median .text section scored 5.97 bits per byte, and only 4 of 636 went above 7, all of them Windows licensing and activation components. Three of those four also carry sections named ?g_Encry, a reminder that a stock file is not automatically an unprotected one. Resources are the usual exception: 37 of the 42 files with a section above 7 had it in .rsrc, which can hold already-compressed data such as PNG icons.</li><li><strong>A tiny import table.</strong> A packer’s stub may import only the few functions it needs to rebuild the real imports at run time, so a packed file can list a handful where the original listed hundreds. The stock native files imported a median of 120 functions. Context matters again: our own clean hello.exe imports one, because it&#39;s .NET, and five Windows boot, resume and hypervisor files import one function or none.</li><li><strong>The entry point in the last section.</strong> A compiler puts the entry point in the code section, usually the first. A packer that appends its stub as a new section can move AddressOfEntryPoint there. Not one of the 636 stock files had its entry point in its last section.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BJu3GOZFOaj5yqsBlP8I2A.png" /></figure><p>Tools such as Detect It Easy read these same headers and also match byte signatures against databases of known packers and protectors, which is how they put a name to what they find. The older <a href="https://buttondown.com/devirt/archive/peid-what-replaced-it/">PEiD</a>, whose official site has been discontinued, worked the same way on Windows PE files, and Devirt’s guide on how to <a href="https://devirt.re/blog/identify-packer-or-protector?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=pe-file-format">identify a packer</a> compares the current tools and what their results do and don’t tell you.</p><p>Identification is where header reading stops. A name from a tool, or a high-entropy section, tells you what is wrapped around the program, not what the program does. For a VM-protected function, the code you’d want to read has been compiled into bytecode for a private virtual machine, so even a perfect reading of the PE headers only shows the protector’s interpreter.</p><h3>Tools for reading PE headers</h3><p>You don’t need to write a parser to read a PE file. These free tools display the same structures:</p><ul><li><strong>PE-bear</strong> and <strong>CFF Explorer:</strong> header and section viewers with every field labelled.</li><li><strong>Detect It Easy:</strong> file type, compiler and packer identification, plus per-section entropy.</li><li><strong>A hex editor</strong> such as HxD, for checking raw bytes like 4D 5A and 50 45 00 00 yourself.</li><li><strong>Ghidra</strong> and <strong>IDA Free:</strong> disassemblers whose loaders parse the PE format before showing any code.</li></ul><p>Our parser and the System32 census script are plain Node.js with no dependencies, and hello.exe comes from a 13-line C# file. Every value in this article came from them, run on 13 November 2026.</p><h3>The short version</h3><ul><li>The PE file format is the structure of Windows executables, DLLs and drivers: headers first, then sections.</li><li>The PE header starts at the offset stored at 0x3C, with the bytes 50 45 00 00, followed by the 20-byte COFF header and the optional header.</li><li>The optional header’s Magic field separates PE32 (0x10B) from PE32+ (0x20B), and its 16 data directories point to imports, exports, resources, relocations, TLS and more.</li><li>RVAs are memory addresses relative to the image base; file offsets are positions on disk. The section table converts between them.</li><li>The overlay is data after the last section. In the 131 Windows files we found with one, it was always the embedded signature.</li><li>Packers show up as odd section names, high-entropy sections, tiny import tables and an entry point in the last section. Weigh them together against what normal files look like.</li></ul><p>— -</p><p><em>Devirt recovers protected code for files you own or are authorized to analyze. We don’t remove DRM, bypass license checks or crack software.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4d35dfe337b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is Ghidra? The NSA's Free Reverse Engineering Tool, Explained]]></title>
            <link>https://medium.com/@devirt/what-is-ghidra-the-nsas-free-reverse-engineering-tool-explained-1b5b06f3d5fa?source=rss-96a56c826e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b5b06f3d5fa</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Devirt]]></dc:creator>
            <pubDate>Fri, 13 Nov 2026 09:56:08 GMT</pubDate>
            <atom:updated>2026-11-13T09:56:08.314Z</atom:updated>
            <content:encoded><![CDATA[<p>Ghidra is a free, open-source software reverse engineering framework built by the US National Security Agency (NSA) and shown to the public on 5 March 2019. It takes a compiled program, the kind of file you can run but not read, and turns it back into assembly and C-like code a person can study. On 13 November 2026, its GitHub repository held descriptions for 61 named processors, from desktop x86 down to 8-bit chips from the 1970s such as the 6502.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fi.ytimg.com%2Fvi%2FfLPV61qJuhY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f72ba16e16868844265f6683e7681c1a/href">https://medium.com/media/f72ba16e16868844265f6683e7681c1a/href</a></iframe><blockquote><strong><em>When the Decompiler shows a loop instead of logic:</em></strong><em> some files you’re authorized to analyze have functions that a protector such as VMProtect or Themida has turned into bytecode, and Ghidra can only show the virtual machine that runs them. Devirt recovers supported protected logic, labels what is proven and what remains unknown, and returns an IDA database, annotated pseudocode, a report, LLVM IR or JSON for the agreed scope. </em><a href="https://devirt.re/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=what-is-ghidra"><em>See how binary devirtualization works</em></a><em>.</em></blockquote><h3>What is Ghidra?</h3><p>Ghidra is a free, open-source software reverse engineering framework developed by the NSA, unveiled at the RSA Conference in San Francisco on 5 March 2019, with its source code published on GitHub that April under the Apache License 2.0. Ghidra combines a disassembler, a decompiler that turns machine code into C-like pseudocode, and a scripting environment in one desktop application that runs on Windows, macOS and Linux.</p><p>The project’s README says the NSA built Ghidra “to solve scaling and teaming problems on complex SRE efforts.” At the launch, Rob Joyce, then the agency’s senior cybersecurity adviser, told CyberScoop he expected outside developers to “build modules and capabilities” on top of it (<a href="https://cyberscoop.com/ghidra-nsa-tool-public/">CyberScoop, 5 March 2019</a>). They did: GitHub listed 419 contributors to the repository on 13 November 2026. The official address, ghidra-sre.org, now redirects to the <a href="https://github.com/NationalSecurityAgency/ghidra">NSA’s GitHub repository</a>, where releases, source code and issue tracking live.</p><h3>What are Ghidra’s main parts?</h3><p>Ghidra’s main parts are the CodeBrowser, the Listing, the Decompiler, the SLEIGH processor specifications and the scripting system. Ghidra shows its analysis in the CodeBrowser, a window of panes that stay in sync: click a function in one and the others jump to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jUZ-8T7QwZHMNYQYRdzKhw.png" /></figure><h4>The CodeBrowser and its windows</h4><ul><li><strong>Listing:</strong> the disassembly, one machine instruction per line, with addresses, bytes, labels and comments.</li><li><strong>Decompiler:</strong> the same function rebuilt as C-like code, with variables, loops and if-statements instead of registers and jumps.</li><li><strong>Symbol Tree:</strong> every function, label, import and export Ghidra found, in a searchable tree.</li><li><strong>Program Trees and Data Type Manager:</strong> the file’s sections, and the structures and types you define as you understand the code.</li><li><strong>Function Graph:</strong> the current function drawn as blocks and arrows, so branches and loops are visible at a glance.</li></ul><h4>SLEIGH and p-code: why one decompiler covers so many chips</h4><p>SLEIGH is the language Ghidra uses to describe a processor. Ghidra’s own documentation says SLEIGH describes microprocessors “with enough detail” to drive “the disassembly and decompilation engines.” Each SLEIGH file says how to decode a processor’s instructions and what each one does, written as p-code, a small intermediate language shared by every processor.</p><p>The Decompiler only ever reads p-code. Teaching Ghidra a new processor means writing its SLEIGH description and a few small configuration files, not a new decompiler, and that design is why the processor list is so long.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXu-U8UAixW5DW-A8H4cDQ.gif" /></figure><h4>Scripting and headless analysis</h4><p>Ghidra’s scripting system lets you automate most of what you’d otherwise click through by hand. The project’s README says users can write their own extensions and scripts “using Java or Python”, and the Script Manager ships with a library of ready-made scripts. The headless analyzer runs the same analysis from the command line, over a whole folder of files if you want.</p><p>That scripting layer is also how AI tools reach Ghidra. A community <a href="https://devirt.re/blog/reverse-engineering-mcp-obfuscated-binaries?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=what-is-ghidra">Ghidra MCP</a> server such as GhidraMCP lets an AI agent ask Ghidra to decompile functions and list methods, imports and exports through the Model Context Protocol.</p><p>Ghidra is mostly a Java program. GitHub’s language count for the repository on 13 November 2026 put Java at 86.1% of the code by size and C++ at 6.0%. The decompiler engine is one of the C++ parts.</p><h3>How many processors does Ghidra support?</h3><p>Ghidra’s source tree held 39 processor module directories on 13 November 2026, covering 61 named processors and 203 language variants described in 150 SLEIGH specification files. That count comes from the NSA’s GitHub repository at its October 2026 release. The modules range from x86, ARM, AARCH64, MIPS, PowerPC and RISC-V down to 8-bit chips such as the 6502, Z80 and 8051, plus Android’s Dalvik and Java’s JVM bytecode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rG7kvThEYV3pIGl67QZjFA.png" /></figure><p>Ghidra also ships often. Counting stable releases on GitHub from June 2021 to October 2026 gives 46 releases, a median of 35 days apart, and 17 of them in the last 24 months. June 2021 was also when Ghidra added a built-in debugger, so older articles saying “Ghidra has no debugger” are out of date.</p><p><em>Method: a script read the GitHub REST API for NationalSecurityAgency/ghidra on 13 November 2026. It listed the </em><em>Ghidra/Processors tree at the October 2026 release tag, parsed every </em><em>.ldefs language file, and paged through every published release. Eleven earlier releases were left out of the cadence count, because their GitHub entries were all created on one day in June 2021 and carry no real release dates. &quot;Module directories&quot; includes non-CPU modules such as DATA, Toy, JVM and Dalvik.</em></p><h3>What is Ghidra used for?</h3><p>Ghidra is used to understand compiled software when the source code isn’t available. Malware analysts use Ghidra to work out what a sample does, vulnerability researchers use it to find bugs in programs and firmware, and developers use it to recover the logic of old software they own or are authorized to analyze.</p><p>In practice that breaks down like this:</p><ul><li><strong>Malware analysis:</strong> what a suspicious program does, what it contacts and how it persists, read without running it.</li><li><strong>Vulnerability research:</strong> unsafe memory handling or logic errors in software that ships only as a binary.</li><li><strong>Firmware:</strong> routers, controllers and IoT devices, which often run on the small or unusual chips in Ghidra’s processor list.</li><li><strong>Legacy and interoperability work:</strong> how an old program reads a file format or speaks a protocol.</li><li><strong>Teaching:</strong> a reverse engineering course can give every student a decompiler without buying licenses.</li></ul><p>Ghidra is dual-use. Attackers can study software with it too, and whether a given analysis is legal depends on where you are, the software license and your purpose. Check before you open anything you didn’t write.</p><h3>Is Ghidra free? What license does it use?</h3><p>Ghidra is free for any use, including commercial work, because the NSA releases it under the Apache License 2.0. The Apache license lets anyone use, modify and redistribute Ghidra, provided they keep the license and copyright notices. There is no paid edition: the decompiler and every processor module come in the same free download from the NSA’s GitHub releases page.</p><h3>Is Ghidra safe to use?</h3><p>Ghidra is as safe to run as any open-source tool you download from its official source. Its source code is public, so anyone can read and build it, and since 2019 it has been developed in the open on GitHub. Download it only from the official GitHub releases, and watch the project’s <a href="https://github.com/NationalSecurityAgency/ghidra/security/advisories">security advisories</a> page, as you would for any tool that opens untrusted files.</p><h3>How does Ghidra compare with other reverse engineering tools?</h3><p>Ghidra is a free, full-featured disassembler and decompiler. Its advantages are the price, a decompiler that works across many processor families, and a release every month or so. At a glance:</p><ul><li><strong>Ghidra:</strong> free and open source (Apache 2.0), NSA-maintained, with a decompiler, a debugger and Java or Python scripting.</li><li><strong>IDA Pro:</strong> the long-established commercial standard from Hex-Rays, with a large plugin ecosystem and a limited free version.</li><li><strong>Binary Ninja:</strong> a commercial platform from Vector 35, known for its API and its layered intermediate languages.</li><li><strong>radare2, Rizin and Cutter:</strong> the other open-source route. radare2 is command-line first, and Cutter puts a graphical interface on Rizin, a fork of radare2.</li></ul><p>Plenty of analysts keep two of these open. For someone learning, though, the price settles it, and Ghidra’s decompiler is good enough that you won’t outgrow it quickly. If you’re assembling a full kit, a debugger, a file identifier and a hex editor matter as much as the decompiler, and Devirt’s guide to <a href="https://devirt.re/blog/reverse-engineering-tools?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=what-is-ghidra">reverse engineering tools</a> sorts them by the job each one does.</p><h3>Is Ghidra hard to learn?</h3><p>Ghidra is hard to learn if you’re new to reverse engineering, because the tool assumes you can read assembly and know how compiled programs are laid out in memory. Learning Ghidra’s interface itself takes a few sessions: the CodeBrowser opens the Listing, the Decompiler, the Symbol Tree and other windows side by side. Most of the learning curve is reverse engineering itself, not Ghidra.</p><p>The fastest way in is a program you wrote. Compile a short C file, open it in Ghidra, and compare the Decompiler’s output with your own source, so every confusing line has an answer. The Substack walkthrough on <a href="https://devirt.substack.com/p/how-to-use-ghidra">how to use Ghidra</a> takes you through that first session step by step, from creating a project to following cross-references.</p><h3>Where does Ghidra stop?</h3><p>Ghidra stops where the information it needs is no longer in the file. Three limits come up most:</p><ol><li><strong>The Decompiler’s output is a reconstruction.</strong> Compilation throws away variable names, comments and much of the type information. Ghidra recovers structure, not the original source, and its guesses need checking.</li><li><strong>Packed files hide their code until they run.</strong> On a packed program, Ghidra mostly sees the small stub that unpacks the rest at runtime, so static analysis shows the wrapper rather than the program.</li><li><strong>VM-protected functions show the machine, not the logic.</strong></li></ol><p>The third is the hardest to picture. Protectors such as VMProtect and Themida can translate selected functions into bytecode for a private virtual machine embedded in the file. That virtual CPU exists nowhere else, and each protected copy can use its own instruction set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T17eiEQjjE4yUCjcpYiZpw.png" /></figure><p>On its own, Ghidra can’t show the original logic of a VM-protected function. Its Decompiler faithfully shows that virtual machine’s dispatcher loop and handlers, not the function the developer wrote. That isn’t a bug in Ghidra: the decompiler is reading exactly what’s in the file. The original logic has to be translated back first, a process called devirtualization, before Ghidra or any other decompiler can show it as readable code.</p><h3>The short version</h3><ul><li>Ghidra is the NSA’s free, open-source (Apache 2.0) reverse engineering framework, public since March 2019.</li><li>The CodeBrowser shows the Listing and Decompiler side by side; SLEIGH and p-code let one decompiler cover 61 processors.</li><li>Analysts use it for malware, vulnerabilities, firmware and legacy code.</li><li>It reconstructs structure, not source, and on a VM-protected function it shows the interpreter until the code is devirtualized.</li></ul><p>— -</p><p><em>Devirt recovers protected code for files you own or are authorized to analyze. We don’t remove DRM, bypass license checks or crack software. Devirt is independent and not affiliated with the NSA or the Ghidra project.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b5b06f3d5fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Choose a Software Reverse Engineering Service]]></title>
            <link>https://medium.com/@devirt/how-to-choose-a-software-reverse-engineering-service-25b3c00fbb7e?source=rss-96a56c826e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/25b3c00fbb7e</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Devirt]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 05:25:46 GMT</pubDate>
            <atom:updated>2026-11-11T05:25:46.112Z</atom:updated>
            <content:encoded><![CDATA[<p>Software reverse engineering services analyze a compiled program to work out how it behaves when the source code is not available. In 2026 you can buy that work from four kinds of provider, and they differ less in skill than in how they scope the job, what they hand back, and how you can check it. This guide covers what these services deliver, the seven questions worth asking before you sign anything, and what a finished result should let you verify on your own.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fi.ytimg.com%2Fvi%2FfLPV61qJuhY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f72ba16e16868844265f6683e7681c1a/href">https://medium.com/media/f72ba16e16868844265f6683e7681c1a/href</a></iframe><blockquote><strong><em>About Devirt:</em></strong><em> Devirt recovers the code that protectors such as VMProtect and Themida hide inside their own virtual machines, for files you own or are authorized to analyze. You get an IDA database and annotated pseudocode, with a ledger showing which functions were proven. If nothing is proven, you pay nothing. </em><a href="https://devirt.re/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=re-services"><em>Start with a free assessment</em></a><em>.</em></blockquote><p><em>Disclosure: this guide is written by Devirt, which runs an automated reverse engineering service for protected and ordinary binaries. We describe other provider types in general terms and don’t rank anyone. Where we mention how Devirt works, it’s to show what an answer to one of the questions can look like.</em></p><h3>What do software reverse engineering services deliver?</h3><p>Software reverse engineering services deliver recovered logic, not original source code. Names, comments and project structure are lost when a program is compiled, so no provider can hand back the files a developer once wrote. What a good engagement returns is a description of what the program does, in forms you can work with:</p><ul><li><strong>Readable pseudocode</strong> for the functions in scope, usually C-like.</li><li><strong>A disassembler database</strong>, such as an IDA database or a Ghidra project, with the recovered functions in place so your own analysts can keep going.</li><li><strong>A written report</strong> that explains the behavior, the interfaces and the findings.</li><li><strong>Machine-readable output</strong>, such as LLVM IR or JSON, from some providers, for teams that feed results into their own tools.</li></ul><p>The reasons people buy this work fall into a handful of groups. They maintain legacy software whose source is gone. They need to interoperate with a file format, protocol or API nobody documented. They’re security researchers or malware analysts who need to explain what a sample does. Or they’re auditors who need a finding that survives review. Each group needs a slightly different deliverable, which is why the first question below is about scope.</p><h3>The four kinds of provider</h3><p>There are four broad ways to buy software reverse engineering in 2026, and the <a href="https://dev.to/devirt/software-reverse-engineering-services-compared-4-provider-types-48ab">types of software reverse engineering service</a> differ mostly in how the work gets scoped. Each fits a different kind of job.</p><ul><li><strong>Specialist reverse engineering consultancies.</strong> Small, senior teams. Best for open-ended or unusual work, such as an undocumented protocol or a custom file format, where the method has to be invented as the work goes.</li><li><strong>R&amp;D outsourcing firms with a reverse engineering practice.</strong> Larger companies that bundle reverse engineering with development. Best when the recovered knowledge feeds straight into a rebuild or modernization project.</li><li><strong>Independent freelancers.</strong> Best for small, well-defined tasks with a clear finish line, if you can verify the result yourself.</li><li><strong>Automated services.</strong> Software-driven recovery with a standard set of outputs. Best for repeatable jobs, such as recovering functions from binaries protected by a known commercial protector, where the output and the evidence can be standardized.</li></ul><p>Plenty of buyers use more than one: an automated service for the protected functions, then a consultant for the interpretation. The questions below work the same way for all four.</p><h3>Seven questions to ask before you sign</h3><p>Most buyer checklists stop at “check their experience” and “compare quotes”. Those matter, but they don’t tell you what you’ll be able to check once the work is done. These seven questions do.</p><h4>1. What exactly is in scope?</h4><p>A software reverse engineering scope should name the file, the functions or components in question, and the outcome you need. “Analyze this binary” isn’t a scope. “Recover the logic of the licensing check and the network handshake in this DLL” is. If the provider can’t restate your goal in one sentence before quoting, the result will be hard to judge later.</p><h4>2. What will you deliver, and in which formats?</h4><p>Ask for the exact list. Pseudocode alone is readable but hard to build on. A database for the disassembler your team already uses saves days of rework. If you run your own pipeline, ask whether you’ll get anything machine-readable. Devirt, for example, delivers an IDA database, annotated pseudocode, a full report, LLVM IR and API JSON, each with a coverage ledger. Use that as a reference point for the kind of list to expect, not as the only acceptable answer.</p><h4>3. How will I know the result is complete?</h4><p>This is the question most buyers skip, and the one that matters most. A software reverse engineering result is complete only against a scope agreed before the work starts, and a coverage ledger is how you check it.</p><p>A coverage ledger lists every unit in the agreed scope and records each one in one of four states:</p><ul><li><strong>Proven:</strong> there is verification evidence inside the declared scope.</li><li><strong>Runtime-dependent:</strong> a real input or environment state is needed to settle it.</li><li><strong>Unresolved:</strong> it was inspected and the evidence didn’t settle it.</li><li><strong>Permanently bounded:</strong> an explicit limit was agreed.</li></ul><p>The test you can run yourself is simple. Count the units in scope before the work, count them again in the <a href="https://devirt.re/research/devirtualization/coverage-is-a-contract?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=re-services">coverage ledger</a>, and check that the numbers match. Nothing should drop out of the count to make a result look better. If a provider can’t tell you how they’ll report this, you’ll be judging the result on how readable it looks, and readable isn’t the same as proven.</p><h4>4. What happens to the parts you can’t recover?</h4><p>Every serious provider will have parts they can’t fully recover, and an honest one says so up front. Ask whether those parts stay visible in the deliverable, how they’re labeled, and whether they still count towards the scope. Apriorit, for one, says openly on its service page that some goals may not be fully achievable. That’s the right attitude. The follow-up is how the shortfall is reported to you.</p><h4>5. What do you need from me to confirm authorization?</h4><p>A reputable software reverse engineering service asks about your rights to the file before it starts. Expect to confirm that you own the binary or are authorized to analyze it. Be wary of any provider that doesn’t ask, and of any provider that offers to remove licensing, defeat DRM or enable cheating. That’s a different business, and it puts you at risk too.</p><h4>6. What happens to my binary?</h4><p>Your file may contain trade secrets, customer data or unreleased code. Ask where the analysis runs, who can access the file, whether it’s ever used for anything else (training models, building a research library), and when it’s deleted. Get the answer in writing. Devirt’s own policy, as an example of a written answer: analysis is isolated, nothing is shared between customers, uploads are never used for training, and inputs are deleted after the artifacts are generated and verified.</p><h4>7. What if the work falls short?</h4><p>Ask what the quote commits to and what happens if the provider misses it. Some providers bill time regardless of outcome. Others tie delivery to a condition. Devirt’s Full and Deep packages, for instance, require at least 80% proven coverage of the protected functions in the agreed scope before they’re released as delivered. Whichever model you choose, you should know before you pay what counts as done and what happens to your money if it isn’t.</p><h3>Is it legal to hire someone to reverse engineer software?</h3><p>Whether hiring a software reverse engineering service is legal depends on your jurisdiction, the license for the software and the authorization behind the request. Take legal advice for a specific case; this guide isn’t legal advice. The <a href="https://www.eff.org/issues/coders/reverse-engineering-faq">EFF’s reverse engineering FAQ</a> is a useful starting point for the US. What you can control as a buyer is the provider’s intake. Reputable providers accept only binaries you own or are authorized to analyze, and they refuse work aimed at removing licensing, defeating DRM or enabling cheating.</p><h3>What changes when the software is protected?</h3><p>Protected software is a compiled program that a commercial protector such as VMProtect or Themida has packed, obfuscated or virtualized to resist analysis. It changes the buying decision more than any other single factor.</p><p>Packing compresses or encrypts code, and unpacking restores it. Virtualization goes further. It replaces a function’s instructions with bytecode for an interpreter built into the file. Run an ordinary decompiler on a virtualized function and you get a faithful description of the interpreter, not the logic you were trying to read. The process of recovering what each virtualized function computes is called devirtualization.</p><p>If you suspect your binary is protected, add two questions to the seven above. Does the provider support that protector, and does the deliverable distinguish between functions that were devirtualized and proven and functions that only look readable? A provider that offers “unpacking” for a virtualized binary may hand you something that still doesn’t show the logic.</p><h3>What a good result looks like</h3><p>A good software reverse engineering result answers the question you scoped, in a format your team can open, with evidence for each conclusion. In practice:</p><ul><li>The deliverable opens in your own tools without rebuilding anything.</li><li>The count of units in scope matches the count in the report.</li><li>Every unit carries a state, and the unproven ones are labeled as such instead of being left out.</li><li>The report tells you what it can’t tell you.</li></ul><p>If you want to see what the step before paid work can look like, Devirt publishes a <a href="https://devirt.re/assessment/sample?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=sre-services">synthetic sample assessment</a> that shows the estimated recovery, the proof plan and the scope boundaries, and notes that the delivered coverage ledger records the final evidence. There is also a separate guide on <a href="https://devirt.re/blog/evaluate-a-devirtualization-result-before-paying?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=sre-services">how to evaluate a devirtualization result before paying</a>.</p><h3>Red flags</h3><ul><li>A quote with a price but no scope.</li><li>No question about your authorization to analyze the file.</li><li>“We’ll recover the source code.” Nobody can.</li><li>No answer to “how will I know it’s complete?”</li><li>No written policy on what happens to your binary.</li><li>Offers to remove licensing or bypass protection for distribution.</li></ul><h3>Where Devirt fits</h3><p>Devirt is an automated service built for the protected end of this market: binaries whose functions a commercial protector has virtualized, along with ordinary native, .NET and JavaScript binaries. You upload a file you own or are authorized to analyze, get a free assessment and a written scope before any paid work, and receive tool-ready outputs with a coverage ledger for the full scope. Custom or unsupported virtual machines get a free feasibility review and a written quote. Details are on the <a href="https://devirt.re/binary-reverse-engineering?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=sre-services">software reverse engineering services page</a>, and prices are on <a href="https://devirt.re/pricing?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=sre-services">devirt.re/pricing</a>.</p><p>Whichever provider you pick, ask the seven questions. The answers tell you more than a portfolio does.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25b3c00fbb7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Decompiler Output: How to Tell If It's Actually Right]]></title>
            <link>https://medium.com/@devirt/ai-decompiler-output-how-to-tell-if-its-actually-right-4d53ae69a06b?source=rss-96a56c826e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d53ae69a06b</guid>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[decompiler]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[Devirt]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 05:24:47 GMT</pubDate>
            <atom:updated>2026-11-11T05:24:47.394Z</atom:updated>
            <content:encoded><![CDATA[<p>An AI decompiler is a large language model that turns assembly, or a classic decompiler’s pseudocode, into readable source-like code. In November 2026 you can get one as a plugin inside IDA Pro, Ghidra or Binary Ninja, as a model trained on compiled code, or as a hosted platform. The output usually looks better than anything a rules-based decompiler prints.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fi.ytimg.com%2Fvi%2FfLPV61qJuhY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f72ba16e16868844265f6683e7681c1a/href">https://medium.com/media/f72ba16e16868844265f6683e7681c1a/href</a></iframe><blockquote><strong><em>About Devirt:</em></strong><em> Devirt recovers the code that protectors such as VMProtect and Themida hide inside their own virtual machines, for files you own or are authorized to analyze. You get an IDA database and annotated pseudocode, with a ledger showing which functions were proven. If nothing is proven, you pay nothing. </em><a href="https://devirt.re/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=ai-decompiler"><em>Start with a free assessment</em></a><em>.</em></blockquote><p>That’s exactly the problem. Readable and correct are different properties, and an AI decompiler only promises the first one. This article gives you four questions to ask of any AI decompile before you rely on it, shows how one corner of the decompilation world already checks itself, and explains why AI decompilers go quiet when the code is VM-protected.</p><p>[IMAGE 1: the four proof states, as a diagram. Caption: “Every function in an AI decompile fits one of four states. Only one of them is proven.”]</p><h3>What an AI decompiler does</h3><p>An AI decompiler takes code a human can’t comfortably read and predicts the code a human would have written. Classic decompilers like Ghidra or Hex-Rays work from rules (the <a href="https://buttondown.com/devirt/archive/ai-decompiler-vs-ghidra-vs-devirtualization/">AI decompiler vs Ghidra</a> comparison goes through the difference side by side): control-flow analysis, type inference, pattern libraries. A language model works from examples. It has seen enormous amounts of source code and learns what readable code tends to look like.</p><p>So the AI decompiler renames sub_401A30 to parse_header, turns local_28 into buffer_len, collapses a goto ladder into a for loop, and writes a comment explaining what the function seems to do. RevEng.AI&#39;s research write-up on <a href="https://reveng.ai/blog/training-an-llm-to-decompile-assembly-code">AI models for decompiling assembly code</a> describes the appeal well: the output &quot;more closely resembles human-written source-code than existing rules-based decompilers.&quot;</p><p>Every one of those improvements is a prediction, though. Some are right. Some aren’t.</p><h3>Is AI good at decompiling?</h3><p>AI is good at making decompiled code readable and weak at guaranteeing it’s correct. A language model will rename variables, guess types and tidy control flow in seconds, and on simple, repetitive functions it can get remarkably close. In a 2025 write-up, a game-decompilation contributor reported that a model, tried in January 2025, <a href="https://macabeus.medium.com/game-decompilation-using-ai-4d47b65f8852">reached a 96% match against the target assembly on its first attempt</a>.</p><p>The same model can invent a field name that sounds right, merge two branches that only look alike, or misread an indirect call. The output doesn’t flag any of this. A wrong function and a right function come back with the same confident formatting.</p><p>People who use these tools daily say it plainly. In a Hacker News thread on <a href="https://news.ycombinator.com/item?id=42573232">using LLMs to traverse decompiler output</a>, one commenter put it as “off the shelf LLMs … do a pretty poor job with assembly.” NowSecure’s guide to <a href="https://www.nowsecure.com/blog/2025/01/29/decompiling-apps-with-ai-language-models/">decompiling apps with AI language models</a> warns about hallucinations and calls for human oversight. What none of them offer is a way to do that oversight.</p><h3>Why readable output isn’t the same as correct output</h3><p>Readable output is a claim about style. Correct output is a claim about behavior: given the same inputs, the reconstructed function does what the original binary does. An AI decompiler optimizes for the first and hopes for the second.</p><h4>Names and types the model invents</h4><p>A language model fills gaps with the most likely name. If a structure field is accessed at offset 0x18, the model may call it timeout because that&#39;s common in network code. It might be a retry count. The name then shapes how you read every line that touches it.</p><h4>Control flow it smooths over</h4><p>Models like tidy code. Two branches that differ by one condition can be folded into one. An early return that only fires on error can disappear in a “cleaned up” version. The result reads better and does something slightly different.</p><p>None of this is a reason to avoid AI decompilers. It’s a reason to sort their output before trusting it.</p><h3>A four-state check for any AI decompile</h3><p>The four-state check sorts every function in an AI decompile into proven, runtime-dependent, unresolved or permanently bounded. It’s borrowed from how Devirt reports devirtualization results, where every function in scope must land in exactly one state and an unproven function stays in the count instead of quietly disappearing. Applied to any AI decompile, the four states stop a readable function from being treated as a correct one.</p><p>Ask these four questions of each function you plan to rely on:</p><p><strong>1. Is it proven?</strong> A function is proven when a check supports the stated behavior within a declared scope. For an AI decompile that might be a recompile-and-diff, a test harness comparing outputs on the same inputs, or an equivalence check. In Devirt’s model, a solver searches for a counterexample under the stated model, and finding none supports equivalence within that scope. If nothing has checked it, it isn’t proven, however clean it reads.</p><p><strong>2. Is it runtime-dependent?</strong> Some behavior can’t be settled from the code alone: values loaded at runtime, environment checks, data from the network. The function needs runtime evidence before you treat its reconstruction as settled, which is what <a href="https://devirt.re/research/devirtualization/runtime-dependent-functions?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=ai-decompiler">runtime-dependent functions</a> means in a recovery report.</p><p><strong>3. Is it unresolved?</strong> You looked, and the available evidence didn’t establish what the function does. Write that down. An unresolved function marked as unresolved is useful. An unresolved function hidden behind a confident AI rename is a trap.</p><p><strong>4. Is it permanently bounded?</strong> The question sits outside what your method can model. Say so, and stop asking the AI decompiler to answer it.</p><p>[IMAGE 2: the check as a table. Text version below.]</p><ul><li><strong>Proven:</strong> a check supports the stated behavior within a declared scope. Rely on it, within that scope.</li><li><strong>Runtime-dependent:</strong> it needs runtime evidence. Run it, trace it, or treat it as provisional.</li><li><strong>Unresolved:</strong> the evidence didn’t establish the behavior. Don’t build conclusions on it.</li><li><strong>Permanently bounded:</strong> it’s outside the method’s model. Record the limit and move on.</li></ul><p>The useful habit is the count. If an AI decompile covers 120 functions and you’ve proven 30 of them, the honest summary is “30 proven, 90 not yet”, never “decompiled”. Devirt’s own <a href="https://devirt.re/research/devirtualization/runtime-dependent-functions">explainer on runtime-dependent, unresolved and bounded functions</a> works through a synthetic ledger of 100 operations, 86 proven, 7 runtime-dependent, 2 unresolved and 5 permanently bounded, to show why every function stays in the total.</p><h3>How matching decompilation checks itself</h3><p>Matching decompilation is a corner of decompilation that already has a built-in correctness check. In game-decompilation projects, the goal is C code that compiles to exactly the same assembly as the original. Tools like decomp.me show a “% match”: how close your recompiled output is to the target, function by function.</p><p>That’s why the 96% first-try result above means something. It’s measured. And it shows the gap: 96% isn’t 100%, and the last few percent are usually the subtle parts.</p><p>The lesson carries over. An AI decompiler is safest when its output is compared against something it can’t talk its way past: the original assembly, the original binary’s behavior, or a formal check. RevEng.AI makes the same point about its own evaluation, which relies on “simple pass/fail testing”, and lists “semantic correctness feedback” as future work.</p><h3>What an AI decompiler sees on VM-protected code</h3><p>An AI decompiler can’t read the original logic of a VM-protected function. Protectors such as VMProtect and Themida compile the protected function into bytecode for their own private virtual machine. What’s left in the binary is an interpreter: a dispatcher loop and a set of handlers.</p><p>Point an AI decompiler at that and it does its job faithfully. It explains the interpreter. You get a clean, well-commented description of a dispatcher, which tells you nothing about what the protected function computes.</p><p>[IMAGE 3: dispatcher and handlers sketch. Caption: “On a VM-protected function, the decompiler and the model both see the interpreter, not the logic.”]</p><p>Devirt’s page on <a href="https://devirt.re/ai-reverse-engineering">AI reverse engineering for protected binaries</a> says it directly: on virtualized code the agent “sees a dispatcher and handlers instead of the logic.” The function has to be devirtualized before an AI decompiler, or an analyst, can read what it does. More model capacity doesn’t fix this. There’s no original logic left to read until the virtual machine layer is removed.</p><h3>Where a verified result fits in an AI workflow</h3><p>The practical pattern is to let the AI decompiler do what it’s good at and keep verification as a separate step with its own record.</p><ol><li>Use the AI decompiler for orientation: naming, summarizing, finding the functions that matter.</li><li>Pick the functions your conclusion depends on.</li><li>Check those functions and record each one’s state.</li><li>Where a function is VM-protected, recover it first, then let the model explain the recovered code.</li></ol><p>That last step is where a verified handoff helps. Devirt recovers the protected scope of a file you own or are authorized to analyze and returns every in-scope function in one of the four states, with a coverage ledger an agent can read through a read-only MCP connection. Your model keeps doing the explaining. The difference is that it explains checked facts instead of a confident guess.</p><h3>Is it illegal to decompile?</h3><p>Decompiling software isn’t illegal everywhere, and it isn’t always allowed. Whether it’s permitted depends on the jurisdiction, the software license and the purpose, and using an AI decompiler doesn’t change that legal question. Devirt, for example, accepts files only when you own them or are authorized to analyze them, for purposes such as security research, malware analysis and interoperability, and refuses DRM removal and license bypass. Read the license, and get legal advice when it matters.</p><h3>The short version</h3><ul><li>An AI decompiler makes code readable. It doesn’t make it correct.</li><li>Sort every function you rely on into proven, runtime-dependent, unresolved or permanently bounded, and keep the count honest.</li><li>Use self-checking setups, like recompile-and-diff, wherever they exist.</li><li>On VM-protected code, the AI decompiler is reading the interpreter. Recover the function first.</li></ul><p>If you work with protected binaries and want your AI tools to read checked results rather than guesses, Devirt’s <a href="https://devirt.re/ai-reverse-engineering">AI reverse engineering page</a> explains how the read-only handoff works, and its free triage tells you what’s protected before you commit to anything.</p><p>— -</p><p><em>Devirt recovers protected code for files you own or are authorized to analyze. We don’t remove DRM, bypass license checks or crack software.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d53ae69a06b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Polymorphic Code: How It Works and How Analysts Catch It]]></title>
            <link>https://medium.com/@devirt/polymorphic-code-how-it-works-and-how-analysts-catch-it-1bdf4480850a?source=rss-96a56c826e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/1bdf4480850a</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[threat-detection]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <dc:creator><![CDATA[Devirt]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 04:28:39 GMT</pubDate>
            <atom:updated>2026-11-10T04:28:39.992Z</atom:updated>
            <content:encoded><![CDATA[<p>Polymorphic code is code that changes its own appearance every time it runs or spreads while doing exactly the same thing. The idea is old: the first known polymorphic virus, 1260, was written in 1990. MITRE ATT&amp;CK now tracks the technique as sub-technique <a href="https://attack.mitre.org/techniques/T1027/014/">T1027.014, Polymorphic Code</a>, under Obfuscated Files or Information.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fi.ytimg.com%2Fvi%2FfLPV61qJuhY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f72ba16e16868844265f6683e7681c1a/href">https://medium.com/media/f72ba16e16868844265f6683e7681c1a/href</a></iframe><blockquote><strong><em>About Devirt:</em></strong><em> Devirt recovers the code that protectors such as VMProtect and Themida hide inside their own virtual machines, for files you own or are authorized to analyze. You get an IDA database and annotated pseudocode, with a ledger showing which functions were proven. If nothing is proven, you pay nothing. </em><a href="https://devirt.re/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=polymorphic-code"><em>Start with a free assessment</em></a><em>.</em></blockquote><p>For defenders, polymorphic code is mostly a problem for one kind of detection: matching known byte patterns. This post explains how polymorphic code works, what an example looks like, how it differs from metamorphic and VM-protected code, and how analysts and detection tools see through it.</p><h3>What is polymorphic code?</h3><p>Polymorphic code is code that rewrites its own form for each copy or each execution while keeping its behavior identical. The usual design encrypts the main body of the code and pairs it with a small decryption routine. The body stays the same underneath, but the decryptor is regenerated with different instructions for every copy, so no two copies share the same bytes.</p><p>“Polymorphic” simply means “many forms”. In object-oriented programming the word means something unrelated (one interface, many implementations). In security it always refers to self-changing code.</p><h3>How does polymorphic code work?</h3><p>Polymorphic code works in two parts: an encrypted body and a decryptor that changes. As the <a href="https://en.wikipedia.org/wiki/Polymorphic_code">Wikipedia article on polymorphic code</a> puts it, encryption alone is not polymorphism. A fixed decryptor would be one stable pattern to detect. Polymorphism comes from mutating the encryptor and decryptor pair with each copy.</p><p>The component that produces those variations is called a polymorphic engine or mutation engine. It generates decryptors that are equivalent in effect but different in form: different registers, different instruction choices, different order, and filler instructions that do nothing. When a copy runs, its decryptor restores the same body in memory and hands over control.</p><h3>What is an example of polymorphic code?</h3><p>An example of polymorphic code is a program whose body is stored encrypted and whose small decryptor is regenerated with different but equivalent instructions in each copy. One copy might add a value to a register, another subtract its negative, a third insert do-nothing instructions in between. Every copy decrypts to the same body and behaves identically, yet a byte-pattern signature written for one copy misses the next.</p><p>The best-known historical examples are viruses. After 1260 in 1990, the virus writer known as Dark Avenger built a mutation engine (MtE) into his viruses in 1992 so that antivirus programs couldn’t recognise their signatures. The file infector Virut is another common example. MITRE lists the malware BendyBear as a procedure example that changes its runtime footprint during execution to evade signature-based defenses.</p><h3>Why does signature-based detection miss polymorphic code?</h3><p>Signature-based detection misses polymorphic code because signatures match fixed byte patterns, and polymorphic code removes them. Each copy has a different decryptor and a differently encrypted body, so a file hash or a byte string taken from one copy matches nothing in the next. A detection rule has to target something that does not change, and in the file on disk almost nothing does.</p><p>That is why MITRE’s mitigation for T1027.014 points to anti-malware that uses machine learning and behavior-based detection, rather than relying on indicator-based matching alone.</p><h3>How is polymorphic code different from metamorphic code?</h3><p>Polymorphic code and metamorphic code differ in what stays constant. Polymorphic code changes its decryptor but decrypts to the same body every time, so running it in an emulator or sandbox exposes a constant payload. Metamorphic code rewrites its entire body for each copy and has no constant decrypted form, which makes it harder to catch even after it runs. MITRE ATT&amp;CK groups both terms under T1027.014, but analysts treat them as different problems.</p><p>A third case is often confused with both: <strong>VM-protected code</strong>. Code virtualization, offered by protectors such as VMProtect and Themida, converts selected functions into bytecode for a private virtual machine. The bytecode can be identical in every copy, so it isn’t polymorphic. But it never turns back into native instructions, so a sandbox dump shows the virtual machine’s interpreter rather than the logic.</p><p>Put side by side:</p><ul><li><strong>Polymorphic:</strong> the decryptor changes, the body is constant once decrypted. Analysts let it decrypt and read the body.</li><li><strong>Metamorphic:</strong> the whole body changes, with no constant form. Analysts rely on behavior and on normalizing the code.</li><li><strong>VM-protected:</strong> the bytecode may be constant, but it never becomes native code. Analysts need to trace the virtual machine or translate the bytecode back, which is called devirtualization.</li></ul><p>The <a href="https://devirt.re/blog/devirtualization-vs-deobfuscation-vs-unpacking?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=polymorphic-code">comparison of devirtualization, deobfuscation and unpacking</a> covers why that third case needs its own tools.</p><h3>How do analysts detect polymorphic code?</h3><p>Analysts detect polymorphic code by looking at behavior and decrypted content rather than raw bytes. Running the sample in an emulator or sandbox lets it decrypt itself so the constant body can be scanned. MITRE ATT&amp;CK’s detection strategy for T1027.014 looks for executables whose hash, entropy or memory sections change during or between executions.</p><p>Defenders usually combine all three of these:</p><ul><li><strong>Emulation and sandboxing</strong> let the polymorphic layer do its work, then inspect what it produced.</li><li><strong>Behavioral detection</strong> keys on what the code does, which polymorphism doesn’t change.</li><li><strong>Detections written on the decrypted body or on behavior</strong>, not on the file’s bytes, hold up across copies.</li></ul><p>Reverse engineers treat the decryptor as noise. The interesting analysis starts once the body is in memory, and that body is the same in every copy.</p><h3>Is polymorphic code ever legitimate?</h3><p>Polymorphic techniques have legitimate uses in software protection and security testing. Commercial protectors apply related transformations, such as code mutation, to make licensed software harder to tamper with. Security teams also generate variants of known samples to check whether a detection product relies too heavily on signatures. The same techniques are used by malware, which is why they are tracked in MITRE ATT&amp;CK.</p><h3>Further reading</h3><ul><li><a href="https://devirt.re/blog/devirtualization-vs-deobfuscation-vs-unpacking?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=polymorphic-code">Devirtualization vs deobfuscation vs unpacking</a>: three kinds of protection and what removes each</li><li><a href="https://devirt.re/research/devirtualization?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=polymorphic-code">Devirtualization methods</a>: how VM-protected code is recovered</li></ul><p><em>Written by Devirt, an automated devirtualization service for authorized analysis of protected software.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1bdf4480850a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is Code Obfuscation? Techniques and How They're Undone]]></title>
            <link>https://medium.com/@devirt/what-is-code-obfuscation-techniques-and-how-theyre-undone-376706fb1dfd?source=rss-96a56c826e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/376706fb1dfd</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[software-security]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Devirt]]></dc:creator>
            <pubDate>Tue, 10 Nov 2026 04:27:23 GMT</pubDate>
            <atom:updated>2026-11-10T04:27:23.232Z</atom:updated>
            <content:encoded><![CDATA[<p>Code obfuscation is the practice of rewriting a program so it behaves exactly the same but is much harder for a person or an analysis tool to understand. Christian Collberg, Clark Thomborson and Douglas Low formalized the idea in 1997, defining an obfuscating transformation as one that keeps a program’s observable behavior while making it harder to understand, and sorting such transformations into four categories: layout, data, control and preventive.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fi.ytimg.com%2Fvi%2FfLPV61qJuhY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f72ba16e16868844265f6683e7681c1a/href">https://medium.com/media/f72ba16e16868844265f6683e7681c1a/href</a></iframe><blockquote><strong><em>About Devirt:</em></strong><em> Devirt recovers the code that protectors such as VMProtect and Themida hide inside their own virtual machines, for files you own or are authorized to analyze. You get an IDA database and annotated pseudocode, with a ledger showing which functions were proven. If nothing is proven, you pay nothing. </em><a href="https://devirt.re/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=code-obfuscation"><em>Start with a free assessment</em></a><em>.</em></blockquote><p>Developers obfuscate to protect license checks and proprietary logic. Malware authors use the same techniques to hide what their code does. This guide covers the main obfuscation techniques, what each one does to a program, how analysts work through it, and the one technique that ordinary deobfuscation can’t remove.</p><h3>What is code obfuscation?</h3><p>Code obfuscation is a transformation that changes how a program looks without changing what it does. The output of an obfuscated program is identical to the original for every input. Only the readability changes: names, strings, the order of instructions and the shape of the control flow are rewritten so that a reader, or a tool such as a decompiler, has a harder job.</p><p>Collberg’s 1997 <a href="https://hdl.handle.net/2292/3491">taxonomy of obfuscating transformations</a> is still the cleanest way to group them:</p><ul><li><strong>Layout obfuscation</strong> removes or scrambles information that only humans use: identifier names, comments, formatting.</li><li><strong>Data obfuscation</strong> changes how values are stored: encoded strings, split variables, unusual encodings for constants.</li><li><strong>Control obfuscation</strong> changes how execution flows: fake branches, flattened control flow, inserted dead code.</li><li><strong>Preventive obfuscation</strong> targets specific analysis tools, so a decompiler or deobfuscator produces wrong or broken output.</li></ul><h3>Why do developers obfuscate code?</h3><p>Developers obfuscate code to make reverse engineering slower and more expensive. Typical reasons are protecting licensing and anti-tamper logic, keeping proprietary algorithms out of competitors’ hands, and hiding API keys or protocol details in client applications. Mobile and JavaScript developers often obfuscate as a matter of routine, because their code ships to users in a form that is easy to inspect.</p><p>Malware authors use code obfuscation for the opposite reason. Obfuscation hides the strings, network addresses and logic that defenders would otherwise turn into detection rules. MITRE ATT&amp;CK tracks this family of behavior as <a href="https://attack.mitre.org/techniques/T1027/">T1027, Obfuscated Files or Information</a>. The techniques are the same in both cases. Only the intent differs.</p><h3>Source code obfuscation vs compiled binaries</h3><p>Code obfuscation works differently on source code and on compiled programs. For interpreted languages such as JavaScript or Python, obfuscation rewrites the source itself: identifiers become meaningless, whitespace disappears and strings are encoded. For compiled native programs, obfuscators work on machine code or an intermediate representation, inserting junk instructions, rewriting arithmetic and restructuring control flow. Names are usually already gone after compilation, so binary obfuscation targets structure rather than identifiers.</p><h3>What is an example of code obfuscation?</h3><p>A simple example of code obfuscation is renaming a function called checkLicense to a meaningless name like a1 and storing its error message as encrypted bytes that are decoded only at runtime. The program behaves exactly as before, but a reader can no longer tell from names or visible strings what the function does.</p><h3>The main obfuscation techniques, and what undoes each one</h3><p>Each code obfuscation technique below does something specific to a program, and each one has a matching analyst response. The responses are described conceptually, so read this as a map of the territory rather than a set of instructions.</p><h4>Identifier renaming</h4><p>Identifier renaming replaces meaningful names with short or random ones. It is permanent in the sense that the original names are gone, but it rarely stops an analyst for long: behavior, call patterns and library calls reveal what a function does, and analysts rename as they go.</p><h4>String encryption</h4><p>String encryption stores text such as error messages, URLs and file paths in encoded or encrypted form and decodes it only when needed. Analysts recover the strings by locating the decoding routine and running it, or by letting the program decode them at runtime and reading memory.</p><h4>Dead code and junk instructions</h4><p>Dead code and junk instructions add work that has no effect or never runs. Compiler-style optimization passes and data-flow analysis strip most of it, because code whose result is never used can be proven irrelevant.</p><h4>Opaque predicates</h4><p>Opaque predicates are conditions whose outcome the obfuscator knows in advance, but which an analyzer can only work out with difficulty, as Collberg and colleagues described them in 1997. They create fake branches that never run. Analysts resolve them with symbolic reasoning or by observing which branches actually execute.</p><h4>Control-flow flattening</h4><p>Control-flow flattening routes every block of a function through a single dispatcher, so the original order of the blocks disappears. In 2005, Sharath Udupa, Saumya Debray and Matias Madou showed that <a href="https://www2.cs.arizona.edu/~debray/Publications/unflatten.pdf">combining static and dynamic analysis</a> defeats much of the effect of flattening, by recovering which block really follows which.</p><h4>Mixed boolean-arithmetic</h4><p>Mixed boolean-arithmetic (MBA) expressions replace simple operations such as an addition with long equivalent formulas that mix arithmetic and bitwise operators. Analysts simplify them with algebraic simplification tools and solvers that prove the long form equals the short one.</p><h4>Code virtualization</h4><p>Code virtualization converts selected functions into bytecode for a private virtual machine that the protector embeds in the program. Commercial protectors such as VMProtect, Themida and Code Virtualizer offer it alongside the techniques above. It behaves differently from every other technique on this list.</p><h3>Which obfuscation is hardest to undo?</h3><p>Code virtualization is the hardest obfuscation to undo because it converts selected functions into bytecode for a private virtual machine embedded in the program. As Rolf Rolles showed in his <a href="https://www.usenix.org/legacy/event/woot09/tech/full_papers/rolles.pdf">2009 paper on virtualization obfuscators</a>, virtualized code is never restored to native instructions while the program runs. Unpacking doesn’t help and simplification doesn’t help, because there is no native version of the function to recover. The bytecode has to be translated back, a job called devirtualization.</p><p>A decompiler pointed at a virtualized function shows the virtual machine’s interpreter (a dispatcher loop and dozens of small handlers) rather than the function’s logic. The <a href="https://devirt.re/blog/devirtualization-vs-deobfuscation-vs-unpacking?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=code-obfuscation">comparison of devirtualization, deobfuscation and unpacking</a> explains why each job needs different tools.</p><h3>What can’t code obfuscation do?</h3><p>Code obfuscation raises the cost of understanding a program but does not make it impossible. Collberg and colleagues framed obfuscation in 1997 as making a program harder, not impossible, to understand, and most common techniques can be reversed by program analysis. Virtualization is the exception that needs its own job, devirtualization.</p><p>For software owners, that has three practical consequences:</p><ul><li><strong>Obfuscation buys time.</strong> Treat it as a delay, and keep real secrets such as keys off the client entirely.</li><li><strong>Layers matter.</strong> Renaming alone stops almost nobody. Combined techniques, with virtualization on the most sensitive functions, raise the cost the most.</li><li><strong>Obfuscation is not encryption.</strong> Encrypted data is unreadable without a key. Obfuscated code still runs, so it can always be observed.</li></ul><h3>Can AI understand obfuscated code?</h3><p>AI models can deobfuscate some obfuscated code but not reliably. In a <a href="https://arxiv.org/abs/2505.19887">2025 evaluation posted on arXiv</a>, Anton Tkachenko, Dmitrij Suskevic and Benjamin Adolphi tested seven commercial large language models on obfuscated assembly and found results ranging from autonomous deobfuscation to complete failure, with every model failing against combined techniques.</p><p>In day-to-day work, AI assistants help with renaming, string decoding and explaining small routines. They struggle where obfuscation stacks several techniques, or hides the logic in a virtual machine.</p><h3>Is deobfuscation legal?</h3><p>Deobfuscation itself is a neutral analysis technique, and whether a specific case is legal depends on your rights to the software, the license you accepted and the law where you work. Security researchers deobfuscate malware routinely, while deobfuscating someone else’s commercial software to copy it or bypass its licensing can break both the license and the law. This is general information, not legal advice.</p><h3>Further reading</h3><ul><li><a href="https://devirt.re/blog/devirtualization-vs-deobfuscation-vs-unpacking?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=code-obfuscation">Devirtualization vs deobfuscation vs unpacking</a>: the three jobs compared, with sources</li><li><a href="https://devirt.re/research/devirtualization?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=code-obfuscation">Devirtualization methods</a>: how virtualized code is recovered and what can be proven</li></ul><p><em>Written by Devirt, an automated devirtualization service for authorized analysis of protected software.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=376706fb1dfd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Malware Reverse Engineering on VM-Protected Samples]]></title>
            <link>https://medium.com/@devirt/malware-reverse-engineering-on-vm-protected-samples-61baf05eecd5?source=rss-96a56c826e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/61baf05eecd5</guid>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[Devirt]]></dc:creator>
            <pubDate>Mon, 09 Nov 2026 07:21:01 GMT</pubDate>
            <atom:updated>2026-11-09T07:21:01.097Z</atom:updated>
            <content:encoded><![CDATA[<p>Malware reverse engineering on a VM-protected sample is the job of recovering logic that the author deliberately moved out of the processor’s instruction set and into a private one. MITRE ATT&amp;CK files this under sub-technique T1027.002, Software Packing, and its procedure examples name VMProtect and Themida in use by tracked groups such as APT41 and APT38.Malware reverse engineering on a VM-protected sample is the job of recovering logic that the author deliberately moved out of the processor’s instruction set and into a private one. MITRE ATT&amp;CK files this under sub-technique T1027.002, Software Packing, and its procedure examples name VMProtect and Themida in use by tracked groups such as APT41 and APT38.</p><p>The good news comes from a June 2024 study by ANY.RUN: in samples from five malware families protected with Themida or VMProtect, none used code virtualization. So the first skill is telling the two situations apart. This guide covers what a virtualized function looks like, why decompilers fail on it, and how to choose your next step.</p><h3>Why does VM-protected malware defeat a decompiler?</h3><p>VM-protected malware defeats a decompiler because code virtualization rewrites selected functions as bytecode for a private virtual machine embedded in the sample. Decompilers such as IDA’s Hex-Rays and Ghidra are built for real instruction sets like x86 and x64, so on a virtualized function they show the virtual machine’s interpreter, not the malware’s logic.</p><p>The <a href="https://docs.hex-rays.com/core/decompiler/specification">Hex-Rays decompiler specification</a> lists one decompiler per processor family (x86, x64, ARM and others) and states that it handles compiler-generated code. A virtualized function isn’t that. It’s data, read and executed by an interpreter the protector wrote, using an instruction set the protector designed, not the processor’s.</p><h3>What does the disassembler show?</h3><p>In a VM-protected malware sample, the disassembler shows a dispatcher loop that fetches the next bytecode instruction, decodes it and jumps to one of dozens of small handler routines. Each handler performs one virtual operation, so the malware’s real logic is spread across bytecode data and handler calls rather than visible as one readable function.</p><h4>The dispatcher loop</h4><p>The dispatcher is the interpreter’s main loop. It keeps a virtual instruction pointer, reads an opcode from the bytecode stream, often decrypts it, and uses it to pick a handler. In the graph view it looks like a hub with spokes to every handler, and every handler jumps back to the hub.</p><h4>Handlers and bytecode</h4><p>Each handler does something tiny: push a value onto the virtual stack, add two values, load from memory. A single line of the original C, such as checking whether a C2 response starts with a magic value, can turn into dozens of handler executions. The bytecode is ordinary data in a section, so static strings and cross-references that would normally lead you to the interesting code aren’t there.</p><p>[[IMG:dispatcher-vs-recovered]]</p><h3>Why do malware authors use commercial VM protection?</h3><p>Malware authors use commercial VM protectors for the same reason software vendors do: to make analysis slow and expensive. MITRE’s <a href="https://attack.mitre.org/techniques/T1027/002/">T1027.002 page</a> describes virtual machine software protection as translating “an executable’s original code into a special format that only a special virtual machine can run”. It lists procedure examples including APT41 using VMProtect to slow reverse engineering, and APT38 packing implants with Themida, Enigma, VMProtect and Obsidium.</p><p>Using an off-the-shelf protector is cheap for the author, and on the defender’s side it tends to set off a predictable chain: the sample looks hostile, signatures miss it, and the analyst assumes the hardest case before checking.</p><h3>Does every protected sample need devirtualization?</h3><p>Not every protected malware sample needs devirtualization. In a study published on 18 June 2024, ANY.RUN examined Themida- and VMProtect-protected samples from five malware families (Arkei, RisePro, PrivateLoader, Amadey and Lumma) and found that none of the samples used the protectors’ code virtualization. The protectors were used much like basic packers.</p><p><a href="https://any.run/cybersecurity-blog/vmprotect-themida-malware-analysis/">ANY.RUN’s write-up</a> concludes that the real obstacles were string obfuscation and C2 concealment written into the malware itself. Lumma, for example, added control-flow flattening. So check before you plan:</p><ol><li>Does the protector’s virtual machine run any of the functions you need? Look for the dispatcher pattern around your targets, not just a protector signature on the file.</li><li>If the code you need appears in a memory dump after the stub runs, it was packed, not virtualized.</li><li>If your target functions still enter the interpreter after unpacking, they are virtualized.</li></ol><h3>Is unpacking enough?</h3><p>Unpacking is enough for a packed malware sample but not for a virtualized one. Unpacking restores code that a packer compressed or encrypted, so the original x86 or x64 instructions reappear in memory. Virtualized functions were translated into a private bytecode before the sample was shipped, so after unpacking they still run inside the protector’s virtual machine and still need devirtualization or dynamic tracing.</p><p>That’s why “I dumped it and IDA still shows garbage” is such a common complaint. The dump worked. The functions you care about were never x86 in the first place.</p><h3>Your options: unpack, trace, devirtualize or bound the result</h3><p>Once you know which case you have, there are four ways forward. Most real cases combine them.</p><ul><li><strong>Unpack</strong>: When it fits: The code is compressed or encrypted, not virtualized. What you get: The original instructions, readable in IDA or Ghidra. What it costs you: Low; standard dump and import rebuild.</li><li><strong>Trace dynamically</strong>: When it fits: You need behavior fast, and the virtualized code runs in your lab. What you get: What the code did on this run, under this environment. What it costs you: Misses dormant branches and anything gated on input, keys or environment.</li><li><strong>Devirtualize</strong>: When it fits: Target functions are virtualized and you need their full logic. What you get: Recovered functions as readable code or an IDA database. What it costs you: Time by hand, or an automated service for supported protectors.</li><li><strong>Bound the result</strong>: When it fits: Some functions can’t be recovered with the evidence available. What you get: An explicit list of what stayed open. What it costs you: Nothing hidden; your report states its limits.</li></ul><p>[[IMG:protected-sample-decision]]</p><p>Devirtualization by hand means mapping the handlers, writing a lifter for that protected build’s instruction set and validating the output. It’s well documented in research but slow per sample. Automated services cover the supported protectors. Devirt, for example, returns an authorized sample’s recovered functions as an IDA database, annotated pseudocode, a full RE report or API JSON, and an unfamiliar build can start with a free assessment. Its <a href="https://devirt.re/use-cases/malware-analysts?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=re-malware">page for malware analysts</a> covers how samples are scoped.</p><h3>How sure can you be about recovered code?</h3><p>Recovered malware code is only as useful as the evidence behind it. Devirt’s coverage ledger places every in-scope function in one of four states: proven, runtime-dependent, unresolved or permanently bounded. For malware, the runtime-dependent state matters most, because behavior that depends on a real input, key or environment stays marked as open instead of disappearing from the incident note.</p><p>Whatever tool you use, apply the same discipline to your own notes:</p><ul><li><strong>Proven:</strong> you can show the recovered logic matches what the sample does.</li><li><strong>Runtime-dependent:</strong> it depends on something you don’t have, such as the C2’s response or a victim-specific key.</li><li><strong>Unresolved:</strong> you couldn’t recover it with what you have.</li><li><strong>Bounded:</strong> you know why it can’t be recovered, and you’ve said so.</li></ul><p>The article on <a href="https://devirt.re/research/devirtualization/runtime-dependent-functions?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=re-malware">runtime-dependent, unresolved and bounded functions</a> goes through each state with examples.</p><h3>Handle live samples like live samples</h3><p>Everything above assumes the sample runs only in an isolated lab: a virtual machine with no route to production, snapshots you can roll back, and no shared folders. If you send a sample to any outside service, check where it runs, whether it’s shared or used for training, and when the input is deleted. Devirt, for one, publishes that uploads run in an isolated environment, aren’t shared between customers or used for training, and that input deletion starts once the output is ready.</p><h3>Next steps</h3><ul><li>Writing up the result? See the <a href="https://dev.to/devirt/malware-reverse-engineering-what-your-soc-should-get-back-353h">SOC deliverable checklist</a> on DEV.</li><li>Have a protected sample to scope? Start on <a href="https://devirt.re/use-cases/malware-analysts?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=re-malware">Devirt’s malware analyst page</a>.</li></ul><p><em>Written by Devirt, an automated devirtualization service for authorized analysis of protected software. Defensive analysis only: deploying or improving malware is prohibited under Devirt’s acceptable use policy.</em></p><p>The good news comes from a June 2024 study by ANY.RUN: in samples from five malware families protected with Themida or VMProtect, none used code virtualization. So the first skill is telling the two situations apart. This guide covers what a virtualized function looks like, why decompilers fail on it, and how to choose your next step.</p><h3>Why does VM-protected malware defeat a decompiler?</h3><p>VM-protected malware defeats a decompiler because code virtualization rewrites selected functions as bytecode for a private virtual machine embedded in the sample. Decompilers such as IDA’s Hex-Rays and Ghidra are built for real instruction sets like x86 and x64, so on a virtualized function they show the virtual machine’s interpreter, not the malware’s logic.</p><p>The <a href="https://docs.hex-rays.com/core/decompiler/specification">Hex-Rays decompiler specification</a> lists one decompiler per processor family (x86, x64, ARM and others) and states that it handles compiler-generated code. A virtualized function isn’t that. It’s data, read and executed by an interpreter the protector wrote, using an instruction set the protector designed, not the processor’s.</p><h3>What does the disassembler show?</h3><p>In a VM-protected malware sample, the disassembler shows a dispatcher loop that fetches the next bytecode instruction, decodes it and jumps to one of dozens of small handler routines. Each handler performs one virtual operation, so the malware’s real logic is spread across bytecode data and handler calls rather than visible as one readable function.</p><h4>The dispatcher loop</h4><p>The dispatcher is the interpreter’s main loop. It keeps a virtual instruction pointer, reads an opcode from the bytecode stream, often decrypts it, and uses it to pick a handler. In the graph view it looks like a hub with spokes to every handler, and every handler jumps back to the hub.</p><h4>Handlers and bytecode</h4><p>Each handler does something tiny: push a value onto the virtual stack, add two values, load from memory. A single line of the original C, such as checking whether a C2 response starts with a magic value, can turn into dozens of handler executions. The bytecode is ordinary data in a section, so static strings and cross-references that would normally lead you to the interesting code aren’t there.</p><p>[[IMG:dispatcher-vs-recovered]]</p><h3>Why do malware authors use commercial VM protection?</h3><p>Malware authors use commercial VM protectors for the same reason software vendors do: to make analysis slow and expensive. MITRE’s <a href="https://attack.mitre.org/techniques/T1027/002/">T1027.002 page</a> describes virtual machine software protection as translating “an executable’s original code into a special format that only a special virtual machine can run”. It lists procedure examples including APT41 using VMProtect to slow reverse engineering, and APT38 packing implants with Themida, Enigma, VMProtect and Obsidium.</p><p>Using an off-the-shelf protector is cheap for the author, and on the defender’s side it tends to set off a predictable chain: the sample looks hostile, signatures miss it, and the analyst assumes the hardest case before checking.</p><h3>Does every protected sample need devirtualization?</h3><p>Not every protected malware sample needs devirtualization. In a study published on 18 June 2024, ANY.RUN examined Themida- and VMProtect-protected samples from five malware families (Arkei, RisePro, PrivateLoader, Amadey and Lumma) and found that none of the samples used the protectors’ code virtualization. The protectors were used much like basic packers.</p><p><a href="https://any.run/cybersecurity-blog/vmprotect-themida-malware-analysis/">ANY.RUN’s write-up</a> concludes that the real obstacles were string obfuscation and C2 concealment written into the malware itself. Lumma, for example, added control-flow flattening. So check before you plan:</p><ol><li>Does the protector’s virtual machine run any of the functions you need? Look for the dispatcher pattern around your targets, not just a protector signature on the file.</li><li>If the code you need appears in a memory dump after the stub runs, it was packed, not virtualized.</li><li>If your target functions still enter the interpreter after unpacking, they are virtualized.</li></ol><h3>Is unpacking enough?</h3><p>Unpacking is enough for a packed malware sample but not for a virtualized one. Unpacking restores code that a packer compressed or encrypted, so the original x86 or x64 instructions reappear in memory. Virtualized functions were translated into a private bytecode before the sample was shipped, so after unpacking they still run inside the protector’s virtual machine and still need devirtualization or dynamic tracing.</p><p>That’s why “I dumped it and IDA still shows garbage” is such a common complaint. The dump worked. The functions you care about were never x86 in the first place.</p><h3>Your options: unpack, trace, devirtualize or bound the result</h3><p>Once you know which case you have, there are four ways forward. Most real cases combine them.</p><ul><li><strong>Unpack</strong>: When it fits: The code is compressed or encrypted, not virtualized. What you get: The original instructions, readable in IDA or Ghidra. What it costs you: Low; standard dump and import rebuild.</li><li><strong>Trace dynamically</strong>: When it fits: You need behavior fast, and the virtualized code runs in your lab. What you get: What the code did on this run, under this environment. What it costs you: Misses dormant branches and anything gated on input, keys or environment.</li><li><strong>Devirtualize</strong>: When it fits: Target functions are virtualized and you need their full logic. What you get: Recovered functions as readable code or an IDA database. What it costs you: Time by hand, or an automated service for supported protectors.</li><li><strong>Bound the result</strong>: When it fits: Some functions can’t be recovered with the evidence available. What you get: An explicit list of what stayed open. What it costs you: Nothing hidden; your report states its limits.</li></ul><p>[[IMG:protected-sample-decision]]</p><p>Devirtualization by hand means mapping the handlers, writing a lifter for that protected build’s instruction set and validating the output. It’s well documented in research but slow per sample. Automated services cover the supported protectors. Devirt, for example, returns an authorized sample’s recovered functions as an IDA database, annotated pseudocode, a full RE report or API JSON, and an unfamiliar build can start with a free assessment. Its <a href="https://devirt.re/use-cases/malware-analysts?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=re-malware">page for malware analysts</a> covers how samples are scoped.</p><h3>How sure can you be about recovered code?</h3><p>Recovered malware code is only as useful as the evidence behind it. Devirt’s coverage ledger places every in-scope function in one of four states: proven, runtime-dependent, unresolved or permanently bounded. For malware, the runtime-dependent state matters most, because behavior that depends on a real input, key or environment stays marked as open instead of disappearing from the incident note.</p><p>Whatever tool you use, apply the same discipline to your own notes:</p><ul><li><strong>Proven:</strong> you can show the recovered logic matches what the sample does.</li><li><strong>Runtime-dependent:</strong> it depends on something you don’t have, such as the C2’s response or a victim-specific key.</li><li><strong>Unresolved:</strong> you couldn’t recover it with what you have.</li><li><strong>Bounded:</strong> you know why it can’t be recovered, and you’ve said so.</li></ul><p>The article on <a href="https://devirt.re/research/devirtualization/runtime-dependent-functions?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=re-malware">runtime-dependent, unresolved and bounded functions</a> goes through each state with examples.</p><h3>Handle live samples like live samples</h3><p>Everything above assumes the sample runs only in an isolated lab: a virtual machine with no route to production, snapshots you can roll back, and no shared folders. If you send a sample to any outside service, check where it runs, whether it’s shared or used for training, and when the input is deleted. Devirt, for one, publishes that uploads run in an isolated environment, aren’t shared between customers or used for training, and that input deletion starts once the output is ready.</p><h3>Next steps</h3><ul><li>Writing up the result? See the <a href="https://dev.to/devirt/malware-reverse-engineering-what-your-soc-should-get-back-353h">SOC deliverable checklist</a> on DEV.</li><li>Have a protected sample to scope? Start on <a href="https://devirt.re/use-cases/malware-analysts?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=re-malware">Devirt’s malware analyst page</a>.</li></ul><p><em>Written by Devirt, an automated devirtualization service for authorized analysis of protected software. Defensive analysis only: deploying or improving malware is prohibited under Devirt’s acceptable use policy.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61baf05eecd5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The REA GitHub repo (morluto/rea) explained]]></title>
            <link>https://medium.com/@devirt/the-rea-github-repo-morluto-rea-explained-8fb737fe9400?source=rss-96a56c826e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fb737fe9400</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[Devirt]]></dc:creator>
            <pubDate>Wed, 28 Oct 2026 09:52:27 GMT</pubDate>
            <atom:updated>2026-10-28T09:52:27.500Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>A tour of the viral REA reverse engineering repo: what it installs, what it can analyze, which download sources are official, and the one kind of code it still can’t open.</blockquote><p>The REA GitHub repo is <a href="https://github.com/morluto/rea">morluto/rea</a>, the open-source project behind REA, short for Reverse Engineer Anything. The repository was created on April 14, 2026, is published under the MIT license, and by October 28, 2026 showed about 398,600 stars and 100,000 forks. What the repo ships is an MCP server and a command-line tool that let AI coding agents run real reverse engineering tools.</p><p>We read the repo closely for a practical reason. Devirt (devirt.re) recovers code that has been hidden by virtualizing protectors, and that is exactly the code an agent using REA hits a wall on. What follows is the repo as it looks from the hard end of reverse engineering, where we spend our days.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%2Fsiteproxy.ruqli.workers.dev%3A443%2Fhttps%2Fi.ytimg.com%2Fvi%2FfLPV61qJuhY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f72ba16e16868844265f6683e7681c1a/href">https://medium.com/media/f72ba16e16868844265f6683e7681c1a/href</a></iframe><h3>What’s in the morluto/rea repository</h3><p>The morluto/rea repository contains three things worth knowing about before you install anything.</p><ol><li><strong>An MCP server.</strong> MCP (Model Context Protocol) is how AI assistants call external tools. REA registers itself as an MCP server, so an agent can ask it to disassemble a binary, list strings, trace calls or capture browser activity.</li><li><strong>A CLI.</strong> The same tools run from a terminal through the rea command, for analysts who would rather drive the analysis themselves.</li><li><strong>Workflow instructions for agents.</strong> The setup step installs matching instructions into each agent it configures, so the agent knows how to sequence an investigation.</li></ol><p>The README describes the goal in one line: “Reverse engineer anything with agents, from app behavior down to native binaries.” Analysis runs on your own machine, and REA returns findings together with the evidence behind them and the parts it could not resolve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D9bWksbmnrtvnZrr.png" /></figure><h3>What REA can analyze, according to the README</h3><p>The REA README lists a long table of supported targets, and most of them need no paid software. The main families:</p><ul><li>Native binaries: pseudocode, assembly, strings, symbols, calls and references, through an existing Hopper, Ghidra or IDA install.</li><li>Go and Rust binaries: build metadata and dependency information through built-in static inspection (no Go installation needed).</li><li>.NET assemblies: metadata, CIL instructions and native dependencies.</li><li>JavaScript and Electron apps: modules, imports, source maps, routes and IPC boundaries.</li><li>Websites: page structure, scripts and network observations through a Chrome-family browser.</li><li>Android: APKs, devices and Flutter apps through JADX, Apktool and adb.</li><li>Firmware and packages: extraction and handoff to native analysis through Binwalk and Unblob.</li><li>Unusual formats: WASM, EVM bytecode, Erlang BEAM, Linux kernel modules, Unity IL2CPP metadata, Godot PCK archives, GPU code objects, SQLite databases, packet captures and logic-signal recordings.</li></ul><p>That breadth is a big part of why the repo spread so fast: one agent session can move from a website’s JavaScript to its desktop app’s native library without the analyst switching tools.</p><h3>How to install REA from GitHub</h3><p>REA installs from npm rather than by cloning the repo. The README gives one command:</p><pre>npx rea-agents setup</pre><p>Setup asks which agents to configure, shows the proposed changes, and keeps backups of existing configuration before it writes anything. It supports Claude Code, Codex, Cursor, Gemini CLI and Grok Build, and any other agent that supports local MCP servers. After setup, restart the agent.</p><p>A few requirements trip people up:</p><ul><li>Node.js: REA needs a recent Node.js release (22, 24 or 26).</li><li>Linux: some workflows need a procps-compatible ps on the path.</li><li>Native analysis: Hopper, Ghidra or IDA must already be installed, though setup can install Hopper with your approval. Ghidra is the free option.</li><li>Commercial tools: IDA, Hopper and JEB need their own licenses. REA provides none.</li></ul><p>For the standalone CLI, npm install --global rea-agents installs the rea command, and rea update keeps it current.</p><h3>Which REA downloads are official</h3><p>REA’s README names three official sources, and it is worth reading that warning twice. The official sources are the <a href="https://github.com/morluto/rea">morluto/rea repository</a>, the project site <a href="https://rea.tools/">rea.tools</a> and the <a href="https://www.npmjs.com/package/rea-agents">rea-agents package on npm</a>. The README adds that a similar repository name or a copied README does not make a download official.</p><p>That warning deserves more attention than it usually gets. A lookalike repo that asks you to run a setup script with access to your agent and your binaries is an obvious trap. Install from the three named sources and nothing else.</p><h3>Is the REA repo safe and legal to use?</h3><p>REA is MIT-licensed open-source code, so downloading and running it is legal. The README limits intended use to lawful research, education, interoperability, software preservation and analysis of software you own or are authorized to examine, and it states that cracked copies, stolen keys and license bypasses are not authorized.</p><p>Two cautions sit underneath that. Local is not the same as private: the analysis runs on your machine, but your agent forwards the tool results to its model provider, under that provider’s data policy. And the target’s license still applies, because many software licenses restrict disassembly and the rules differ by country and by purpose.</p><h3>Where the REA repo stops: virtualization-protected code</h3><p>The REA repo has no answer yet for code protected by a virtualizing protector, and its README does not claim one. A search of the README for obfuscation, packing, VMProtect, Themida or virtualization finds nothing.</p><p>The reason is structural. Protectors such as VMProtect, Themida and Code Virtualizer replace selected functions with bytecode for a private virtual machine and ship an interpreter to run it. Hopper, Ghidra and IDA disassemble what is actually in the file, which is the interpreter: a dispatcher loop, handler routines and tables of bytecode. An agent driving those tools through REA gets the same interpreter back, however good the agent is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ppj89Zwlnl_bAutu.png" /></figure><p>Getting past that point takes devirtualization, the step that rebuilds the original logic from the virtual machine.</p><p>Devirt (devirt.re) is a binary devirtualization and reverse engineering service for security researchers and malware analysts. Protectors such as VMProtect and Themida hide a program’s logic inside a private virtual machine. Devirt follows the protected program as it runs, reconstructs the virtual machine’s state and control flow, converts that behavior into native-shaped functions and checks them against the original. Customers choose the output they need: an IDA database, annotated pseudocode, a reverse engineering report, LLVM IR or structured JSON.</p><p>The IDA database and the JSON output both slot into an REA workflow: one opens in a tool REA can drive, the other is easy for an agent to read. Recovery is automated for VMProtect, Themida and Code Virtualizer, and the <a href="https://devirt.re/supported-protectors">supported protectors page</a> covers the rest. Devirt only analyzes software that customers own or are authorized to examine.</p><p>For a shorter overview of what REA is and why “anything” has limits, see our <a href="https://devirt.substack.com/p/rea-reverse-engineer-anything">Substack post on REA</a>.</p><p><em>Devirt (devirt.re) is a binary devirtualization and reverse engineering service. Website: </em><a href="https://devirt.re/"><em>devirt.re</em></a><em> · YouTube: </em><a href="https://www.youtube.com/@devirtre"><em>@devirtre</em></a><em> · GitHub: </em><a href="https://github.com/Devirt-re"><em>Devirt-re</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fb737fe9400" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>