---
name: "compel"
section: "1"
platform: "linux"
package: "criu"
version: "4.2.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/compel"
---

# compel(1)

." make the size of the head bigger **NAME** **compel - Execute parasitic code within another process.**

**." make the size of the head bigger** **SYNOPSIS**

**compel** *hgen* \[*option* ...\]

**compel** *plugins* \[*PLUGIN\_NAME* ...\]

**compel** \[*--compat*\] *includes* \| *cflags* \| *ldflags*

**compel** \[*--compat*\] \[*--static*\] *libs*

." make the size of the head bigger **DESCRIPTION**

**compel** is a utility to execute arbitrary code, also called parasite code, in the context of a foreign process. 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 victim task using libcompel.a, called c-header.

." make the size of the head bigger **ARGUMENTS**

**." make the size of the head bigger** **Positional Arguments**

**hgen**

create a header from the .po file, which is the parasite binary.

**plugins**

prints the plugins available.

**ldflags**

prints the ldflags available to compel during linking of parasite code.

**cflags**

prints the compel cflags to be used during compilation of parasitic code.

**includes**

prints list of standard include directories.

**libs**

prints list of static or dynamic libraries that compel can link with.

." make the size of the head bigger **OPTIONS**

**-f**, **--file** *FILE*

Path to the binary file, *FILE*, which **compel** must turn into a header

**-o**, **--output** *FILE*

Path to the header file, *FILE*, where compel must write the resulting header.

**-p**, **--prefix** *NAME*

Specify prefix for var names

**-l**, **--log-level** *NUM*

Default log level of compel.

**-h**, **--help**

Prints usage and exits.

**-V**, **--version**

Prints version number of compel.

." make the size of the head bigger **SOURCE EXAMPLES**

**." make the size of the head bigger** **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()

." make the size of the head bigger **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:

• 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().

**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.

." make the size of the head bigger **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.

." make the size of the head bigger **AUTHOR**

**The CRIU team.**
