Detections · What MacVigil reads to decide

Runtime code loading on Mac: libraries, in-memory programs and code built on the fly

Not all of a program’s code is visible in its file. Many programs load libraries by name, look up functions at run time or build code in memory. Browsers and plug-in hosts do this every second, but malware uses the same doors to run code that never exists as a file you could inspect.

Updated November 25, 2026 · 45 detections in this category

In short

Code the program loads or makes while it runs: libraries opened by name, functions looked up with dlsym, memory made executable, program images built from a buffer. Browsers, plug-in hosts and JIT engines all do this.

MacVigil has 45 detections in this category. It reads the file to find them and never runs it.

What runtime code loading is

A program can extend itself while it runs: it opens a library with dlopen, finds a function by name with dlsym, asks for memory it can make executable, or hands text to an interpreter that turns it into code. This is how plug-ins, scripting engines and just-in-time compilers work.

For malware, the same mechanisms mean the code that matters can arrive later, from the network or from an encrypted blob, and run straight from memory. Nothing on disk shows what it does, which is why this is sometimes called fileless malware. On its own, though, runtime loading is not a sign of harm.

How Mac programs do it

What MacVigil looks for

MacVigil reads the file and never runs it. It lists the libraries and functions a program asks to load at run time, and it says plainly when the target of a dlopen or dlsym call cannot be determined by static reading, which does not prove the program hides it.

Its higher findings follow the steps in one place: one function that requests anonymous memory, fills it, makes it executable and calls into it; native code that writes a file, closes it and loads that same path as a library; or a script source decoded by the code and handed to the same object that executes it. When a script carries an encrypted blob with its key, or a string in byte escapes passed to exec, MacVigil decodes it and reads the result as a program, without running it.

A lone import of dlopen, dlsym or mprotect, or the word eval(, is low or moderate at most. Loading code is a capability, and these findings describe how a program can run code, not that the code is harmful.

When it is normal

Web browsers, JavaScript engines and emulators generate executable code all the time. Audio and video apps load plug-ins, Electron apps evaluate JavaScript, Python tools import modules from source, and Java apps load classes on demand. Runtime loading becomes a concern when the loaded code is hidden, decrypted from the file itself, or fetched from the network by a program with no identifiable publisher.

How to check a program

On the blog

Know what a file does before you open it

MacVigil reads any app, disk image, installer or script without running it, and shows the evidence behind every finding. Nothing leaves your Mac.

Download free for Mac

More: all detection categories · what MacVigil detects · the blog