<?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>Thu, 03 Dec 2026 20:38:08 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[Binary Analysis: 4 Kinds, the Tools for Each, and What Protection Hides]]></title>
            <link>https://medium.com/@devirt/binary-analysis-4-kinds-the-tools-for-each-and-what-protection-hides-e2c6a7d18f8f?source=rss-96a56c826e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2c6a7d18f8f</guid>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[binary-analysis]]></category>
            <category><![CDATA[software-security]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Devirt]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 03:51:08 GMT</pubDate>
            <atom:updated>2026-11-23T03:51:08.762Z</atom:updated>
            <content:encoded><![CDATA[<p>Binary analysis is the examination of compiled software, such as executables, libraries and firmware, without its source code. The term covers two different jobs: finding the third-party components and known vulnerabilities inside a program, and working out what the program’s own code does. This article covers the second job. It explains the four kinds of binary analysis (static, dynamic, symbolic execution and binary diffing), what each one sees and misses, and which open-source tools do each. On 23 November 2026 we checked 36 of those tools on GitHub, and the results are below.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%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>Binary analysis on a protected file:</em></strong><em> every kind of analysis in this article assumes the program’s original machine code is in the file to be read, run, solved or compared. When a protector has virtualized a function, that code has been replaced by bytecode for the protector’s own interpreter, and all four kinds end up studying the interpreter instead. Devirt analyzes compiled software, recovers supported protected logic, labels what is proven and what remains unknown, and returns an IDA database and annotated pseudocode for the agreed scope. Its free browser check reads a file’s details and protection indicators on your own device. </em><a href="https://devirt.re/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=binary-analysis"><em>See what Devirt recovers from protected binaries</em></a><em>.</em></blockquote><h3>What is binary analysis?</h3><p>Binary analysis, also called binary code analysis, is the examination of compiled software without access to its source code. An analyst or a tool reads the machine code the processor executes, either without running the program or while it runs. The work starts from what the file itself records: its format (PE on Windows, ELF on Linux), the processor it targets, the functions it imports, its readable strings and its code. A binary has no comments, and a stripped binary has lost most of its function and variable names as well, so meaning has to be rebuilt from behavior.</p><p>The term means two things in practice, and the search results for it mix them up:</p><ul><li><strong>Component and vulnerability scanning.</strong> Security vendors such as Black Duck use “binary analysis” for software composition analysis (SCA) on compiled code. The scanner matches a binary’s contents against databases of open-source components, flags known vulnerabilities and license obligations, and can produce a <a href="https://www.cisa.gov/sbom">software bill of materials (SBOM)</a>. This is supply-chain work, and it doesn’t need anyone to understand the program’s logic.</li><li><strong>Working out what the code does.</strong> Reverse engineers, malware analysts and vulnerability researchers use binary analysis to recover how a program behaves: how it parses a file format, what a legacy component computes, what a malware sample does once it runs. No database answers that, because the logic belongs to that one program.</li></ul><p>Devirt’s <a href="https://devirt.re/research/binary-analysis?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=binary-analysis">binary analysis</a> research hub covers both meanings and what an analysis can prove. The rest of this article goes through the four kinds of analysis that the second job uses.</p><h3>The four kinds of binary analysis</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DRIi4H0vcyZ1jTW2iQAe7w.png" /></figure><p>Binary analysis comes in four kinds, and each answers a different question:</p><ul><li><strong>Static analysis:</strong> what is in this file, and what could it do?</li><li><strong>Dynamic analysis:</strong> what does it do when it runs?</li><li><strong>Symbolic execution:</strong> which inputs reach this piece of code?</li><li><strong>Binary diffing:</strong> what changed between these two versions?</li></ul><p>Most real analyses combine them. An analyst reads the file statically to find the interesting function, runs it to see real values, and reaches for symbolic execution or diffing when a specific question needs it.</p><h4>Static binary analysis</h4><p>Static binary analysis examines a program without running it. A disassembler turns machine code into assembly, and a decompiler turns that into C-like pseudocode. Along the way the tool recovers functions, builds a control-flow graph for each one (the blocks of code and the jumps between them), follows cross-references and lists imports and strings. Format parsers read the headers first. Devirt’s walkthrough of the <a href="https://medium.com/@devirt/pe-file-format-explained-every-header-and-section-read-from-a-real-file-b4d35dfe337b">PE file format</a> shows what those headers hold on a real Windows file.</p><p><strong>What static analysis sees:</strong> the whole file, including code that no test run would ever reach. That’s why it suits malware triage, auditing and getting a map of an unfamiliar program.</p><p><strong>What it misses:</strong> anything that only exists at run time. Indirect jump targets, values read from the network, and code that is decrypted or unpacked in memory don’t appear in the file on disk.</p><p><strong>Typical tools:</strong> Ghidra, IDA Pro, Binary Ninja, radare2 and Rizin (with Cutter as its interface), plus libraries such as Capstone for disassembly and LIEF for reading file formats. Rule-based triage tools work statically too: capa reports a program’s capabilities, and Detect It Easy identifies compilers, packers and protectors.</p><h4>Dynamic binary analysis</h4><p>Dynamic binary analysis observes a program while it runs. A debugger such as x64dbg pauses the program and shows registers and memory. Instrumentation frameworks such as Frida and DynamoRIO insert code into the running process to log calls, arguments and memory accesses without stopping it. Emulators such as QEMU, Unicorn and Qiling run code on a simulated processor, which helps with firmware for other architectures and with malware you don’t want running on a real machine. Fuzzers such as AFL++ run a program over and over with mutated inputs to find crashes.</p><p><strong>What dynamic analysis sees:</strong> real values. The actual target of every indirect jump, decrypted strings, unpacked code in memory and the system calls the program makes.</p><p><strong>What it misses:</strong> every path the run didn’t take. A program that only misbehaves on a particular date, input or environment looks harmless if those conditions never happen during the run.</p><p>Taint analysis is often built on top of dynamic analysis. It marks data from a source, such as a file or a network message, and follows it through the program to the code it reaches. Devirt’s explainer on <a href="https://devirt.re/research/binary-analysis/taint-analysis?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=binary-analysis">taint analysis</a> covers sources, sinks and propagation in detail.</p><h4>Symbolic execution</h4><p>Symbolic execution is a binary analysis technique that treats a program’s inputs as unknown symbols instead of concrete values. As it walks each path through the code, it records the conditions that path puts on the inputs, such as “the first byte equals 0x4D and the length is over 16”. It then hands those conditions to a constraint solver, which either produces an input that reaches the path or proves no such input exists.</p><p><strong>What symbolic execution sees:</strong> precisely which inputs reach a given branch. That makes it useful for reaching deep code that random testing rarely hits, checking whether a dangerous call is reachable, and generating test cases.</p><p><strong>What it misses:</strong> scale. Each branch can double the number of paths, so the work grows exponentially, a problem known as path explosion. Real tools manage it by exploring selectively, merging states or mixing concrete and symbolic values (concolic execution). Point it at one well-chosen function, not a whole program.</p><p><strong>Typical tools:</strong> angr, Triton, Miasm, BINSEC, KLEE and SymCC. KLEE and SymCC work at the compiler level, on LLVM code built from source, so on a binary without source they need a lifter or a companion tool.</p><h4>Binary diffing</h4><p>Binary diffing compares two versions of a compiled program, function by function, to find what changed. Diffing tools match functions between the two builds using their control-flow graphs, call relationships and other features, then list the functions that were added, removed or changed.</p><p><strong>What binary diffing is used for:</strong></p><ul><li><strong>Patch analysis.</strong> Comparing a program before and after a security update shows which function the fix touched, which is often the fastest way to understand the vulnerability it closed.</li><li><strong>Malware lineage.</strong> Comparing samples shows how a malware family evolved and which code two variants share.</li><li><strong>Carrying work forward.</strong> Analysts port their function names and notes from an old build to a new one instead of starting again.</li></ul><p><strong>What it misses:</strong> anything that changes the code’s shape without changing its behavior. A different compiler, different optimization settings or obfuscation can make identical logic look different, which is why research tools have moved toward comparing what code computes rather than how it looks.</p><p><strong>Typical tools:</strong> BinDiff (Google) with its companion BinExport plugin, Diaphora, ghidriff for Ghidra and Quarkslab’s QBinDiff. Ghidra also ships its own Version Tracking and BSim features for matching code across builds.</p><h3>Binary analysis tools, by kind: what GitHub shows</h3><p>Binary analysis tools are easy to list and hard to compare, so we counted. <strong>Method.</strong> On 23 November 2026 we read 36 open-source binary analysis repositories through the GitHub API. We picked the tools by name before the run, with no star threshold, and put each in the kind its own repository description or README names as its main job. Ten of the 36 also do a second kind (Ghidra and radare2, for example, both include diffing), and we logged those without counting them twice. For each repository we recorded stars, license, last push, latest GitHub release and the archived flag. We also counted the repositories tagged with nine related GitHub topics. The number of tools in each kind reflects our sample, not the size of each field; the stars and topic counts are what compare the kinds. <strong>These numbers measure activity on GitHub. They don’t measure how good a tool is or how widely it’s used</strong>, and commercial tools such as IDA Pro and Binary Ninja aren’t in the sample.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3OjLghSAHR0JOYD7GWq3HQ.png" /></figure><p><strong>The 36 tools by kind:</strong></p><ul><li><strong>Static: 12 tools, median 7,514 stars.</strong> Ghidra (101,013 stars), radare2, Cutter, Detect It Easy, Capstone, RetDec, capa, LIEF, Rizin, BAP, Pharos and vivisect. Ghidra alone holds 51% of the stars in the static group.</li><li><strong>Dynamic: 12 tools, median 9,024 stars.</strong> x64dbg (50,371), Frida, QEMU’s GitHub mirror, pwndbg, rr, Unicorn, GEF, AFL++, Qiling, DynamoRIO, Speakeasy and Dyninst.</li><li><strong>Symbolic execution: 7 tools, median 3,857 stars.</strong> angr (9,408), Triton, Miasm, Manticore, KLEE, SymCC and BINSEC.</li><li><strong>Binary diffing: 5 tools, median 1,215 stars.</strong> Diaphora (4,478), BinDiff, BinExport, ghidriff and QBinDiff.</li></ul><p><strong>What stood out:</strong></p><ul><li><strong>Almost everything is maintained.</strong> 32 of the 36 repositories had a push in the 90 days before the count. The exceptions were BAP and RetDec (last pushes 199 and 181 days earlier), QBinDiff (566 days) and Manticore, which is the only archived tool in the sample.</li><li><strong>Releases lag behind commits.</strong> Triton had a push 11 days before the count, but its latest GitHub release dates from February 2022. Miasm’s latest GitHub release is from December 2019 and its last push from 3 November 2026. If you judge a tool by its release page, you’ll underrate it.</li><li><strong>Diffing is the smallest kind on GitHub.</strong> Its tools have the lowest median stars in the sample, and only 49 repositories carry the binary-diffing topic, against 1,343 for binary-analysis, 358 for symbolic-execution and 17,398 for reverse-engineering. We expected diffing to be small, but not that small.</li><li><strong>Licenses are mixed.</strong> 15 tools use permissive licenses (Apache 2.0, MIT, BSD), 12 use copyleft licenses (GPL, LGPL, AGPL), and for 9 GitHub couldn’t classify the license file. Check the license before building a tool into anything you ship.</li></ul><p>The script, the full CSV and the run log are saved with this article’s working files, so the count can be repeated.</p><h3>Which kind answers your question</h3><p>Picking the kind of binary analysis is mostly picking the question:</p><ul><li><strong>“What is this file, and is it packed or protected?”</strong> Static triage: Detect It Easy or capa, then a disassembler.</li><li><strong>“What does this function do?”</strong> Static analysis in Ghidra, IDA Pro or Binary Ninja, with a debugger to confirm values.</li><li><strong>“What does the program do with real input?”</strong> Dynamic analysis: a debugger, Frida for logging calls, or an emulator for code you don’t want on a real machine.</li><li><strong>“Where does this input end up?”</strong> Taint analysis on top of dynamic analysis.</li><li><strong>“Can any input reach this dangerous call?”</strong> Symbolic execution with angr or Triton, scoped to that one function.</li><li><strong>“What did this patch fix?”</strong> Binary diffing with BinDiff, Diaphora or ghidriff.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7RJ7cBoUBqhBl7dErb9ZxQ.gif" /></figure><h3>How protected binaries change the picture</h3><p>Software protection hides code from each kind of binary analysis in a different way. Commercial protectors and malware use the same families of technique: packing, anti-debugging, obfuscation and code virtualization. Each family aims at a different kind of analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R2R17MUh49iH23-9sURWHg.png" /></figure><p><strong>What each protection layer hides, kind by kind:</strong></p><ul><li><strong>Packing</strong> compresses or encrypts the program and restores it in memory at run time. Static analysis of the file on disk sees only the small restoring stub, so packing mostly blinds static tools. MITRE ATT&amp;CK tracks it as <a href="https://attack.mitre.org/techniques/T1027/002/">Software Packing (T1027.002)</a>.</li><li><strong>Anti-debugging and anti-VM checks</strong> look for a debugger, an emulator or a sandbox and change behavior if they find one. They target dynamic analysis, because the run being observed is no longer the run that matters.</li><li><strong>Obfuscation</strong> rewrites code so it reads worse without changing what it does. Flattened control flow and opaque predicates add paths, which feeds path explosion in symbolic execution, and changed code shapes break the structural matching that diffing tools rely on.</li><li><strong>Code virtualization</strong> translates selected functions into bytecode for a custom virtual machine and ships an interpreter to run it. This one affects all four kinds at once. Static analysis reads the interpreter. Dynamic analysis watches the interpreter loop over bytecode. Symbolic execution has to reason through the interpreter as well as the logic. Diffing compares interpreters, which can differ from build to build even when the protected function hasn’t changed.</li></ul><p>Recognizing a protection is quick. Understanding the code behind it is not. A detection rule can name the protector in seconds. Answering what a virtualized function does is a separate job, because the function’s original instructions are no longer in the file. Devirt’s <a href="https://devirt.re/blog/protected-binary-analysis-workflow?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=binary-analysis">protected binary analysis workflow</a> explains how that job fits around ordinary static and dynamic work.</p><p>This section describes what each layer hides. It doesn’t cover how to remove or get around any of them.</p><h3>Binary analysis vs reverse engineering</h3><p>Binary analysis and reverse engineering overlap but aren’t the same thing. Binary analysis is the set of techniques for examining compiled code. Reverse engineering is the goal of understanding how a program works, and binary analysis is its main method. A software composition scan is binary analysis without reverse engineering, because it matches components instead of explaining the program’s own logic. Reverse engineering a file format from its documentation and traffic captures is reverse engineering without much binary analysis.</p><h3>The short version</h3><ul><li>Binary analysis is the examination of compiled software without source code. Vendors use the term for component scanning; reverse engineers use it for working out what code does.</li><li>Static analysis reads the whole file but misses run-time values. Dynamic analysis sees real values but only on the paths a run takes. Symbolic execution finds which inputs reach a branch, at the cost of path explosion. Binary diffing shows what changed between two builds.</li><li>In our 23 November 2026 count of 36 open-source tools, 12 were static, 12 dynamic, 7 symbolic and 5 diffing; 32 had a push in the previous 90 days and one (Manticore) was archived.</li><li>Protection aims at specific kinds: packing at static analysis, anti-debugging at dynamic analysis, obfuscation at symbolic execution and diffing, and virtualization at all four.</li></ul><p>— -</p><p><em>Devirt analyzes only files you own or are authorized to analyze, for security, privacy and interoperability research. Devirt does not remove DRM, bypass license checks or crack software.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2c6a7d18f8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Taint Analysis Explained: Static vs Dynamic, Tested on 12 Data Flows]]></title>
            <link>https://medium.com/@devirt/taint-analysis-explained-static-vs-dynamic-tested-on-12-data-flows-9242edeab3bc?source=rss-96a56c826e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/9242edeab3bc</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[static-analysis]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[application-security]]></category>
            <dc:creator><![CDATA[Devirt]]></dc:creator>
            <pubDate>Mon, 23 Nov 2026 03:48:48 GMT</pubDate>
            <atom:updated>2026-11-23T03:48:48.320Z</atom:updated>
            <content:encoded><![CDATA[<p>Taint analysis is a way of tracking untrusted data through a program: it marks values that come from a source, such as user input, follows them as the code copies and combines them, and reports any that reach a sink, such as a SQL query or a shell command, without passing a sanitizer first. Security tools use it to find injection bugs, and it comes in two kinds, static and dynamic, that fail in different places. To show where, on 23 November 2026 we wrote a small program with 12 labeled data flows and gave the same sources, sinks and sanitizers to a static analyzer (Semgrep Community Edition) and to a runtime taint tracker. They agreed on 9 flows and disagreed on 3, and both missed one.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%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 code you need to trace has no source:</em></strong><em> everything in this post runs on source code. On a compiled program, a dynamic taint tracker labels bytes and registers instead of variables, and on a binary protected with code virtualization, such as VMProtect or Themida, the trace runs through the protector’s own virtual machine. A taint trace there narrows the search, but it doesn’t recover the protected function. For files you’re authorized to analyze, Devirt recovers virtualized logic, reports every function in scope in a coverage ledger, and says which results stayed unproven. </em><a href="https://devirt.re/protected-binary-analysis?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=taint-analysis"><em>See protected binary analysis on devirt.re</em></a><em>.</em></blockquote><h3>What is taint analysis?</h3><p>Taint analysis is a program analysis technique that marks data coming from an untrusted source, follows that data as the program copies and combines it, and reports any place where it reaches a sensitive operation, called a sink, without first passing through a sanitizer. It’s also called taint tracking or taint checking. Static taint analysis does this by reading the code. Dynamic taint analysis does it while the program runs.</p><p>The idea is old. Perl has a long-standing taint mode, switched on with the -T flag: data from outside the program is marked, and Perl refuses to use it in a command that starts a shell or modifies files, directories or processes until the script has cleaned it with a regular expression. The <a href="https://perldoc.perl.org/perlsec">perlsec documentation</a> describes the rules. Today the same idea sits inside many static application security testing (SAST) tools, which use it to find SQL injection (<a href="https://cwe.mitre.org/data/definitions/89.html">CWE-89</a>), OS command injection (<a href="https://cwe.mitre.org/data/definitions/78.html">CWE-78</a>), path traversal (<a href="https://cwe.mitre.org/data/definitions/22.html">CWE-22</a>) and cross-site scripting.</p><h3>Sources, sinks and sanitizers</h3><p>Every taint analysis starts from a policy with three parts. The policy decides what the analysis can find, so it matters as much as the engine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ieYHQQPcxX4qXZz3SggtSw.png" /></figure><ul><li><strong>Source:</strong> where untrusted data enters. Web request parameters, form fields, input(), environment variables, files and network reads are typical sources. Anything computed from a source is tainted too.</li><li><strong>Sink:</strong> an operation that’s dangerous if untrusted data controls it. A database query, a shell command, a file path, an HTML response, a redirect URL or an eval call.</li><li><strong>Sanitizer:</strong> a function that makes tainted data safe for a particular sink. Converting to an integer, quoting for the shell, escaping for HTML or stripping a path down to its file name.</li></ul><p><strong>Tainted data</strong> is any value that came from a source, or was computed from one, and hasn’t passed a sanitizer that fits the sink it’s headed for. That last clause matters more than it looks, and one flow in the experiment below turns on it.</p><h3>How taint analysis works</h3><p>Taint analysis works in three steps, whether the tool reads code or watches it run:</p><ol><li><strong>Mark.</strong> Every value that comes from a source gets a taint label.</li><li><strong>Propagate.</strong> When the program copies, concatenates, formats or computes a new value from a tainted one, the new value inherits the label. A sanitizer removes it.</li><li><strong>Check.</strong> When a value reaches a sink, the analysis checks for a label. A labeled value at a sink is a finding.</li></ol><p>The hard part is step 2. The analysis needs a rule for every operation data can pass through: string concatenation, formatting, containers, function calls, library code. Where a rule is missing, taint either disappears (a missed bug, or false negative) or spreads to values it shouldn’t (a false alarm, or false positive).</p><h3>A worked taint analysis example: 12 flows, two analyzers</h3><p>We wanted to show those failure modes on real output rather than describe them, so we built a small test.</p><h4>The setup</h4><p>On 23 November 2026 we wrote a 110-line Python file with 12 functions. Each function reads one value with input() and may pass it to one of three sinks: db.execute (SQL), os.system (shell) or open (a file path). Each function&#39;s docstring states the ground truth: 8 flows are vulnerable and 4 are safe. The inputs in the test run were ordinary values like alice and example.org, and every sink was replaced by a recorder, so nothing was queried, executed or opened.</p><p>Both analyzers got the same policy:</p><ul><li><strong>Source:</strong> input()</li><li><strong>Sinks:</strong> db.execute(...), os.system(...), open(...)</li><li><strong>Sanitizers:</strong> int(), shlex.quote(), os.path.basename()</li></ul><p>The rule lists the three sanitizers once for all three sinks to keep it short. No flow in the test passes a sanitizer on its way to the wrong sink, so the shortcut doesn’t change any result, but a real policy would pair each sanitizer with the sink it protects.</p><p>The static analyzer was <strong>Semgrep Community Edition 1.186.0</strong>, the free version, running one taint rule. This is the whole rule:</p><pre>rules:<br>  - id: untrusted-input-to-sink<br>    mode: taint<br>    languages: [python]<br>    severity: ERROR<br>    message: Untrusted input from input() reaches a SQL, shell or file-path sink<br>    pattern-sources:<br>      - pattern: input(...)<br>    pattern-sanitizers:<br>      - pattern: int(...)<br>      - pattern: shlex.quote(...)<br>      - pattern: os.path.basename(...)<br>    pattern-sinks:<br>      - pattern: $DB.execute(...)<br>      - pattern: os.system(...)<br>      - pattern: open(...)</pre><p>The dynamic analyzer was a runtime tracker of about 100 lines that we wrote for this post. It wraps each input in a string subclass that carries a taint label through the operations it models (concatenation, % formatting, format specs, slicing, iteration, replace, strip, lower, upper), drops the label at the three sanitizers, and records whether a labeled value reaches a sink. It&#39;s a teaching tool, not a product, and it runs each function once.</p><h4>What each analyzer reported</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xe32ZUACxT02xdJT1Vd8GQ.png" /></figure><ul><li><strong>Semgrep CE:</strong> found 6 of the 8 vulnerable flows, missed 2, and raised 1 false alarm on the 4 safe ones.</li><li><strong>Runtime tracker:</strong> found 5 of the 8 vulnerable flows, missed 3, and raised 1 false alarm.</li><li><strong>Agreement:</strong> 9 of 12 flows got the same verdict from both.</li></ul><p>Flow by flow:</p><ul><li><strong>f01, input concatenated into SQL (vulnerable):</strong> both found it.</li><li><strong>f02, input converted with </strong><strong>int() before SQL (safe):</strong> both cleared it.</li><li><strong>f03, </strong><strong>html.escape before a shell command (vulnerable):</strong> both found it. html.escape is a sanitizer for HTML, and the policy correctly didn&#39;t list it for anything.</li><li><strong>f04, the </strong><strong>input() call sits inside a helper function (vulnerable):</strong> Semgrep missed it; the tracker found it.</li><li><strong>f05, input passed through a helper that builds the query (vulnerable):</strong> both found it.</li><li><strong>f06, input stored in a dict, then used as a file path (vulnerable):</strong> both found it.</li><li><strong>f07, </strong><strong>os.path.basename before the file path (safe):</strong> both cleared it.</li><li><strong>f08, shell command assembled with </strong><strong>&quot; &quot;.join(...) (vulnerable):</strong> Semgrep found it; the tracker missed it.</li><li><strong>f09, a regex allowlist check before the shell command (safe):</strong> both flagged it, the one false alarm each.</li><li><strong>f10, the shell command only runs when a </strong><strong>DEBUG flag is on (vulnerable):</strong> Semgrep found it; the tracker missed it.</li><li><strong>f11, the input copied one character at a time through comparisons (vulnerable):</strong> both missed it.</li><li><strong>f12, </strong><strong>shlex.quote before the shell command (safe):</strong> both cleared it.</li></ul><p>If you remember one result, make it f11: two clean reports on a function that puts its input straight into a SQL query. The three disagreements explain the rest, because each one comes from the difference between reading code and watching it run.</p><h3>Static vs dynamic taint analysis</h3><p>Static taint analysis reads the code without running it, so it can follow every path, including paths a test never executes, but it only follows data as far as its rules and its view of the program reach. Dynamic taint analysis labels real values at run time, so it sees what happened on that run and nothing else. In our test of 12 labeled flows, each analyzer caught a bug the other missed, for those two reasons.</p><p><strong>Where static analysis won: code that didn’t run.</strong> In f10 the vulnerable call sits behind if DEBUG:. The flag was off in the test run, so the sink never executed and the tracker had nothing to see. Semgrep doesn&#39;t care what the flag&#39;s value is at run time. It saw a path from input() to os.system and reported it. Any dynamic analysis is limited by its test inputs and paths in the same way, so its results are only as good as the test suite or fuzzer that drives it.</p><p><strong>Where static analysis lost: the function boundary.</strong> In f04 the source is one call away:</p><pre>def read_name():<br>    return input()</pre><pre>def f04_source_in_helper():<br>    name = read_name()<br>    db.execute(&quot;SELECT * FROM users WHERE name = &#39;&quot; + name + &quot;&#39;&quot;)</pre><p>Semgrep CE analyzes taint inside one function at a time, and <a href="https://docs.semgrep.dev/writing-rules/data-flow/taint-mode/overview">Semgrep’s taint documentation</a> lists interprocedural taint analysis as a Semgrep Pro feature. From inside f04, read_name() is a call with no tainted argument. The runtime tracker doesn&#39;t see functions at all. It saw the labeled string arrive at db.execute. A tool with interprocedural analysis, such as Semgrep Pro or CodeQL, would be expected to follow this one; we didn&#39;t test those.</p><p>f05 looks similar but went the other way: there the tainted value is passed <em>into</em> a helper, and Semgrep reported the flow. It didn’t follow the data inside build_query. Its documentation says it assumes a call it can&#39;t see into passes the taint of its arguments to its result, and that default caught this flow.</p><p><strong>Where dynamic analysis lost: an operation without a rule.</strong> In f08 the command is built with &quot; &quot;.join([&quot;ping&quot;, &quot;-c&quot;, &quot;1&quot;, host]). join is a method of the plain separator string, and our tracker has no rule for it, so the result came back as an ordinary unlabeled string. Bigger trackers have the same weakness at a larger scale: they model a list of operations, and taint can disappear through anything outside it.</p><p><strong>What is dynamic taint analysis?</strong> Dynamic taint analysis attaches a label to data when it enters a running program from a source, carries the label to every value computed from it, and checks the label when a value reaches a sink. Its findings happened on a real execution, but it can’t report a flow in code the run never reached. On compiled programs it works at the level of machine instructions, as Devirt’s explainer on <a href="https://devirt.re/research/binary-analysis/taint-analysis?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=taint-analysis">taint analysis for binaries</a> describes in detail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3fLibCkIDhNXMSZ8MsHH-A.gif" /></figure><p>In short:</p><ul><li><strong>When it runs:</strong> static before the program runs; dynamic during a run.</li><li><strong>Paths covered:</strong> static, every path its model can see; dynamic, only the paths the inputs reached.</li><li><strong>Typical miss:</strong> static, flows its rules or scope can’t follow (f04); dynamic, code that didn’t run (f10) and operations it doesn’t model (f08).</li><li><strong>Typical false alarm:</strong> both, on checks that make a value safe without changing it (f09).</li><li><strong>Needs:</strong> static needs the code, or a model of it; dynamic needs a way to run the program and inputs that exercise it.</li></ul><h3>Implicit flows and other blind spots in taint analysis</h3><p>Taint analysis has blind spots that no amount of path coverage fixes, because they come from what “taint” means and from the policy, not from which paths ran. The experiment hit three of them.</p><p><strong>Implicit flows.</strong> An implicit flow in taint analysis is a flow where untrusted data controls <em>which</em> code runs rather than being copied directly, so the output depends on the input without any assignment from it. f11 rebuilt the input one character at a time:</p><pre>for c in name:<br>    for a in ALPHABET:<br>        if c == a:<br>            copy = copy + a</pre><p>Every character of copy comes from ALPHABET, a constant, so neither analyzer saw a data flow from name. Yet copy ends up identical to name, and it went into a SQL query unreported. Real code rarely looks this deliberate, but table lookups, switch statements and character-by-character decoders can produce the same effect.</p><p><strong>Sanitizers that don’t fit the sink.</strong> A sanitizer only makes data safe for the sink it was written for. html.escape makes text safe inside HTML, but it leaves ;, | and $ alone, so it does nothing for a shell command (<a href="https://docs.python.org/3/library/html.html#html.escape">Python&#39;s docs</a> list what it escapes). Both analyzers reported f03 correctly because the policy didn&#39;t list html.escape. A policy that lists it as a sanitizer for every sink would have hidden that command injection. Getting the policy wrong fails silently, because the policy is what tells the tool which sanitizer is right.</p><p><strong>Validation that doesn’t change the value.</strong> f09 checks the input against an allowlist, [a-z0-9.-]+, and returns early if it fails. That check, plus a -- that stops ping reading the value as an option, makes the flow safe, but the value that passes the check is still the original tainted string, so both analyzers flagged it. To a taint analysis, validation and sanitization are different things: a sanitizer returns a new, clean value, and a check only decides whether the code continues. Many tools let you describe a check like this as a guard or sanitizer (CodeQL calls them barrier guards), which is the usual way to clear this kind of false positive.</p><h3>Taint analysis tools</h3><p>Taint analysis tools fall into a few groups, depending on what they read and when:</p><ul><li><strong>Static analyzers for source code:</strong> <a href="https://docs.semgrep.dev/writing-rules/data-flow/taint-mode/overview">Semgrep</a> (Community Edition and Pro), <a href="https://codeql.github.com/docs/writing-codeql-queries/about-data-flow-analysis/">CodeQL</a> (data flow and taint tracking queries), the <a href="https://clang.llvm.org/docs/analyzer/user-docs/TaintAnalysisConfiguration.html">Clang Static Analyzer</a> for C and C++ (a configurable taint checker), <a href="https://pyre-check.org/docs/pysa-basics/">Pysa</a> for Python (its GitHub repository was archived in 2026), and SAST products such as SonarQube and JetBrains Qodana.</li><li><strong>Static analyzers for bytecode:</strong> FlowDroid for Android apps and Tai-e for Java.</li><li><strong>Language runtimes:</strong> Perl’s taint mode, built into the language and switched on per script.</li><li><strong>Dynamic taint trackers for compiled binaries:</strong> tools built on instrumentation frameworks or emulators, such as Triton and PANDA. They’re a different world, and the binary taint explainer linked above counts and compares the open-source ones, so this post doesn’t repeat that.</li></ul><p>Which group fits depends on the question. If you have the source and want to find injection bugs before release, a static analyzer with a good policy is the usual start. If you want to know what a specific input did inside a running program, especially one you don’t have the source for, you need a dynamic tracker.</p><h3>Taint analysis on compiled and protected code</h3><p>Taint analysis on a compiled program is one of the methods of <a href="https://devirt.re/research/binary-analysis?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=taint-analysis">binary analysis</a>, and it works the same way in principle: mark the bytes that come from a source, propagate the marks instruction by instruction, check them at sinks. The labels sit on registers and memory instead of variables, and a missing propagation rule (our f08 problem) is now a missing rule for a machine instruction.</p><p>Protected software adds another layer. Packing hides code from static tools until it unpacks in memory, and code virtualization replaces a function’s instructions with bytecode for a private virtual machine, as Devirt’s post on <a href="https://medium.com/@devirt/anti-reverse-engineering-5-techniques-and-how-analysts-spot-them-6905223449eb">anti reverse engineering</a> explains. A taint trace through that virtual machine can point at the handlers that touch the input, but it still covers one execution and doesn’t give back the original function.</p><h3>Questions about taint analysis</h3><h4>What counted as tainted data in the test?</h4><p>The string returned by input() and everything built from it: the concatenated query in f01, the dict value in f06, and the string that came back from html.escape in f03, which was still tainted because escaping for HTML doesn&#39;t clean it for a shell. In f02 the label stopped at int(), because a parsed number can&#39;t carry SQL.</p><h4>Are taint analysis, taint tracking and taint checking different things?</h4><p>In practice they’re names for the same technique. This post uses taint analysis for the general idea and taint tracking for following values at run time, which matches how the tools’ own documentation uses the words: Semgrep’s docs say taint analysis, and CodeQL’s docs describe taint tracking as an extension of data flow. Taint checking is the older term.</p><h4>Can you run taint analysis without source code?</h4><p>Yes, though not with the tools in this test. Semgrep needed the Python file, and our tracker needed a Python program it could wrap. A compiled program needs a tracker that instruments machine code while it runs, or a static analyzer that reads binaries, and the binary taint explainer linked above compares those tools.</p><h4>Can taint analysis prove code is safe?</h4><p>No. A clean result means no flow was found under that policy, on the paths the tool could see. In our test, Semgrep gave a clean result on 2 vulnerable flows and the tracker on 3, including one implicit flow that neither could see.</p><h3>The short version</h3><ul><li>Taint analysis marks data from a source, propagates the mark, and reports marked data at a sink. A sanitizer makes data safe only for the sink it fits.</li><li>Static taint analysis covers paths that never run but is limited by its rules and scope. Dynamic taint analysis sees real values but only on the paths a run reaches.</li><li>In our 23 November 2026 test of 12 flows, Semgrep CE found 6 of 8 vulnerable flows and a runtime tracker found 5. They disagreed on 3, both missed an implicit flow, and both flagged a safe flow guarded by a regex check.</li><li>The policy matters as much as the engine: a sanitizer listed for the wrong sink hides real bugs, and a validation check that isn’t registered produces false alarms.</li></ul><p><strong>Method.</strong> Run on 23 November 2026 with Semgrep Community Edition 1.186.0 (--metrics=off) and Python 3.11.16. The Semgrep rule is printed above in full. Each flow&#39;s ground truth was written into the test file before either analyzer ran, and the one scan and one tracker run each finish in seconds. The 12 flows are an illustration of how the two methods differ, not a benchmark of Semgrep or of any other tool.</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=9242edeab3bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Anti Reverse Engineering: 5 Techniques and How Analysts Spot Them]]></title>
            <link>https://medium.com/@devirt/anti-reverse-engineering-5-techniques-and-how-analysts-spot-them-6905223449eb?source=rss-96a56c826e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/6905223449eb</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[software-securityinfosec]]></category>
            <dc:creator><![CDATA[Devirt]]></dc:creator>
            <pubDate>Wed, 18 Nov 2026 08:37:12 GMT</pubDate>
            <atom:updated>2026-11-18T08:37:12.221Z</atom:updated>
            <content:encoded><![CDATA[<p>Anti reverse engineering is the set of techniques a program uses to make itself harder to read, debug or modify. Commercial software uses it to protect code, licenses and anti-cheat systems, and malware uses the same techniques to slow down the analysts trying to understand it. This article sorts those techniques into five families and explains how analysts recognize each one. To keep the recognition part grounded, on 18 November 2026 we counted the anti-analysis rules in Mandiant’s open-source capa rule set: 92 rules in its main set, and what each one looks for.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%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 anti-RE layer is a virtual machine:</em></strong><em> a detection rule can tell you a file was protected with VMProtect or Themida. It can’t tell you what the protected functions do, because their original instructions were turned into bytecode for the protector’s own virtual machine. Devirt recovers supported protected logic from files you own or are authorized to analyze, labels what is proven and what remains unknown, and returns an IDA database and annotated pseudocode. Its free browser check reads a file’s protection indicators on your own device, with nothing uploaded. </em><a href="https://devirt.re/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=anti-reverse-engineering"><em>Check a file’s protection on devirt.re</em></a><em>.</em></blockquote><p>This is an explainer for analysts, defenders and developers. It describes what each technique is and what it looks like in a file. It doesn’t cover how to remove or get around any of them.</p><h3>What is anti reverse engineering?</h3><p>Anti reverse engineering is any measure that makes a program’s logic, data or behavior more expensive to recover. In software it usually means five families of technique: obfuscation, packing and encryption, code virtualization, anti-debugging and environment checks, and integrity checks. None of them makes analysis impossible. Each one makes it slower and more specialized.</p><p>The term also has a hardware meaning. Chip designers use camouflaged gates and logic locking to make integrated circuits harder to reverse engineer, and hardware security research groups publish under the same name. This article covers software.</p><p><strong>Anti reverse engineering vs obfuscation.</strong> Obfuscation is one family inside anti reverse engineering. It changes how code reads without changing what it does. The other families act on the file, the analysis environment or the code’s integrity rather than on readability, and that’s why they leave different evidence behind.</p><h3>Why software vendors use anti-reverse engineering</h3><p>Software vendors use anti-reverse engineering to protect value that lives in compiled code. The usual reasons:</p><ul><li><strong>Intellectual property.</strong> Algorithms, file formats and protocols that took years to build are visible to anyone with a disassembler unless something stands in the way.</li><li><strong>Licensing.</strong> License checks only work if they’re hard to find and hard to change.</li><li><strong>Anti-cheat.</strong> Online games protect client code so cheat developers can’t easily read game state or alter behavior.</li><li><strong>DRM and content protection.</strong> Media and software distribution use protection to enforce access rules.</li><li><strong>Mobile apps.</strong> Mobile security vendors add root and jailbreak detection, certificate pinning and runtime integrity checks to apps that handle payments or personal data.</li></ul><p>For a vendor, the goal is economic. Protection has done its job if copying or tampering costs more than it’s worth to the person trying.</p><h3>Why malware uses anti-reverse engineering</h3><p>Malware uses anti-reverse engineering to delay detection and analysis. Packing hides the payload from signature scanners until it runs. Anti-debugging and anti-VM checks let a sample notice an analyst’s debugger or sandbox and change its behavior. Obfuscation makes whatever the analyst does recover slow to read.</p><p>MITRE ATT&amp;CK, the framework defenders use to describe attacker behavior, tracks these as techniques under its Stealth tactic (capa’s rule tags label them Defense Evasion): <a href="https://attack.mitre.org/techniques/T1027/">Obfuscated Files or Information (T1027)</a> with its Software Packing sub-technique (T1027.002), <a href="https://attack.mitre.org/techniques/T1622/">Debugger Evasion (T1622)</a> and <a href="https://attack.mitre.org/techniques/T1497/">Virtualization/Sandbox Evasion (T1497)</a>. Commercial protectors and malware often use the same tools. That’s why detection rules name protectors like VMProtect and Themida as indicators, and why a protector hit is a question rather than a verdict.</p><h3>The five families of anti-reverse-engineering techniques</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6E6yCf80Lu_jgj1GUBG_TQ.png" /></figure><p>Each family targets a different part of an analysis. Some aim at the person reading the code, some at the static tools, and some at the debugger or the analysis machine itself. Integrity checks guard the file against change.</p><h4>1. Obfuscation</h4><p>Obfuscation is the family that changes how code reads while keeping what it does. Common forms include meaningless names, encrypted strings, junk instructions, opaque predicates and control-flow flattening, where a dispatcher hides the real order of blocks. Devirt’s longer explainer on <a href="https://medium.com/@devirt/what-is-code-obfuscation-techniques-and-how-theyre-undone-376706fb1dfd">code obfuscation</a> walks through each technique, and a separate post covers <a href="https://devirt.substack.com/p/control-flow-obfuscation">control flow obfuscation</a> in depth.</p><p><strong>What an analyst sees:</strong> for .NET and other managed code, names and metadata that match a known obfuscator. In native code, strings built byte by byte on the stack instead of stored whole, and control-flow graphs where every block returns to one dispatcher. Anti-disassembly tricks show up as instructions that disassemblers decode in two different ways.</p><h4>2. Packing and encryption</h4><p>Packing is the family that compresses or encrypts a program and adds a small stub that restores it in memory at run time. On disk, the real code doesn’t exist in readable form. UPX is a widely used open-source packer. Commercial protectors add encryption and their own anti-tamper and anti-debug layers on top.</p><p><strong>What an analyst sees:</strong> section names that belong to a packer rather than a compiler, high entropy (data that looks random because it’s compressed or encrypted), a very small import table, and an entry point that sits outside the usual code section. Tools such as Detect It Easy match these signs against signature databases. Devirt’s comparison of how to <a href="https://devirt.re/blog/identify-packer-or-protector?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=anti-reverse-engineering">identify a packer</a> covers what those tools report and what a match doesn’t prove.</p><h4>3. Virtualization</h4><p>Code virtualization is the family that translates selected functions into bytecode for a custom virtual machine and ships an interpreter to run it. VMProtect, Themida, Code Virtualizer and similar protectors work this way. The original machine instructions for those functions are gone from the file. A disassembler shows the interpreter: a dispatcher loop and a table of handlers.</p><p><strong>What an analyst sees:</strong> protector section names, a dispatcher that fetches a byte, looks up a handler and jumps, and functions that all route into the same few blocks of code. Recognizing virtualization is quick. Reading the protected logic is slow, because the bytecode has to be understood before anything meaningful appears, which is the work <a href="https://devirt.re/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=anti-reverse-engineering">binary devirtualization</a> exists to do.</p><h4>4. Anti-debugging and anti-VM checks</h4><p><strong>What are anti-debugging techniques?</strong> Anti-debugging techniques are checks a program runs to find out whether a debugger is attached, so it can exit or change behavior. They ask Windows APIs and process structures whether a debugger is present, measure the timing gaps that single-stepping creates, and look for breakpoints in their own code. Anti-VM and sandbox checks do the same for the analysis machine. They look for virtual hardware names, hypervisor drivers, sandbox user names and a mouse that never moves.</p><p><strong>What an analyst sees:</strong> calls to debugger-related APIs such as CheckRemoteDebuggerPresent or IsDebuggerPresent, reads of the process environment block flags Windows sets for a debugged process, pairs of timer calls around short stretches of code, and strings naming VMware, VirtualBox, QEMU or known sandbox artifacts.</p><h4>5. Integrity checks and anti-tamper</h4><p>Integrity checks are the family that detects changes to the program itself. The program computes a checksum or hash over its own code or file and compares it with a stored value, or verifies a signature, and refuses to run, or runs differently, if the values differ. Software breakpoints change code bytes, so integrity checks also catch some debugging. Anti-tamper in mobile apps is the same idea applied at run time.</p><p><strong>What an analyst sees:</strong> a checksum or hash loop whose input is the program’s own code section, comparisons against embedded constants, and tamper warnings. capa’s VMProtect rule, for example, matches the protector’s own “file corrupted” warning text as one of its indicators.</p><h3>How analysts recognize each technique: what 92 capa rules look for</h3><p>Analysts recognize anti-reverse engineering mostly from static indicators: section names, imports, strings, instruction patterns and entropy. Rule-based tools encode those indicators so a sample can be triaged in seconds. capa, the open-source tool from Mandiant’s FLARE team, is one of them. It reports what a program can do, including which anti-analysis techniques it contains. Its rules are public in the <a href="https://github.com/mandiant/capa-rules">mandiant/capa-rules</a> repository.</p><p><strong>Method.</strong> On 18 November 2026 we read every rule file in capa-rules at commit ffd03fc (committed 6 November 2026) through the GitHub API. That&#39;s 1,056 rule files: 665 in the main set and 391 in the &quot;nursery&quot;, where rules still in development live. We took the 92 main-set rules under anti-analysis/, sorted them into this article&#39;s families by namespace, and recorded each rule&#39;s ATT&amp;CK and MBC tags and the kind of feature it matches on. The count reads only the public repository, so anyone can repeat it at the same commit. The counts show what capa&#39;s authors have written rules for. <strong>They don&#39;t measure how common each technique is</strong> in real software or malware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x6z_Xi0sisr3DsJBnslf5Q.png" /></figure><p><strong>Main-set anti-analysis rules by family:</strong></p><ul><li><strong>Packing: 22 rules.</strong> 17 of the 22 recognize a packer or protector by its section names, and 9 use strings. Two of them name protectors that also virtualize code: VMProtect and Themida.</li><li><strong>Anti-VM and sandbox checks: 20 rules</strong> (19 anti-VM plus 1 anti-emulation). 16 of the 20 match on strings such as hypervisor driver names and sandbox user names, and 8 on API calls.</li><li><strong>Anti-debugging: 17 rules.</strong> 11 of the 17 match on API names, 10 on specific constant values and 7 on instruction mnemonics. Rule names read like a checklist: “check for PEB BeingDebugged flag”, “check for time delay via GetTickCount”, “check for software breakpoints”, “hide thread from debugger”. One API is missing on purpose. The rule “check for debugger via API” leaves out IsDebuggerPresent, and a comment in the rule explains why: compiler-inserted code calls it too, especially in debug builds, so matching on it would flag ordinary programs. A lone IsDebuggerPresent import isn&#39;t evidence of anti-debugging on its own.</li><li><strong>Obfuscation: 12 rules</strong> (10 obfuscation plus 2 anti-disassembly). Most name a specific obfuscator, such as Dotfuscator, SmartAssembly or ADVobfuscator, and 7 of the 12 match on strings. One recognizes obfuscated stack strings.</li><li><strong>Integrity checks: no dedicated rules.</strong> capa has no integrity or anti-tamper namespace. Its checksum namespace holds 3 general-purpose rules (CRC32, Adler-32 and Luhn), which flag the algorithm without saying what it protects. Recognizing an integrity check still needs an analyst to see that the checksum runs over the program’s own code.</li><li><strong>Other anti-analysis: 21 rules</strong> for anti-forensics (11), anti-antivirus (7) and a few others. These sit outside the five families.</li></ul><p>The nursery, classified the same way by each rule’s namespace, adds 21 more packer rules, 9 anti-VM and sandbox rules, 5 anti-debugging rules, 1 obfuscation rule (for KoiVM, a .NET virtualizer) and 3 other anti-analysis rules.</p><p><strong>One tagging gap stands out.</strong> All 22 packer rules and all 20 anti-VM rules carry an ATT&amp;CK technique ID. Only 2 of the 17 anti-debugging rules do. All 17 carry a <a href="https://github.com/MBCProject/mbc-markdown">Malware Behavior Catalog (MBC)</a> ID instead, under its Debugger Detection behavior. If your reporting maps detections to ATT&amp;CK alone, anti-debugging findings from capa can drop out of the report. Mapping MBC IDs as well keeps them. We didn’t expect the gap to be that wide.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ey5h6v_dMpmWavT1WnL8uw.gif" /></figure><p><strong>A recognition checklist, family by family:</strong></p><ul><li><strong>Obfuscation:</strong> obfuscator names in metadata, strings assembled at run time, flattened control flow, instructions that disassemble two ways.</li><li><strong>Packing:</strong> packer section names, high entropy, a tiny import table, an entry point outside the main code section.</li><li><strong>Virtualization:</strong> protector section names, a fetch-and-dispatch loop, many functions routing into the same handler blocks.</li><li><strong>Anti-debugging and anti-VM:</strong> debugger APIs, process-environment flag reads, paired timer calls, hypervisor and sandbox strings.</li><li><strong>Integrity checks:</strong> hash or checksum loops over the program’s own code, comparisons with embedded constants, tamper warnings.</li></ul><p>A hit in any family answers “what is protecting this file?” It doesn’t answer “what does this file do?” That second question is the analysis, and the effort it takes depends on the family. Recognizing packing and anti-debugging is quick, and those layers wrap or guard the original code rather than replace it. Virtualization is different, because the original code isn’t in the file at all.</p><h3>What anti-reverse engineering can’t do</h3><p>Anti-reverse engineering can’t stop a determined, well-equipped analyst. Code that runs on a machine the analyst controls can eventually be observed. The techniques change the economics instead: how long an analysis takes, what tools it needs and who can do it.</p><p>The families differ a lot in how much cost they add. Packing and anti-debugging mostly delay an analyst. Obfuscation slows reading. Virtualization comes closest to stopping a reader, because the protected function’s instructions have been replaced by bytecode whose meaning lives in the interpreter. That’s why recovery from VM-protected code is a specialist job, and why it’s reasonable to ask any tool or service that claims results which functions it recovered and how it checked them.</p><h3>Is anti-reverse engineering legal?</h3><p>Protecting your own software with anti-reverse engineering is generally legal. Analyzing someone else’s protected software is a separate question. The answer depends on the jurisdiction, the software license and the purpose, and some laws treat circumventing a protection measure differently from reading code. Where the law allows analysis, it usually names the purpose: the EU Software Directive permits decompilation for interoperability, and the US DMCA has exemptions for interoperability and for security testing. This isn’t legal advice. Check the license, and ask a lawyer when it matters.</p><h3>The short version</h3><ul><li>Anti reverse engineering is five families: obfuscation, packing and encryption, virtualization, anti-debugging and anti-VM checks, and integrity checks.</li><li>Vendors use it to protect IP, licenses, anti-cheat and content. Malware uses it to delay detection and analysis.</li><li>Analysts recognize most of it from static indicators. In capa’s main rule set on 18 November 2026, packers were recognized by section names (17 of 22 rules), anti-debugging by API names (11 of 17) and anti-VM checks by strings (16 of 20).</li><li>Integrity checks have no dedicated capa rules, and anti-debugging rules carry MBC tags rather than ATT&amp;CK tags. Both are worth knowing when you rely on automated triage.</li><li>Recognition is quick for most families (integrity checks still need an analyst). Reading the protected code is where the families differ, and virtualization is the hardest.</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=6905223449eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <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%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%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%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%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%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%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%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%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%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%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%2Fwww.youtube.com%2Fembed%2FfLPV61qJuhY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfLPV61qJuhY&amp;image=https%3A%2F%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>
    </channel>
</rss>