Changes

Jump to navigation Jump to search
1 byte added ,  14:14, 25 November 2016
Line 66: Line 66:  
=== Infecting ===
 
=== Infecting ===
   −
Infecting the victim with parasite blob needs some special treatment. First, the ctl should be configured with the blob information. Currently there's only one type of blobs, generated by <code>compel hgen</code>. To put this info into ctl one should
+
Infecting the victim with parasite blob needs some special treatment. First, the ctl should be configured with the blob information. Currently there's only one type of blobs, generated by <code>compel hgen</code>. To put this info into ctl one should call <code>compel_parasite_blob_desc(ctl)</code> to get a pointer on <code>struct parasite_blob_desc</code> and fill in the fields of this strucure
   −
* Call <code>compel_parasite_blob_desc(ctl)</code> to get a pointer on <code>struct parasite_blob_desc</code>
+
* <code>.parasite_type</code> should be set to <code>COMPEL_BLOB_CHEADER</code>
* Fill in the bdesc fields
+
* <code>.hdr.mem</code> should be set to the <code>parasite_blob</code> of hgen
** <code>.parasite_type</code> should be set to <code>COMPEL_BLOB_CHEADER</code>
+
* <code>.hdr.bsize</code> should be set to the sizeof(this symbol)
** <code>.hdr.mem</code> should be set to the <code>parasite_blob</code> of hgen
+
* <code>.hdr.nr_gotpcrel</code> should be set to the <code>parasite_nr_gotpcrel</code> of hgen
** <code>.hdr.bsize</code> should be set to the sizeof(this symbol)
+
* Three offsets below should be set to respective offsets generated with the <code>parasite_sym</code> value
** <code>.hdr.nr_gotpcrel</code> should be set to the <code>parasite_nr_gotpcrel</code> of hgen
+
** <code>.hdr.parasite_ip_off</code> to <code>COMPEL_H_PARASITE_HEAD(parasite_sym)</code>
** Three offsets below should be set to respective offsets generated with the <code>parasite_sym</code> value
+
** <code>.hdr.addr_cmd_off</code>  to <code>COMPEL_H_PARASITE_CMD(parasite_sym)</code>
*** <code>.hdr.parasite_ip_off</code> to <code>COMPEL_H_PARASITE_HEAD(parasite_sym)</code>
+
** <code>.hdr.addr_arg_off</code>  to <code>COMPEL_H_PARASITE_ARGS(paraste_sym)</code>
*** <code>.hdr.addr_cmd_off</code>  to <code>COMPEL_H_PARASITE_CMD(parasite_sym)</code>
+
* <code>.hdr.relocs</code> should be set to <code>parasite_relocs</code> argument (it's an array)
*** <code>.hdr.addr_arg_off</code>  to <code>COMPEL_H_PARASITE_ARGS(paraste_sym)</code>
+
* <code>.hdr.nr_relocs</code> should be set to the number of elements in this array (<code>sizeof(arr)/sizeof(arr[0])</code>)
** <code>.hdr.relocs</code> should be set to <code>parasite_relocs</code> argument (it's an array)
  −
** <code>.hdr.nr_relocs</code> should be set to the number of elements in this array (<code>sizeof(arr)/sizeof(arr[0])</code>)
      
=== Arguments passing ===
 
=== Arguments passing ===

Navigation menu