<commit_before>ELFPlayer
============

ELFPlayer is a tool for visualizing the execution of 32-bit x86 ELFs (with
symbols). This can be useful for getting a better understanding of what your
code is doing, crafting exploits, or side-channel analysis.

**Currently, ELFPlayer is prototype quality. This is a beta release.**

[ElfPlayer Screenshot](https://defuse.ca/files2/github-elfplayer-ss.png)

ELFPlayer is made up of three components: The tracer, encoder, and player.

Tracer
--------

The tracer is a C program that uses ptrace to save all of the EIP values as your
program executes. To use it, pass the output file on the command line followed
by the command to execute under ptrace (just like `strace`).

For exaple, if you've built the `hello` sample in the `samples` directory (by
`gcc -m32 hello.c -o hello`), here's how you trace it (with an unnecessary
command-line argument for demonstration):

```
$ ./tracer/tracer ./output ./samples/hello --an-argument-to-hello
```

This will save all of the EIP values to `./output.`. To visualize it, you first
have to encode it into a JSON file that the player supports. Use the encoder
tool to do that.

Encoder<commit_msg>Make screenshot an image<commit_after>ELFPlayer
============

ELFPlayer is a tool for visualizing the execution of 32-bit x86 ELFs (with
symbols). This can be useful for getting a better understanding of what your
code is doing, crafting exploits, or side-channel analysis.

**Currently, ELFPlayer is prototype quality. This is a beta release.**

![ElfPlayer Screenshot](https://defuse.ca/files2/github-elfplayer-ss.png)

ELFPlayer is made up of three components: The tracer, encoder, and player.

Tracer
--------

The tracer is a C program that uses ptrace to save all of the EIP values as your
program executes. To use it, pass the output file on the command line followed
by the command to execute under ptrace (just like `strace`).

For exaple, if you've built the `hello` sample in the `samples` directory (by
`gcc -m32 hello.c -o hello`), here's how you trace it (with an unnecessary
command-line argument for demonstration):

```
$ ./tracer/tracer ./output ./samples/hello --an-argument-to-hello
```

This will save all of the EIP values to `./output.`. To visualize it, you first
have to encode it into a JSON file that the player supports. Use the encoder
tool to do that.

Encoder
{'fraction_non_alphanumeric': 0.0933277027027027, 'fraction_numerical': 0.0059121621621621625, 'mean_word_length': 4.040425531914893, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1580736', 'n_tokens_mistral': 703, 'n_tokens_neox': 655, 'n_words': 344}