Skip to content

Commit 1642b25

Browse files
authored
Update README.md
Updated README for better descriptions
1 parent 90dcde9 commit 1642b25

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,29 @@ If using C++20 there is a user defined literal for the compile time pattern.
1616

1717
*Development on arm is very new and being tested as I go, if issues are found please give a working example of bytes around the area needed*
1818

19-
*You must define the patterns::detail::ldissasm if you intend to use without insn_len_*
19+
*You must define the patterns::detail::ldissasm if you intend to use without insn_len_ and also define PATTERNSCAN_LDISASM*
20+
*Length disassembler is not required if using the X<val> method of the pattern*
2021
```c++
2122
size_t patterns::ldisasm(const void* buffer, size_t buffer_size) {
2223
// Just return 0 if not using the dereference, otherwise place in the code from another library/source to obtain the instructions length
2324
return 0;
2425
}
2526
```
2627
28+
#### Pattern Flags:
29+
- d: Dereference from the found address, or found address + offset ( addr + instructlen length + relative address )
30+
- r: Read the relative value at the address, or at the address + offset (not used on arm)
31+
<optional read size>: Value of 1, 2, 4 or 8 to use with reading the relative value at address, or address + offset (not used with dereferencing, and not used on arm)
32+
- a: Perform a byte aligned scan for a faster scan. 4 byte alignment x32, 8 byte alignment x64 (rather than byte by byte scan)
33+
34+
2735
#### Examples:
2836
```c++
2937
// Scan will read the relative value from the X offset as 4 bytes
3038
constexpr auto compiletime_pattern = "AB CC 11 22 33 44 AB 6D X EF BE AD DE /r4"_ctpattern;
3139
// Scan will read the address from where the marked X is pointed to (defaults as a relative address), and perform the scan byte aligned (4 - 32bit, 8 - 64bit)
32-
// This also uses the instruction len (notice 9 after X). This tells it during the dereference to start the RIP after the E8 instruction
33-
constexpr auto xor_pattern = "FE ED FA CE E8 X9 ? ? ? ? EF BE AD DE /da"_xorpattern;
40+
// This also uses the instruction len (notice 4 after X). This tells it during the dereference to start the RIP after the E8 instruction
41+
constexpr auto xor_pattern = "FE ED FA CE E8 X4 ? ? ? ? EF BE AD DE /da"_xorpattern;
3442
// Scan will read the address from where the marked X is pointed to (as a single byte; i.e. short jump)
3543
auto runtime_pattern = "BA BE CA FE 72 X ? 11 22 /d1"_rtpattern
36-
```
44+
```

0 commit comments

Comments
 (0)