diff --git a/src/binwalk/core/module.py b/src/binwalk/core/module.py index cfe9e16..2365d97 100644 --- a/src/binwalk/core/module.py +++ b/src/binwalk/core/module.py @@ -47,7 +47,11 @@ class Option(object): def convert(self, value): if self.type and (self.type.__name__ == self.dtype): - return self.type(value) + # Be sure to specify a base of 0 for int() so that the base is auto-detected + if self.type == int: + return self.type(value, 0) + else: + return self.type(value) else: return value diff --git a/src/binwalk/magic/binwalk b/src/binwalk/magic/binwalk index 024ce56..e3aa77e 100644 --- a/src/binwalk/magic/binwalk +++ b/src/binwalk/magic/binwalk @@ -1263,10 +1263,16 @@ >>20 beshort >4 \binvalid, >28 beshort <3 >>8 belong x size: %d bytes, +>>8 belong x \b{jump-to-offset:%d} +>>8 belong x \b{file-size:%d} >28 beshort 3 >>63 bequad x size: %lld bytes, +>>63 bequad x \b{jump-to-offset:%lld} +>>63 bequad x \b{file-size:%lld} >28 beshort >3 >>40 bequad x size: %lld bytes, +>>40 bequad x \b{jump-to-offset:%lld} +>>40 bequad x \b{file-size:%lld} >4 belong x %d inodes, >28 beshort >3 >>12 belong blocksize: %d bytes, @@ -1282,12 +1288,6 @@ >>39 bedate x created: %s >28 beshort >3 >>8 bedate x created: %s ->28 beshort <3 ->>8 belong x {jump-to-offset:%d} ->28 beshort 3 ->>63 bequad x {jump-to-offset:%lld} ->28 beshort >3 ->>40 bequad x {jump-to-offset:%lld} # Squashfs, little endian 0 string hsqs Squashfs filesystem, little endian, diff --git a/src/magic/filesystems b/src/magic/filesystems index 9fc02a8..eb9c231 100644 --- a/src/magic/filesystems +++ b/src/magic/filesystems @@ -156,10 +156,16 @@ >>20 beshort >4 \binvalid, >28 beshort <3 >>8 belong x size: %d bytes, +>>8 belong x \b{jump-to-offset:%d} +>>8 belong x \b{file-size:%d} >28 beshort 3 >>63 bequad x size: %lld bytes, +>>63 bequad x \b{jump-to-offset:%lld} +>>63 bequad x \b{file-size:%lld} >28 beshort >3 >>40 bequad x size: %lld bytes, +>>40 bequad x \b{jump-to-offset:%lld} +>>40 bequad x \b{file-size:%lld} >4 belong x %d inodes, >28 beshort >3 >>12 belong blocksize: %d bytes, @@ -175,12 +181,6 @@ >>39 bedate x created: %s >28 beshort >3 >>8 bedate x created: %s ->28 beshort <3 ->>8 belong x {jump-to-offset:%d} ->28 beshort 3 ->>63 bequad x {jump-to-offset:%lld} ->28 beshort >3 ->>40 bequad x {jump-to-offset:%lld} # Squashfs, little endian 0 string hsqs Squashfs filesystem, little endian,