Skip to content

Commit b55b764

Browse files
author
HD Moore
committed
Comment the support formats
1 parent 6b8b487 commit b55b764

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/pattern_offset.rb

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

28+
# The normal format is a full hexadecimal value: 0x41424344
2829
if (value.length >= 8 and value.hex > 0)
2930
value = value.hex
31+
# However, you can also specify a four-byte string
3032
elsif (value.length == 4)
3133
value = value.unpack("V").first
3234
else
35+
# Or even a hex value that isn't 8 bytes long
3336
value = value.to_i(16)
3437
end
3538

0 commit comments

Comments
 (0)