Skip to content

Commit

Permalink
Update README to reflect recent changes + fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Kozłowski committed Jul 25, 2023
1 parent 812d0c7 commit 50d40c4
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,26 @@ The idea is based on concepts seen in ptrace-parasite and early CRIU versions. T
```
make
```
##### copmpilation options
##### compilation options
You can enable support for compression and checksumming of memory dump file:
- `COMPRESS_LZ4=1` - requires liblz4
- `CHECKSUM_MD5=1` - requires libcrypto and openssl headers

There is also `ENCRYPT` option for building `libencrypt.so` that provides sample implementation of encryption layer based on libcrypto API. memcr is not linked with libencrypt.so, but it can be preloaded with `LD_PRELOAD`.
- `ENCRYPT=1` - requires libcrypto and openssl headers

Ubuntu 22.04:
```
sudo apt-get install liblz4-dev liblz4-1
sudo apt-get install libssl-dev libssl3
```

```
make COMPRESS_LZ4=1 CHECKSUM_MD5=1
```
```
make COMPRESS_LZ4=1 CHECKSUM_MD5=1 ENCRYPT=1
```

##### cross compilation
Currently supported architectures are x86_64, arm and arm64. You can cross compile memcr by providing CROSS_COMPILE prefix. i.e.:
Currently, supported architectures are x86_64, arm and arm64. You can cross compile memcr by providing `CROSS_COMPILE` prefix. i.e.:
```
make CROSS_COMPILE=arm-linux-gnueabihf-
make CROSS_COMPILE=aarch64-linux-gnu-
Expand All @@ -40,25 +43,26 @@ Basic usage to tinker with memcr is:
```
memcr -p <target pid>
```
For the list of available options check memcr help:
For the list of available options, check memcr help:
```
memcr [-p PID] [-d DIR] [-S DIR] [-l PORT|PATH] [-n] [-f] [-c]
memcr [-h] [-p PID] [-d DIR] [-S DIR] [-l PORT|PATH] [-n] [-m] [-f] [-z] [-c] [-e]
options:
-h --help help
-p --pid target processs pid
-d --dir dir where memory dump is stored (defaults to /tmp)
-S --parasite-socket-dir dirwhere socket to communicate with parasite is created
-S --parasite-socket-dir dir where socket to communicate with parasite is created
(abstract socket will be used if no path specified)
-l --listen work as a service waiting for requests on a socket
-l PORT: TCP port number to listen for requests on
-l PATH: filesystem path for UNIX domain socket file (will be created)
-n --no-wait no wait for key press
-m --proc-mem get pages from /proc/pid/mem
-f --rss-file include file mapped memory
-z --compress compress memory dump
-c --checksum enable md5 checksum for memory dump
-m --proc-mem get pages from /proc/pid/mem
-f --rss-file include file mapped memory
-z --compress compress memory dump
-c --checksum enable md5 checksum for memory dump
-e --encrypt enable encryption of memory dump
```
There is also support for client / server scenario where memcr runs as a deamon and listens for commands from a client process. The main reason for supporting this is that memcr needs rather high privileges to hijack target process and it's a good idea to keep it separate from client that can run in a container with low privileges.
memcr also supports client / server scenario where memcr runs as a deamon and listens for commands from a client process. The main reason for supporting this is that memcr needs rather high privileges to hijack target process and it's a good idea to keep it separate from memcr-client that can run in a container with low privileges.

memcr daemon:
```
Expand Down

0 comments on commit 50d40c4

Please sign in to comment.