ronin-support 1.0.0.beta1 → 1.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +2 -0
- data/README.md +4 -4
- data/gemspec.yml +2 -2
- data/lib/ronin/support/binary/core_ext/string.rb +47 -0
- data/lib/ronin/support/core_ext.rb +1 -0
- data/lib/ronin/support/text/patterns/source_code.rb +1 -1
- data/lib/ronin/support/text/patterns.rb +1 -0
- data/lib/ronin/support/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d96039ef4f773da9342b3d259bf962d9f55a905e14059d63b8ff6d083e48a48
|
4
|
+
data.tar.gz: c5bf732c0dfa506ccf45f212e041c5341d7b01c95b2cdd9ea7bb0c8ac096d84e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 025746e89756222d9feb09d87a02bf76ccf82df466a5e605e63ae01676cb3f0feec9084f9b32b1f5ec7dc85f7310863bc739f07b6d86e3b3efe16f05d67cd653
|
7
|
+
data.tar.gz: 2cba1d2ec2e473136650a41cbc5e6703c326278f206144df0afa7a3316bf445b26948e95c22261f725d8efcd01142895b229ce9e835afa52549eaea119abe1e5
|
data/ChangeLog.md
CHANGED
@@ -359,9 +359,11 @@
|
|
359
359
|
{Ronin::Support::Network} module.
|
360
360
|
* Removed `Net` core-exts.
|
361
361
|
* Removed `Ronin::Support::Binary::Template.translate`.
|
362
|
+
* Removed `Ronin::Templates` in favor of {Ronin::Support::Text::ERB}.
|
362
363
|
* Removed `ssl_server` and `ssl_server_session` in favor of
|
363
364
|
{Ronin::Support::Network::SSL::Mixin#ssl_server_socket ssl_server_socket}.
|
364
365
|
* Removed `String#depack` in favor of overriding {String#unpack}.
|
366
|
+
* Also override {String#unpack1} to match the functionality of {String#unpack}.
|
365
367
|
|
366
368
|
[wordlist]: https://github.com/postmodern/wordlist.rb#readme
|
367
369
|
[ronin-core]: https://github.com/ronin-rb/ronin-core#readme
|
data/README.md
CHANGED
@@ -91,6 +91,7 @@ It's like [pwntools] combined with [activesupport].
|
|
91
91
|
* Generating typos.
|
92
92
|
* Generating homoglyphs.
|
93
93
|
* Regexs for matching/extracting common types of data.
|
94
|
+
* Small memory footprint (~46Kb).
|
94
95
|
* Has 95% documentation coverage.
|
95
96
|
* Has 93% test coverage.
|
96
97
|
|
@@ -118,7 +119,7 @@ puts data.base64_decode
|
|
118
119
|
```
|
119
120
|
|
120
121
|
For more examples of the convenience methods provided by ronin-support,
|
121
|
-
please see [
|
122
|
+
please see the [API documentation](https://ronin-rb.dev/docs/ronin-support).
|
122
123
|
|
123
124
|
## Requirements
|
124
125
|
|
@@ -170,11 +171,10 @@ You should have received a copy of the GNU Lesser General Public License
|
|
170
171
|
along with ronin-support. If not, see <https://www.gnu.org/licenses/>.
|
171
172
|
|
172
173
|
[ronin-rb]: https://ronin-rb.dev
|
173
|
-
[Everyday Ronin]: https://ronin-rb.dev/guides/everyday_ronin.html
|
174
174
|
[Ruby]: https://www.ruby-lang.org/
|
175
175
|
|
176
|
-
[pwntools]: https://github.com/Gallopsled/pwntools
|
177
|
-
[activesupport]: https://
|
176
|
+
[pwntools]: https://github.com/Gallopsled/pwntools#readme
|
177
|
+
[activesupport]: https://guides.rubyonrails.org/active_support_core_extensions.html
|
178
178
|
|
179
179
|
[chars]: https://github.com/postmodern/chars#readme
|
180
180
|
[hexdump]: https://github.com/postmodern/hexdump#readme
|
data/gemspec.yml
CHANGED
@@ -17,10 +17,10 @@ homepage: https://ronin-rb.dev
|
|
17
17
|
has_yard: true
|
18
18
|
|
19
19
|
metadata:
|
20
|
-
documentation_uri: https://ronin-rb.dev/docs/ronin-support
|
20
|
+
documentation_uri: https://ronin-rb.dev/docs/ronin-support
|
21
21
|
source_code_uri: https://github.com/ronin-rb/ronin-support
|
22
22
|
bug_tracker_uri: https://github.com/ronin-rb/ronin-support/issues
|
23
|
-
changelog_uri: https://github.com/ronin-rb/ronin-support/blob/
|
23
|
+
changelog_uri: https://github.com/ronin-rb/ronin-support/blob/main/ChangeLog.md
|
24
24
|
rubygems_mfa_required: 'true'
|
25
25
|
|
26
26
|
required_ruby_version: ">= 3.0.0"
|
@@ -18,6 +18,7 @@
|
|
18
18
|
|
19
19
|
require 'ronin/support/binary/core_ext/integer'
|
20
20
|
require 'ronin/support/binary/template'
|
21
|
+
require 'ronin/support/binary/ctypes'
|
21
22
|
require 'ronin/support/binary/bit_flip'
|
22
23
|
|
23
24
|
class String
|
@@ -74,6 +75,52 @@ class String
|
|
74
75
|
end
|
75
76
|
end
|
76
77
|
|
78
|
+
alias unpack1_original unpack1
|
79
|
+
|
80
|
+
#
|
81
|
+
# Unpacks a single value from the String.
|
82
|
+
#
|
83
|
+
# @param [String, Symbol] argument
|
84
|
+
# The `String#unpack` format String (ex: `L<`) or a
|
85
|
+
# {Ronin::Support::Binary::CTypes} type name (ex: `:uint32_le`).
|
86
|
+
#
|
87
|
+
# @param [Hash{Symbol => Object}] kwargs
|
88
|
+
# Additional keyword arguments for
|
89
|
+
# {Ronin::Support::Binary::Template#initialize}.
|
90
|
+
#
|
91
|
+
# @option kwargs [:little, :big, :net, nil] :endian
|
92
|
+
# The desired endianness of the packed data.
|
93
|
+
#
|
94
|
+
# @option kwargs [:x86, :x86_64, :ppc, :ppc64,
|
95
|
+
# :arm, :arm_be, :arm64, :arm64_be,
|
96
|
+
# :mips, :mips_le, :mips64, :mips64_le, nil] :arch
|
97
|
+
# The desired architecture that the data was packed for.
|
98
|
+
#
|
99
|
+
# @return [Integer, Float, String]
|
100
|
+
# The unpacked value.
|
101
|
+
#
|
102
|
+
# @raise [ArgumentError]
|
103
|
+
# The given argument was not a String or a Symbol, or the given C type is
|
104
|
+
# unknown.
|
105
|
+
#
|
106
|
+
# @since 1.0.0
|
107
|
+
#
|
108
|
+
# @api public
|
109
|
+
#
|
110
|
+
def unpack1(argument,**kwargs)
|
111
|
+
case argument
|
112
|
+
when String
|
113
|
+
unpack1_original(argument)
|
114
|
+
when Symbol
|
115
|
+
platform = Ronin::Support::Binary::CTypes.platform(**kwargs)
|
116
|
+
type = platform[argument]
|
117
|
+
|
118
|
+
unpack1_original(type.pack_string)
|
119
|
+
else
|
120
|
+
raise(ArgumentError,"argument must be either a String or a Symbol: #{argument.inspect}")
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
77
124
|
#
|
78
125
|
# Enumerates over every bit flip of every byte in the string.
|
79
126
|
#
|
@@ -22,6 +22,7 @@ require 'ronin/support/core_ext/integer'
|
|
22
22
|
require 'ronin/support/core_ext/ipaddr'
|
23
23
|
require 'ronin/support/core_ext/resolv'
|
24
24
|
require 'ronin/support/core_ext/kernel'
|
25
|
+
require 'ronin/support/binary/core_ext'
|
25
26
|
require 'ronin/support/compression/core_ext'
|
26
27
|
require 'ronin/support/archive/core_ext'
|
27
28
|
require 'ronin/support/crypto/core_ext'
|
@@ -20,6 +20,7 @@ require 'ronin/support/text/patterns/language'
|
|
20
20
|
require 'ronin/support/text/patterns/numeric'
|
21
21
|
require 'ronin/support/text/patterns/credentials'
|
22
22
|
require 'ronin/support/text/patterns/crypto'
|
23
|
+
require 'ronin/support/text/patterns/file_system'
|
23
24
|
require 'ronin/support/text/patterns/network'
|
24
25
|
require 'ronin/support/text/patterns/pii'
|
25
26
|
require 'ronin/support/text/patterns/source_code'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ronin-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chars
|
@@ -446,10 +446,10 @@ homepage: https://ronin-rb.dev
|
|
446
446
|
licenses:
|
447
447
|
- LGPL-3.0
|
448
448
|
metadata:
|
449
|
-
documentation_uri: https://ronin-rb.dev/docs/ronin-support
|
449
|
+
documentation_uri: https://ronin-rb.dev/docs/ronin-support
|
450
450
|
source_code_uri: https://github.com/ronin-rb/ronin-support
|
451
451
|
bug_tracker_uri: https://github.com/ronin-rb/ronin-support/issues
|
452
|
-
changelog_uri: https://github.com/ronin-rb/ronin-support/blob/
|
452
|
+
changelog_uri: https://github.com/ronin-rb/ronin-support/blob/main/ChangeLog.md
|
453
453
|
rubygems_mfa_required: 'true'
|
454
454
|
post_install_message:
|
455
455
|
rdoc_options: []
|