Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
seifreed authored Oct 16, 2024
1 parent fe447f5 commit 7669722
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,63 +45,60 @@ Usage: yrg [action] [args..] load and run yara rules inside r2

### Yara generator usage

Commands Overview
**Commands Overview**

* **yrg** - Initialize a YARA rule.
yrgs - Add strings as patterns.
yrgx - Add hex patterns.
yrgf - Add function byte signatures.
yrgz - Add all strings from the current function.
**yrg** - Initialize a YARA rule.
**yrgs** - Add strings as patterns.
**yrgx** - Add hex patterns.
**yrgf** - Add function byte signatures.
**yrgz** - Add all strings from the current function.

To start using r2yara to create YARA rules automatically, follow these steps:

##### Open a binary with radare2:
**Open a binary with radare2:**

```
r2 <binary>
```

##### Generate a YARA rule:
**Generate a YARA rule:**

```
yrg
```

This initializes a new YARA rule.

##### Add strings from the binary as patterns:
**Add strings from the binary as patterns:**

```
yrgs
```

##### Add hex patterns:
**Add hex patterns:**

```
yrgx
```

##### Optionally, add function signatures:
**Optionally, add function signatures:**

```
yrgf
```

##### Once you've added the desired patterns, save the rule:
**Once you've added the desired patterns, save the rule:**

```
ys <rule_name>
```

##### To scan the binary with the loaded rules:

missing newline

**To scan the binary with the loaded rules:**
```
yrs
```
yrs - Scan the binary with loaded YARA rules.
ys <rule_name> - Save the generated rule.
**yrs** - Scan the binary with loaded YARA rules.
**ys** <rule_name> - Save the generated rule.

Run it like this:

Expand Down

0 comments on commit 7669722

Please sign in to comment.