Skip to content

Commit bcd64b5

Browse files
author
HD Moore
committed
Some examples of use
1 parent b55b764 commit bcd64b5

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tools/pattern_offset.rb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,42 @@
2525
value = ARGV.shift
2626
len = ARGV.shift || 8192
2727

28+
=begin
29+
30+
Examples:
31+
32+
$ ./tools/pattern_create.rb 128
33+
Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae
34+
35+
$ ./tools/pattern_offset.rb 8Ac9
36+
[*] Exact match at offset 86
37+
38+
$ ./tools/pattern_offset.rb 39634138
39+
[*] Exact match at offset 86
40+
41+
$ ./tools/pattern_offset.rb 0x39634138
42+
[*] Exact match at offset 86
43+
44+
$ ./tools/pattern_offset.rb 0x396341FF
45+
[*] No exact matches, looking for likely candidates...
46+
[+] Possible match at offset 86 (adjusted [ little-endian: 199 | big-endian: 18996934 ] ) byte offset 0
47+
48+
$ ./tools/pattern_offset.rb 0x3963FFFF
49+
[*] No exact matches, looking for likely candidates...
50+
[+] Possible match at offset 86 (adjusted [ little-endian: 48839 | big-endian: 19045574 ] )
51+
[ snip ]
52+
53+
$ ./tools/pattern_offset.rb 0xFFFF4138
54+
[*] No exact matches, looking for likely candidates...
55+
[+] Possible match at offset 26 (adjusted [ little-endian: 3332243456 | big-endian: 3351109631 ] )
56+
[+] Possible match at offset 56 (adjusted [ little-endian: 3332177920 | big-endian: 3351109375 ] )
57+
[+] Possible match at offset 86 (adjusted [ little-endian: 3332112384 | big-endian: 3351109119 ] )
58+
[ snip ]
59+
60+
=end
61+
62+
63+
2864
# The normal format is a full hexadecimal value: 0x41424344
2965
if (value.length >= 8 and value.hex > 0)
3066
value = value.hex

0 commit comments

Comments
 (0)