Skip to content

Commit

Permalink
Added the --perl option to ronin unquote (closes #246).
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed Nov 23, 2024
1 parent f65b3de commit 27e3f81
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/ronin/cli/commands/unquote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ class Unquote < StringMethodsCommand
@method_calls << :powershell_unquote
end

option :perl, desc: 'Unquotes the Perl String' do
require 'ronin/support/encoding/perl'
@method_calls << :perl_unquote
end

option :php, short: '-p',
desc: 'Unquotes the PHP String' do
require 'ronin/support/encoding/php'
Expand Down
3 changes: 3 additions & 0 deletions man/ronin-unquote.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ Unquotes a double/single quoted string.
`-P`, `--powershell`
: Unquotes the PowerShell String.

`--perl`
: Unquotes the Perl String.

`-p`, `--php`
: Unquotes the PHP String.

Expand Down
12 changes: 12 additions & 0 deletions spec/cli/commands/unquote_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@
end
end

describe "--perl" do
let(:argv) { %w[--perl] }

it "must require 'ronin/support/encoding/perl'" do
expect(require('ronin/support/encoding/perl')).to be(false)
end

it "must add :perl_unquote to #method_calls" do
expect(subject.method_calls.last).to eq(:perl_unquote)
end
end

describe "--php" do
let(:argv) { %w[--php] }

Expand Down

0 comments on commit 27e3f81

Please sign in to comment.