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.pofile, 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)orint 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_signocould be read by callingcompel_parse_stop_signo().
π¨ quick vibe check:ctlmust be configured with blob information by callingPREFIX_setup_c_header(), withctlas its argument.PREFIXis the argument given to-pwhen callinghgen, 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