diff options
| author | Orfeas <38209077+0xfea5@users.noreply.github.com> | 2024-04-16 03:33:40 +0300 |
|---|---|---|
| committer | Orfeas <38209077+0xfea5@users.noreply.github.com> | 2024-04-16 04:09:21 +0300 |
| commit | 7de6d2226b9746e2a2d90a00aa130282cb23605d (patch) | |
| tree | d98fd7dbdc816ced520e92a3be202d0ce0b32bbd /src/vm.h | |
| parent | Parse /proc/pid/maps (diff) | |
| download | linux-game-trainer-7de6d2226b9746e2a2d90a00aa130282cb23605d.tar.gz linux-game-trainer-7de6d2226b9746e2a2d90a00aa130282cb23605d.zip | |
Memory scanning to find byte patterns
Diffstat (limited to 'src/vm.h')
| -rw-r--r-- | src/vm.h | 12 |
1 files changed, 10 insertions, 2 deletions
| @@ -3,8 +3,8 @@ | |||
| 3 | #include <stdint.h> | 3 | #include <stdint.h> |
| 4 | 4 | ||
| 5 | typedef struct VMMapping { | 5 | typedef struct VMMapping { |
| 6 | uint64_t begin; | 6 | void *begin; |
| 7 | uint64_t end; | 7 | void *end; |
| 8 | uint8_t r:1; | 8 | uint8_t r:1; |
| 9 | uint8_t w:1; | 9 | uint8_t w:1; |
| 10 | uint8_t x:1; | 10 | uint8_t x:1; |
| @@ -14,6 +14,14 @@ typedef struct VMMapping { | |||
| 14 | struct VMMapping *next; | 14 | struct VMMapping *next; |
| 15 | } VMMapping; | 15 | } VMMapping; |
| 16 | 16 | ||
| 17 | typedef struct MemscanResult { | ||
| 18 | VMMapping *mapping; | ||
| 19 | off_t offset; | ||
| 20 | struct MemscanResult *next; | ||
| 21 | } MemscanResult; | ||
| 22 | |||
| 17 | VMMapping* parse_vmmap (int pid); | 23 | VMMapping* parse_vmmap (int pid); |
| 18 | 24 | ||
| 25 | MemscanResult* memscan(int pid, uint8_t *byte_seq, uint64_t byte_seq_len); | ||
| 26 | |||
| 19 | #endif // _VM_H_ | 27 | #endif // _VM_H_ |
