forked from epi052/osed-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.py
38 lines (28 loc) · 845 Bytes
/
search.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
import argparse
import pykd
def main(args):
choice_table = {"byte": "b", "ascii": "a", "unicode": "u"}
command = f"s -{choice_table.get(args.type)} 0 L?80000000 {args.pattern}"
print(f'[=] running {command}')
result = pykd.dbgCommand(command)
if result is None:
return print('[*] No results returned')
print(result)
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Searches memory for the given search term"
)
parser.add_argument(
"-t",
"--type",
default="byte",
choices=["byte", "ascii", "unicode"],
help="data type to search for (default: byte)",
)
parser.add_argument(
"pattern",
help="what you want to search for",
)
args = parser.parse_args()
main(args)