Skip to content

Commit

Permalink
Fixed a bug in String#unpack where Template wasn't being used.
Browse files Browse the repository at this point in the history
* This prevented unpacking complex types: `"...".unpack([[:uint32, 4], 10])`.
  • Loading branch information
postmodern committed Dec 15, 2023
1 parent be45be5 commit 0609de8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ronin/support/binary/core_ext/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def unpack(*arguments,**kwargs)
if (arguments.length == 1 && arguments.first.kind_of?(String))
unpack_original(arguments.first)
else
format = Ronin::Support::Binary::Template.new(arguments,**kwargs)
unpack_original(format.pack_string)
template = Ronin::Support::Binary::Template.new(arguments,**kwargs)
template.unpack(self)
end
end

Expand Down

0 comments on commit 0609de8

Please sign in to comment.