Changes

6 bytes added ,  13:56, 25 November 2016
Line 36: Line 36:  
The .po blob can now be loaded as parasite.
 
The .po blob can now be loaded as parasite.
   −
== Running ==
+
== Loading blob ==
   −
Using CLI, the compiled and packed parasite code can be executed like this:
+
=== Using CLI ===
 +
 
 +
This functionality is in plans and not implemented yet.
 +
 
 +
=== Using libcompel.a library ===
 +
 
 +
In libcompel.a there's currently only one way to load the blob into victim task, it's called 'c-header'. So first you should make a header out of you .po file
    
<pre>
 
<pre>
$ compel run -f foo.compel.o -p ''pid'' [args ...]
+
compel hgen -f parasite.po -v parasite_relocs -p parasite_sym -s parasite_blob -r parasite_nr_gotpcrel -u compel/include/uapi/ -o parasite.h
 
</pre>
 
</pre>
   −
Alternatively, you can link it with the <code>libcompel.so</code> and use the following calls:
+
After this the <code>parasite.h</code> file should be included into the infecting program and compiled with it.
 
  −
<source lang="C">
  −
libcompel_exec();
  −
libcompel_exec_start();
  −
libcompel_exec_end();
  −
</source>
  −
 
  −
These library calls require binary argument that is copied into the parasite context and is available from it via arg_p/arg_s pair. When run from CLI, the arguments are packed in the usual way (argc/argv).
      
== Communicating ==
 
== Communicating ==