COMPEL(1)

πŸ’… COMPEL(1) β€” the CRIU manual, bestie edition ✨

okay so real talk: you're reading the COMPEL(1) page from the CRIU Manual, and honestly? it's giving underrated icon. let's get into it 🫢


✨ NAME ✨

compel β€” execute parasitic code within another process. yeah. another process. we're visiting. we did not knock. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

compel hgen [option ...]

compel plugins [PLUGIN_NAME ...]

compel [--compat] includes | cflags | ldflags

compel [--compat] [--static] libs

like, pick a lane, but make it four lanes. slay 🌈


πŸ¦‹ DESCRIPTION πŸ¦‹

compel is a utility to execute arbitrary code β€” also called parasite code β€” in the context of a foreign process. not me describing your code as a parasite 😭 but that's the terminology, it's literally canon.

the parasitic code, once compiled with compel flags and packed, can be executed in the context of other tasks. currently there is only one way to load the parasitic blob into the victim task using libcompel.a, and it's called c-header. one way. the way. main character energy fr fr πŸ‘‘


🌸 ARGUMENTS 🌸

πŸ’œ Positional Arguments

  • hgen β€” create a header from the .po file, which is the parasite binary. glow-up era: binary β†’ header ✨
  • plugins β€” prints the plugins available. window shopping, but for plugins πŸ›οΈ
  • ldflags β€” prints the ldflags available to compel during linking of parasite code. the linker's love language πŸ’–
  • cflags β€” prints the compel cflags to be used during compilation of parasitic code. compiler gossip β˜•
  • includes β€” prints list of standard include directories. the where-is-everything list πŸ“
  • libs β€” prints list of static or dynamic libraries that compel can link with. besties it can link with, pick your fave 🫢

⭐ OPTIONS ⭐

  • -f, --file FILE β€” path to the binary file, FILE, which compel must turn into a header. the raw material, the before pic πŸ’…
  • -o, --output FILE β€” path to the header file, FILE, where compel must write the resulting header. the after pic ✨
  • -p, --prefix NAME β€” specify prefix for var names. yes, the names have a last name now πŸŽ€
  • -l, --log-level NUM β€” default log level of compel. how chatty we're being, on a scale of NUM πŸ—£οΈ
  • -h, --help β€” prints usage and exits. the classic "what does this even do" button πŸ’€
  • -V, --version β€” prints version number of compel. identity check πŸͺͺ

πŸ”₯ SOURCE EXAMPLES πŸ”₯

🧚 Parasitic Code

#include <compel/plugins/std.h>

int parasite_trap_cmd(int cmd, void *args); //gets called by
compel_run_in_thread()

int parasite_daemon_cmd(int cmd, void *arg); // gets called by
compel_rpc_call() and compel_rpc_call_sync()

void parasite_cleanup(void); //gets called on parasite unload by
compel_cure()

πŸ¦‹ Infecting code

the parasitic code is compiled and converted to a header using compel, and included here.

#include <compel/infect.h>

#include "parasite.h"

following steps are performed to infect the victim process β€” and yes, it's a whole sequence, keep up bestie πŸ’«

  • stop the task: int compel_stop_task(int pid);
  • prepare infection handler: struct parasite_ctl *compel_prepare(int pid, bool handle_rseq);
  • execute system call: int compel_syscall(ctl, int syscall_nr, long *ret, int arg ...);
  • infect victim: int compel_infect(ctl, nr_thread, size_of_args_area);
  • cure the victim: int compel_cure(ctl); //ctl pointer is freed by this call ⚠️
  • Resume victim: int compel_resume_task(pid, orig_state, state) or int compel_resume_task_sig(pid, orig_state, state, stop_signo). //compel_resume_task_sig() could be used in case when victim is in stopped state. stop_signo could be read by calling compel_parse_stop_signo().
🚨 quick vibe check: ctl must be configured with blob information by calling PREFIX_setup_c_header(), with ctl as its argument. PREFIX is the argument given to -p when calling hgen, else it is deduced from file name. don't skip this step, it's not optional, it's mandatory 😀

🌈 EXAMPLES 🌈

to generate a header file (.h) from a parasite binary file (.po) use:

compel hgen -f parasite.po -o parasite.h

parasite.po file is obtained by compiling the parasite source with compel flags and linking it with the compel plugins. that's the pipeline, that's the whole lore 🎬


πŸ‘‘ AUTHOR πŸ‘‘

the CRIU team. legends, honestly 🫑


and that's the page!! sourced from criu 4.2.1, dated 07/21/2026 β€” screenshot it, bookmark it, tell your friends, this is the COMPEL(1) moment πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from
  • arch rolling: criu 4.2.1-1 Β· GPL-2.0-only AND LGPL-2.1-only
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms