pwntools 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/pwnlib/abi.rb +3 -3
- data/lib/pwnlib/asm.rb +20 -20
- data/lib/pwnlib/constants/constant.rb +1 -2
- data/lib/pwnlib/dynelf.rb +2 -2
- data/lib/pwnlib/logger.rb +2 -2
- data/lib/pwnlib/reg_sort.rb +2 -2
- data/lib/pwnlib/shellcraft/generators/helper.rb +1 -1
- data/lib/pwnlib/shellcraft/generators/x86/common/common.rb +3 -2
- data/lib/pwnlib/shellcraft/generators/x86/common/pushstr_array.rb +1 -1
- data/lib/pwnlib/shellcraft/generators/x86/linux/syscall.rb +1 -1
- data/lib/pwnlib/shellcraft/registers.rb +2 -3
- data/lib/pwnlib/tubes/sock.rb +3 -2
- data/lib/pwnlib/util/fiddling.rb +5 -5
- data/lib/pwnlib/util/getdents.rb +3 -2
- data/lib/pwnlib/util/packing.rb +1 -1
- data/lib/pwnlib/version.rb +1 -1
- data/test/asm_test.rb +3 -3
- data/test/data/echo.rb +3 -3
- data/test/files/use_pwn.rb +2 -2
- data/test/logger_test.rb +2 -2
- data/test/tubes/process_test.rb +1 -1
- data/test/tubes/serialtube_test.rb +1 -1
- data/test/tubes/sock_test.rb +1 -1
- data/test/util/fiddling_test.rb +2 -2
- metadata +75 -69
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25176dd168e5b1f2653b2d69198fd1dec741d3314712837697635a290d923e3b
|
4
|
+
data.tar.gz: 407ba3df5888aa6e2450b412294403904050009b35fae8e6decebf4ff8d154dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f118ad7a0a6aadc067b9cd1d11a9d230190440fdc8749127dc8630d8ce630833d5346527ee73960579a71392938d639d89569b85b27eae562dfbbe7fefddab5
|
7
|
+
data.tar.gz: cf5d022ed588bdedcce275f461976d53c4c722119af7315c92241e6588d770ac581c89d63cdda555833d1efbfa43ceb01ea5e763021aeb3c3a452d656327b0d0
|
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
[![GitHub stars](https://img.shields.io/github/stars/peter50216/pwntools-ruby.svg)](https://github.com/peter50216/pwntools-ruby/stargazers)
|
2
2
|
[![GitHub issues](https://img.shields.io/github/issues/peter50216/pwntools-ruby.svg)](https://github.com/peter50216/pwntools-ruby/issues)
|
3
|
-
[![Build Status](https://
|
3
|
+
[![Build Status](https://github.com/peter50216/pwntools-ruby/workflows/build/badge.svg)](https://github.com/peter50216/pwntools-ruby/actions)
|
4
4
|
[![Test Coverage](https://img.shields.io/codeclimate/coverage/peter50216/pwntools-ruby.svg)](https://codeclimate.com/github/peter50216/pwntools-ruby/coverage)
|
5
5
|
[![Code Climate](https://img.shields.io/codeclimate/maintainability/peter50216/pwntools-ruby.svg)](https://codeclimate.com/github/peter50216/pwntools-ruby)
|
6
6
|
[![Inline docs](https://inch-ci.org/github/peter50216/pwntools-ruby.svg)](https://inch-ci.org/github/peter50216/pwntools-ruby)
|
7
7
|
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](http://choosealicense.com/licenses/mit/)
|
8
8
|
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=peter50216/pwntools-ruby)](https://dependabot.com)
|
9
|
-
[![Rawsec's CyberSecurity Inventory](https://inventory.
|
9
|
+
[![Rawsec's CyberSecurity Inventory](https://inventory.raw.pm/img/badges/Rawsec-inventoried-FF5050_flat.svg)](https://inventory.raw.pm/)
|
10
10
|
<!-- [![Dependency Status](https://img.shields.io/gemnasium/peter50216/pwntools-ruby.svg)](https://gemnasium.com/peter50216/pwntools-ruby) -->
|
11
11
|
|
12
12
|
# pwntools-ruby
|
data/lib/pwnlib/abi.rb
CHANGED
@@ -8,11 +8,10 @@ module Pwnlib
|
|
8
8
|
module ABI
|
9
9
|
# A super class for recording registers and stack's information.
|
10
10
|
class ABI
|
11
|
-
attr_reader :register_arguments
|
12
|
-
attr_reader :arg_alignment
|
13
|
-
attr_reader :stack_pointer
|
11
|
+
attr_reader :register_arguments, :arg_alignment, :stack_pointer
|
14
12
|
# Only used for x86, to specify the +eax+, +edx+ pair.
|
15
13
|
attr_reader :cdq_pair
|
14
|
+
|
16
15
|
def initialize(regs, align, stack_pointer, cdq_pair: nil)
|
17
16
|
@register_arguments = regs
|
18
17
|
@arg_alignment = align
|
@@ -42,6 +41,7 @@ module Pwnlib
|
|
42
41
|
# which must be loaded into the specified register.
|
43
42
|
class SyscallABI < ABI
|
44
43
|
attr_reader :syscall_str
|
44
|
+
|
45
45
|
def initialize(regs, align, stack_pointer, syscall_str)
|
46
46
|
super(regs, align, stack_pointer)
|
47
47
|
@syscall_str = syscall_str
|
data/lib/pwnlib/asm.rb
CHANGED
@@ -25,6 +25,25 @@ module Pwnlib
|
|
25
25
|
arm: 0x8000
|
26
26
|
}.freeze
|
27
27
|
|
28
|
+
# Mapping +context.arch+ to +::ELFTools::Constants::EM::EM_*+.
|
29
|
+
ARCH_EM = {
|
30
|
+
aarch64: 'AARCH64',
|
31
|
+
alpha: 'ALPHA',
|
32
|
+
amd64: 'X86_64',
|
33
|
+
arm: 'ARM',
|
34
|
+
cris: 'CRIS',
|
35
|
+
i386: '386',
|
36
|
+
ia64: 'IA_64',
|
37
|
+
m68k: '68K',
|
38
|
+
mips64: 'MIPS',
|
39
|
+
mips: 'MIPS',
|
40
|
+
powerpc64: 'PPC64',
|
41
|
+
powerpc: 'PPC',
|
42
|
+
s390: 'S390',
|
43
|
+
sparc64: 'SPARCV9',
|
44
|
+
sparc: 'SPARC'
|
45
|
+
}.freeze
|
46
|
+
|
28
47
|
# Disassembles a bytestring into human readable assembly.
|
29
48
|
#
|
30
49
|
# {.disasm} depends on another open-source project - capstone, error will be raised if capstone is not intalled.
|
@@ -244,7 +263,7 @@ module Pwnlib
|
|
244
263
|
def require_message(lib, msg)
|
245
264
|
require lib
|
246
265
|
rescue LoadError => e
|
247
|
-
raise ::Pwnlib::Errors::DependencyError, e.message
|
266
|
+
raise ::Pwnlib::Errors::DependencyError, "#{e.message}\n\n#{msg}"
|
248
267
|
end
|
249
268
|
|
250
269
|
def install_crabstone_guide
|
@@ -317,25 +336,6 @@ https://github.com/keystone-engine/keystone/tree/master/docs
|
|
317
336
|
end
|
318
337
|
end
|
319
338
|
|
320
|
-
# Mapping +context.arch+ to +::ELFTools::Constants::EM::EM_*+.
|
321
|
-
ARCH_EM = {
|
322
|
-
aarch64: 'AARCH64',
|
323
|
-
alpha: 'ALPHA',
|
324
|
-
amd64: 'X86_64',
|
325
|
-
arm: 'ARM',
|
326
|
-
cris: 'CRIS',
|
327
|
-
i386: '386',
|
328
|
-
ia64: 'IA_64',
|
329
|
-
m68k: '68K',
|
330
|
-
mips64: 'MIPS',
|
331
|
-
mips: 'MIPS',
|
332
|
-
powerpc64: 'PPC64',
|
333
|
-
powerpc: 'PPC',
|
334
|
-
s390: 'S390',
|
335
|
-
sparc64: 'SPARCV9',
|
336
|
-
sparc: 'SPARC'
|
337
|
-
}.freeze
|
338
|
-
|
339
339
|
def e_machine
|
340
340
|
const = ARCH_EM[context.arch.to_sym]
|
341
341
|
unsupported!("Unknown machine type of architecture #{context.arch.inspect}.") if const.nil?
|
@@ -23,16 +23,15 @@ module Pwnlib
|
|
23
23
|
# @param [String] str
|
24
24
|
# @param [Integer] val
|
25
25
|
def initialize(str, val)
|
26
|
+
super()
|
26
27
|
@str = str
|
27
28
|
@val = val
|
28
29
|
end
|
29
30
|
|
30
31
|
# We don't need to fall back to super for this, so just disable the lint.
|
31
|
-
# rubocop:disable Style/MethodMissingSuper
|
32
32
|
def method_missing(method, *args, &block)
|
33
33
|
@val.__send__(method, *args, &block)
|
34
34
|
end
|
35
|
-
# rubocop:enable Style/MethodMissingSuper
|
36
35
|
|
37
36
|
def respond_to_missing?(method, include_all)
|
38
37
|
@val.respond_to?(method, include_all)
|
data/lib/pwnlib/dynelf.rb
CHANGED
@@ -63,7 +63,7 @@ module Pwnlib
|
|
63
63
|
sym = symtab + sym_size * i
|
64
64
|
st_name = @leak.d(sym)
|
65
65
|
name = @leak.n(strtab + st_name, symbol.length + 1)
|
66
|
-
if name == (symbol
|
66
|
+
if name == ("#{symbol}\x00")
|
67
67
|
offset = { 32 => 4, 64 => 8 }[@elfclass]
|
68
68
|
st_value = unpack(@leak.n(sym + offset, @elfword))
|
69
69
|
return @libbase + st_value
|
@@ -82,7 +82,7 @@ module Pwnlib
|
|
82
82
|
build_id_offsets.each do |offset|
|
83
83
|
next unless @leak.n(@libbase + offset + 12, 4) == "GNU\x00"
|
84
84
|
|
85
|
-
return @leak.n(@libbase + offset + 16, 20).
|
85
|
+
return @leak.n(@libbase + offset + 16, 20).unpack1('H*')
|
86
86
|
end
|
87
87
|
nil
|
88
88
|
end
|
data/lib/pwnlib/logger.rb
CHANGED
@@ -34,7 +34,7 @@ module Pwnlib
|
|
34
34
|
|
35
35
|
# Instantiate a {Pwnlib::Logger::LoggerType} object.
|
36
36
|
def initialize
|
37
|
-
super(
|
37
|
+
super($stdout)
|
38
38
|
@formatter = proc do |severity, _datetime, progname, msg|
|
39
39
|
format("[%s] %s\n", Rainbow(progname || severity).color(SEV_COLOR[severity]), msg)
|
40
40
|
end
|
@@ -63,7 +63,7 @@ module Pwnlib
|
|
63
63
|
return if @logdev.nil? || level < context.log_level
|
64
64
|
|
65
65
|
@logdev.write(
|
66
|
-
message.lines.map { |s|
|
66
|
+
"#{message.lines.map { |s| " #{s}" }.join}\n"
|
67
67
|
)
|
68
68
|
true
|
69
69
|
end
|
data/lib/pwnlib/reg_sort.rb
CHANGED
@@ -52,7 +52,7 @@ module Pwnlib
|
|
52
52
|
# randomize = context.randomize if randomize.nil?
|
53
53
|
|
54
54
|
# TODO(david942j): stringify_keys
|
55
|
-
in_out = in_out.
|
55
|
+
in_out = in_out.transform_keys(&:to_s)
|
56
56
|
# Drop all registers which will be set to themselves.
|
57
57
|
# Ex. {eax: 'eax'}
|
58
58
|
in_out.reject! { |k, v| k == v }
|
@@ -83,7 +83,7 @@ module Pwnlib
|
|
83
83
|
|
84
84
|
# Let's do the topological sort.
|
85
85
|
# so sad ruby 2.1 doesn't have +itself+...
|
86
|
-
deg = graph.values.group_by { |i| i }.
|
86
|
+
deg = graph.values.group_by { |i| i }.transform_values(&:size)
|
87
87
|
graph.each_key { |k| deg[k] ||= 0 }
|
88
88
|
|
89
89
|
until deg.empty?
|
@@ -32,7 +32,7 @@ module Pwnlib
|
|
32
32
|
# Indent each line 2 spaces.
|
33
33
|
def typesetting
|
34
34
|
indent = @_output.string.lines.map do |line|
|
35
|
-
next line.strip
|
35
|
+
next "#{line.strip}\n" if label_str?(line.strip)
|
36
36
|
|
37
37
|
line == "\n" ? line : ' ' * 2 + line.lstrip
|
38
38
|
end
|
@@ -11,9 +11,10 @@ module Pwnlib
|
|
11
11
|
class << self
|
12
12
|
def define_arch_dependent_method(method)
|
13
13
|
define_method(method) do |*args, **kwargs|
|
14
|
-
|
14
|
+
case context.arch
|
15
|
+
when 'amd64'
|
15
16
|
cat Amd64::Common.public_send(method, *args, **kwargs)
|
16
|
-
|
17
|
+
when 'i386'
|
17
18
|
cat I386::Common.public_send(method, *args, **kwargs)
|
18
19
|
end
|
19
20
|
end
|
@@ -63,7 +63,7 @@ module Pwnlib
|
|
63
63
|
# #=> nil
|
64
64
|
def pushstr_array(reg, array)
|
65
65
|
abi = ::Pwnlib::ABI::ABI.default
|
66
|
-
array = array.map { |a| a.gsub(/\x00+\Z/, '')
|
66
|
+
array = array.map { |a| "#{a.gsub(/\x00+\Z/, '')}\x00" }
|
67
67
|
array_str = array.join
|
68
68
|
word_size = abi.arg_alignment
|
69
69
|
offset = array_str.size + word_size
|
@@ -34,8 +34,7 @@ module Pwnlib
|
|
34
34
|
# @return [String]
|
35
35
|
# Register's name.
|
36
36
|
attr_reader :name
|
37
|
-
attr_reader :bigger, :smaller, :ff00, :is64bit, :native64, :native32, :xor
|
38
|
-
attr_reader :size, :sizes
|
37
|
+
attr_reader :bigger, :smaller, :ff00, :is64bit, :native64, :native32, :xor, :size, :sizes
|
39
38
|
|
40
39
|
# Instantiate a {Register} object.
|
41
40
|
#
|
@@ -66,7 +65,7 @@ module Pwnlib
|
|
66
65
|
@xor = @sizes[[size, 32].min]
|
67
66
|
break
|
68
67
|
end
|
69
|
-
@ff00 = name[1]
|
68
|
+
@ff00 = "#{name[1]}h" if @size >= 32 && @name.end_with?('x')
|
70
69
|
@is64bit = true if @name.start_with?('r')
|
71
70
|
end
|
72
71
|
|
data/lib/pwnlib/tubes/sock.rb
CHANGED
data/lib/pwnlib/util/fiddling.rb
CHANGED
@@ -27,7 +27,7 @@ module Pwnlib
|
|
27
27
|
# @example
|
28
28
|
# enhex('217') #=> '323137'
|
29
29
|
def enhex(s)
|
30
|
-
s.
|
30
|
+
s.unpack1('H*')
|
31
31
|
end
|
32
32
|
|
33
33
|
# Hex-decodes a string.
|
@@ -91,8 +91,8 @@ module Pwnlib
|
|
91
91
|
# @example
|
92
92
|
# urldecode('test%20url') #=> 'test url'
|
93
93
|
# urldecode('%qw%er%ty') #=> raise ArgumentError
|
94
|
-
# urldecode('%qw%er%ty', true) #=> '%qw%er%ty'
|
95
|
-
def urldecode(s, ignore_invalid
|
94
|
+
# urldecode('%qw%er%ty', ignore_invalid: true) #=> '%qw%er%ty'
|
95
|
+
def urldecode(s, ignore_invalid: false)
|
96
96
|
res = +''
|
97
97
|
n = 0
|
98
98
|
while n < s.size
|
@@ -142,7 +142,7 @@ module Pwnlib
|
|
142
142
|
when String
|
143
143
|
v = +'B*'
|
144
144
|
v.downcase! if is_little
|
145
|
-
s.
|
145
|
+
s.unpack1(v).chars.map { |ch| ch == '1' ? one : zero }
|
146
146
|
when Integer
|
147
147
|
# TODO(Darkpi): What should we do to negative number?
|
148
148
|
raise ArgumentError, 's must be non-negative' unless s >= 0
|
@@ -264,7 +264,7 @@ module Pwnlib
|
|
264
264
|
# @example
|
265
265
|
# b64d('ZGVzdQ==') #=> 'desu'
|
266
266
|
def b64d(s)
|
267
|
-
s.
|
267
|
+
s.unpack1('m0')
|
268
268
|
end
|
269
269
|
|
270
270
|
# Xor two strings.
|
data/lib/pwnlib/util/getdents.rb
CHANGED
@@ -24,6 +24,7 @@ module Pwnlib
|
|
24
24
|
# The +linux_dirent+ structure.
|
25
25
|
class Dirent < ::BinData::Record
|
26
26
|
attr_accessor :bits
|
27
|
+
|
27
28
|
# struct linux_dirent {
|
28
29
|
# unsigned long d_ino; /* Inode number */
|
29
30
|
# unsigned long d_off; /* Offset to next linux_dirent */
|
@@ -72,8 +73,8 @@ module Pwnlib
|
|
72
73
|
ent = Dirent.new(endian: context.endian.to_sym)
|
73
74
|
ent.bits = context.bits
|
74
75
|
ent.read(str)
|
75
|
-
#
|
76
|
-
result.puts(DT_TYPE_INVERSE[ent.d_type]
|
76
|
+
# NOTE: d_name might contains garbage after first "\x00", so we use gsub(/\x00.*/) instead of delete("\x00").
|
77
|
+
result.puts("#{DT_TYPE_INVERSE[ent.d_type]} #{ent.d_name.gsub(/\x00.*/, '')}")
|
77
78
|
end
|
78
79
|
result.string
|
79
80
|
end
|
data/lib/pwnlib/util/packing.rb
CHANGED
data/lib/pwnlib/version.rb
CHANGED
data/test/asm_test.rb
CHANGED
@@ -25,7 +25,7 @@ class AsmTest < MiniTest::Test
|
|
25
25
|
# => { arch: 'a', endian: 'big' }
|
26
26
|
metadata = lines.shift.slice(11..-1)
|
27
27
|
.split(',').map { |c| c.split(':', 2).map(&:strip) }
|
28
|
-
.
|
28
|
+
.to_h.transform_keys(&:to_sym)
|
29
29
|
end
|
30
30
|
comment, output = lines.partition { |l| l =~ /^\s*[;#]/ }.map(&:join)
|
31
31
|
next if output.empty?
|
@@ -45,7 +45,7 @@ class AsmTest < MiniTest::Test
|
|
45
45
|
|
46
46
|
# All tests of asm can be found under test/data/assembly/<arch>.s.
|
47
47
|
%w[aarch64 amd64 arm i386 mips mips64 powerpc powerpc64 sparc sparc64 thumb].each do |arch|
|
48
|
-
file = File.join(__dir__, 'data', 'assembly', arch
|
48
|
+
file = File.join(__dir__, 'data', 'assembly', "#{arch}.s")
|
49
49
|
# Defining methods dynamically makes proper error message shown when tests failed.
|
50
50
|
__send__(:define_method, "test_asm_#{arch}") do
|
51
51
|
skip_windows
|
@@ -73,7 +73,7 @@ class AsmTest < MiniTest::Test
|
|
73
73
|
|
74
74
|
# All tests of disasm can be found under test/data/assembly/<arch>.s.
|
75
75
|
%w[aarch64 amd64 arm i386 mips mips64 powerpc64 sparc sparc64 thumb].each do |arch|
|
76
|
-
file = File.join(__dir__, 'data', 'assembly', arch
|
76
|
+
file = File.join(__dir__, 'data', 'assembly', "#{arch}.s")
|
77
77
|
# Defining methods dynamically makes proper error message shown when tests failed.
|
78
78
|
__send__(:define_method, "test_disasm_#{arch}") do
|
79
79
|
skip_windows
|
data/test/data/echo.rb
CHANGED
@@ -5,12 +5,12 @@ require 'socket'
|
|
5
5
|
|
6
6
|
server = TCPServer.open('127.0.0.1', 0)
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
$stdout.puts "Start with port #{server.addr[1]}"
|
9
|
+
$stdout.flush
|
10
10
|
|
11
11
|
client = server.accept
|
12
12
|
s = client.gets
|
13
13
|
client.puts(s)
|
14
14
|
client.close
|
15
15
|
|
16
|
-
|
16
|
+
$stdout.puts 'Bye!'
|
data/test/files/use_pwn.rb
CHANGED
@@ -9,8 +9,8 @@ require 'pwn'
|
|
9
9
|
context[arch: 'amd64']
|
10
10
|
|
11
11
|
raise 'pack fail' unless pack(1) == "\x01\0\0\0\0\0\0\0"
|
12
|
-
raise 'not unique context' unless ::Pwnlib::Util::Fiddling.__send__(:context).
|
13
|
-
raise 'not unique context' unless ::Pwnlib::Context.context.
|
12
|
+
raise 'not unique context' unless ::Pwnlib::Util::Fiddling.__send__(:context).equal?(context)
|
13
|
+
raise 'not unique context' unless ::Pwnlib::Context.context.equal?(context)
|
14
14
|
|
15
15
|
# Make sure things aren't polluting Object
|
16
16
|
begin
|
data/test/logger_test.rb
CHANGED
@@ -75,10 +75,10 @@ class LoggerTest < MiniTest::Test
|
|
75
75
|
msg = @logger.dump(
|
76
76
|
libc # comment is ok
|
77
77
|
.to_s(16),
|
78
|
-
libc - libc
|
78
|
+
libc - libc * 1
|
79
79
|
)
|
80
80
|
assert_equal(<<-EOS, msg)
|
81
|
-
[DUMP] libc.to_s(16) = "7fc0bdd13000", (libc - libc) = 0
|
81
|
+
[DUMP] libc.to_s(16) = "7fc0bdd13000", (libc - (libc * 1)) = 0
|
82
82
|
EOS
|
83
83
|
|
84
84
|
libc = 0x7fc0bdd13000
|
data/test/tubes/process_test.rb
CHANGED
@@ -45,7 +45,7 @@ class ProcessTest < MiniTest::Test
|
|
45
45
|
def test_eof
|
46
46
|
ls = ::Pwnlib::Tubes::Process.new(['ls', '-la'])
|
47
47
|
assert_match(/total/, ls.gets)
|
48
|
-
assert_raises(::Pwnlib::Errors::EndOfTubeError) { ls.write('anything') }
|
48
|
+
assert_raises(::Pwnlib::Errors::EndOfTubeError) { loop { ls.write('anything') } }
|
49
49
|
assert_raises(::Pwnlib::Errors::EndOfTubeError) { loop { ls.gets } }
|
50
50
|
end
|
51
51
|
|
data/test/tubes/sock_test.rb
CHANGED
data/test/util/fiddling_test.rb
CHANGED
@@ -40,11 +40,11 @@ class FiddlingTest < MiniTest::Test
|
|
40
40
|
assert_equal('test A', urldecode('te%73t%20%41'))
|
41
41
|
assert_equal("\x00\xff\x01\xfe", urldecode('%00%ff%01%fe'))
|
42
42
|
|
43
|
-
assert_equal('%qq', urldecode('%qq', true))
|
43
|
+
assert_equal('%qq', urldecode('%qq', ignore_invalid: true))
|
44
44
|
err = assert_raises(ArgumentError) { urldecode('%qq') }
|
45
45
|
assert_match(/Invalid input to urldecode/, err.message)
|
46
46
|
|
47
|
-
assert_equal('%%1z2%orz%%%%%#$!#)@%', urldecode('%%1z2%orz%%%%%#$!#)@%', true))
|
47
|
+
assert_equal('%%1z2%orz%%%%%#$!#)@%', urldecode('%%1z2%orz%%%%%#$!#)@%', ignore_invalid: true))
|
48
48
|
err = assert_raises(ArgumentError) { urldecode('%ff%') }
|
49
49
|
assert_match(/Invalid input to urldecode/, err.message)
|
50
50
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pwntools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- peter50216@gmail.com
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2021-03-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: crabstone
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
version: 2.0.11
|
36
36
|
- - "<"
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version: 3.
|
38
|
+
version: 3.5.0
|
39
39
|
type: :runtime
|
40
40
|
prerelease: false
|
41
41
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -45,7 +45,7 @@ dependencies:
|
|
45
45
|
version: 2.0.11
|
46
46
|
- - "<"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 3.
|
48
|
+
version: 3.5.0
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: elftools
|
51
51
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,14 +84,14 @@ dependencies:
|
|
84
84
|
name: method_source
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0.9'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0.9'
|
97
97
|
- !ruby/object:Gem::Dependency
|
@@ -210,14 +210,14 @@ dependencies:
|
|
210
210
|
requirements:
|
211
211
|
- - "~>"
|
212
212
|
- !ruby/object:Gem::Version
|
213
|
-
version: '
|
213
|
+
version: '1'
|
214
214
|
type: :development
|
215
215
|
prerelease: false
|
216
216
|
version_requirements: !ruby/object:Gem::Requirement
|
217
217
|
requirements:
|
218
218
|
- - "~>"
|
219
219
|
- !ruby/object:Gem::Version
|
220
|
-
version: '
|
220
|
+
version: '1'
|
221
221
|
- !ruby/object:Gem::Dependency
|
222
222
|
name: simplecov
|
223
223
|
requirement: !ruby/object:Gem::Requirement
|
@@ -225,6 +225,9 @@ dependencies:
|
|
225
225
|
- - "~>"
|
226
226
|
- !ruby/object:Gem::Version
|
227
227
|
version: '0.15'
|
228
|
+
- - "<"
|
229
|
+
- !ruby/object:Gem::Version
|
230
|
+
version: '0.18'
|
228
231
|
type: :development
|
229
232
|
prerelease: false
|
230
233
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -232,6 +235,9 @@ dependencies:
|
|
232
235
|
- - "~>"
|
233
236
|
- !ruby/object:Gem::Version
|
234
237
|
version: '0.15'
|
238
|
+
- - "<"
|
239
|
+
- !ruby/object:Gem::Version
|
240
|
+
version: '0.18'
|
235
241
|
- !ruby/object:Gem::Dependency
|
236
242
|
name: tty-platform
|
237
243
|
requirement: !ruby/object:Gem::Requirement
|
@@ -461,85 +467,85 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
461
467
|
- !ruby/object:Gem::Version
|
462
468
|
version: '0'
|
463
469
|
requirements: []
|
464
|
-
rubygems_version: 3.
|
470
|
+
rubygems_version: 3.1.4
|
465
471
|
signing_key:
|
466
472
|
specification_version: 4
|
467
473
|
summary: pwntools
|
468
474
|
test_files:
|
469
|
-
- test/
|
470
|
-
- test/tubes/sock_test.rb
|
471
|
-
- test/tubes/tube_test.rb
|
472
|
-
- test/tubes/serialtube_test.rb
|
473
|
-
- test/tubes/process_test.rb
|
474
|
-
- test/tubes/buffer_test.rb
|
475
|
-
- test/files/use_pwnlib.rb
|
476
|
-
- test/files/use_pwn.rb
|
477
|
-
- test/timer_test.rb
|
478
|
-
- test/data/elfs/amd64.frelro.elf
|
479
|
-
- test/data/elfs/source.cpp
|
480
|
-
- test/data/elfs/amd64.frelro.pie.elf
|
481
|
-
- test/data/elfs/i386.prelro.elf
|
482
|
-
- test/data/elfs/Makefile
|
483
|
-
- test/data/elfs/amd64.static.elf
|
484
|
-
- test/data/elfs/amd64.nrelro.elf
|
485
|
-
- test/data/elfs/i386.frelro.pie.elf
|
486
|
-
- test/data/elfs/amd64.prelro.elf
|
487
|
-
- test/data/flag
|
488
|
-
- test/data/lib32/ld.so.2
|
489
|
-
- test/data/lib32/libc.so.6
|
490
|
-
- test/data/echo.rb
|
491
|
-
- test/data/victim64
|
492
|
-
- test/data/lib64/ld.so.2
|
493
|
-
- test/data/lib64/libc.so.6
|
494
|
-
- test/data/assembly/powerpc64.s
|
495
|
-
- test/data/assembly/arm.s
|
496
|
-
- test/data/assembly/thumb.s
|
497
|
-
- test/data/assembly/i386.s
|
498
|
-
- test/data/assembly/amd64.s
|
499
|
-
- test/data/assembly/mips.s
|
500
|
-
- test/data/assembly/powerpc.s
|
501
|
-
- test/data/assembly/sparc.s
|
502
|
-
- test/data/assembly/mips64.s
|
503
|
-
- test/data/assembly/aarch64.s
|
504
|
-
- test/data/assembly/sparc64.s
|
505
|
-
- test/data/victim.c
|
506
|
-
- test/data/victim32
|
507
|
-
- test/runner_test.rb
|
508
|
-
- test/dynelf_test.rb
|
475
|
+
- test/util/cyclic_test.rb
|
509
476
|
- test/util/getdents_test.rb
|
510
|
-
- test/util/packing_test.rb
|
511
|
-
- test/util/fiddling_test.rb
|
512
477
|
- test/util/hexdump_test.rb
|
513
478
|
- test/util/lists_test.rb
|
514
|
-
- test/util/
|
515
|
-
- test/
|
479
|
+
- test/util/fiddling_test.rb
|
480
|
+
- test/util/packing_test.rb
|
516
481
|
- test/abi_test.rb
|
517
|
-
- test/logger_test.rb
|
518
|
-
- test/memleak_test.rb
|
519
482
|
- test/elf/elf_test.rb
|
520
|
-
- test/ui_test.rb
|
521
483
|
- test/context_test.rb
|
484
|
+
- test/runner_test.rb
|
485
|
+
- test/reg_sort_test.rb
|
486
|
+
- test/test_helper.rb
|
487
|
+
- test/shellcraft/popad_test.rb
|
522
488
|
- test/shellcraft/mov_test.rb
|
523
|
-
- test/shellcraft/setregs_test.rb
|
524
489
|
- test/shellcraft/registers_test.rb
|
525
|
-
- test/shellcraft/
|
526
|
-
- test/shellcraft/
|
490
|
+
- test/shellcraft/nop_test.rb
|
491
|
+
- test/shellcraft/shellcraft_test.rb
|
492
|
+
- test/shellcraft/ret_test.rb
|
493
|
+
- test/shellcraft/memcpy_test.rb
|
494
|
+
- test/shellcraft/linux/sleep_test.rb
|
495
|
+
- test/shellcraft/linux/cat_test.rb
|
527
496
|
- test/shellcraft/linux/syscalls/syscall_test.rb
|
528
497
|
- test/shellcraft/linux/syscalls/execve_test.rb
|
529
498
|
- test/shellcraft/linux/syscalls/open_test.rb
|
530
499
|
- test/shellcraft/linux/syscalls/exit_test.rb
|
531
|
-
- test/shellcraft/linux/sleep_test.rb
|
532
|
-
- test/shellcraft/linux/cat_test.rb
|
533
500
|
- test/shellcraft/linux/sh_test.rb
|
501
|
+
- test/shellcraft/linux/ls_test.rb
|
534
502
|
- test/shellcraft/pushstr_test.rb
|
535
|
-
- test/shellcraft/
|
536
|
-
- test/shellcraft/pushstr_array_test.rb
|
537
|
-
- test/shellcraft/nop_test.rb
|
538
|
-
- test/shellcraft/ret_test.rb
|
539
|
-
- test/shellcraft/memcpy_test.rb
|
503
|
+
- test/shellcraft/setregs_test.rb
|
540
504
|
- test/shellcraft/infloop_test.rb
|
505
|
+
- test/shellcraft/pushstr_array_test.rb
|
506
|
+
- test/data/lib64/ld.so.2
|
507
|
+
- test/data/lib64/libc.so.6
|
508
|
+
- test/data/flag
|
509
|
+
- test/data/victim32
|
510
|
+
- test/data/lib32/ld.so.2
|
511
|
+
- test/data/lib32/libc.so.6
|
512
|
+
- test/data/elfs/amd64.frelro.elf
|
513
|
+
- test/data/elfs/i386.frelro.pie.elf
|
514
|
+
- test/data/elfs/amd64.prelro.elf
|
515
|
+
- test/data/elfs/source.cpp
|
516
|
+
- test/data/elfs/amd64.frelro.pie.elf
|
517
|
+
- test/data/elfs/amd64.static.elf
|
518
|
+
- test/data/elfs/i386.prelro.elf
|
519
|
+
- test/data/elfs/amd64.nrelro.elf
|
520
|
+
- test/data/elfs/Makefile
|
521
|
+
- test/data/echo.rb
|
522
|
+
- test/data/victim64
|
523
|
+
- test/data/victim.c
|
524
|
+
- test/data/assembly/amd64.s
|
525
|
+
- test/data/assembly/sparc64.s
|
526
|
+
- test/data/assembly/i386.s
|
527
|
+
- test/data/assembly/mips.s
|
528
|
+
- test/data/assembly/mips64.s
|
529
|
+
- test/data/assembly/powerpc64.s
|
530
|
+
- test/data/assembly/arm.s
|
531
|
+
- test/data/assembly/sparc.s
|
532
|
+
- test/data/assembly/powerpc.s
|
533
|
+
- test/data/assembly/aarch64.s
|
534
|
+
- test/data/assembly/thumb.s
|
535
|
+
- test/asm_test.rb
|
541
536
|
- test/constants/constants_test.rb
|
542
537
|
- test/constants/constant_test.rb
|
543
|
-
- test/
|
544
|
-
- test/
|
545
|
-
- test/
|
538
|
+
- test/ui_test.rb
|
539
|
+
- test/memleak_test.rb
|
540
|
+
- test/tubes/process_test.rb
|
541
|
+
- test/tubes/sock_test.rb
|
542
|
+
- test/tubes/buffer_test.rb
|
543
|
+
- test/tubes/tube_test.rb
|
544
|
+
- test/tubes/serialtube_test.rb
|
545
|
+
- test/full_file_test.rb
|
546
|
+
- test/logger_test.rb
|
547
|
+
- test/dynelf_test.rb
|
548
|
+
- test/timer_test.rb
|
549
|
+
- test/files/use_pwnlib.rb
|
550
|
+
- test/files/use_pwn.rb
|
551
|
+
- test/ext_test.rb
|