rex-text 0.2.51 → 0.2.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/.github/workflows/verify.yml +1 -0
- data/cortex.yaml +15 -0
- data/lib/rex/text/binary_manipulation.rb +3 -3
- data/lib/rex/text/hex.rb +2 -2
- data/lib/rex/text/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efae2fa81f093a806df7145a220feb0b11f80a5acd1755af469979aff86716b4
|
4
|
+
data.tar.gz: f2e81b0bf92a3888194a300a2a1e90a7e1a70827d38dfead1f37b028eba85658
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 732e06aaffa214fb9b0f07799127528d9d5afd54417a721489005537ce376382c68340bafe9bada065679962f55454c3141ef2ffffe874ec613977af775b4332
|
7
|
+
data.tar.gz: 7de51e0c5eb64b136f654a605d31b78f1fbc5ccfa715d8fc102bf172dd658cd94983799a0200bba7048a67a871373f0eb1a5665c2bb8bf5f73ca1b1290eb1f40
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/cortex.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
info:
|
3
|
+
title: Rex Text
|
4
|
+
description: Rex library for text generation and manipulation
|
5
|
+
x-cortex-git:
|
6
|
+
github:
|
7
|
+
alias: r7org
|
8
|
+
repository: rapid7/rex-text
|
9
|
+
x-cortex-tag: rex-text
|
10
|
+
x-cortex-type: service
|
11
|
+
x-cortex-domain-parents:
|
12
|
+
- tag: metasploit
|
13
|
+
openapi: 3.0.1
|
14
|
+
servers:
|
15
|
+
- url: "/"
|
@@ -28,15 +28,15 @@ module Rex
|
|
28
28
|
# Creates a comma separated list of dwords
|
29
29
|
#
|
30
30
|
def self.to_dword(str, wrap = DefaultWrap)
|
31
|
-
code = str
|
31
|
+
code = str.dup.force_encoding('ASCII-8BIT')
|
32
32
|
alignnr = str.length % 4
|
33
33
|
if (alignnr > 0)
|
34
34
|
code << "\x00" * (4 - alignnr)
|
35
35
|
end
|
36
36
|
codevalues = Array.new
|
37
|
-
code.
|
37
|
+
code.chars.each_slice(4) do |chars4|
|
38
38
|
chars4 = chars4.join("")
|
39
|
-
dwordvalue = chars4.unpack('
|
39
|
+
dwordvalue = chars4.unpack('V')
|
40
40
|
codevalues.push(dwordvalue[0])
|
41
41
|
end
|
42
42
|
buff = ""
|
data/lib/rex/text/hex.rb
CHANGED
@@ -22,7 +22,7 @@ module Rex
|
|
22
22
|
# the regex the first time it is used and never check again. Since we
|
23
23
|
# want to know how many to capture on every instance, we do it this
|
24
24
|
# way.
|
25
|
-
return str.unpack('H*')[0].gsub(Regexp.new(".{#{count * 2}}",
|
25
|
+
return str.unpack('H*')[0].gsub(Regexp.new(".{#{count * 2}}", Regexp::NOENCODING)) { |s| prefix + s }
|
26
26
|
end
|
27
27
|
|
28
28
|
#
|
@@ -40,7 +40,7 @@ module Rex
|
|
40
40
|
# their escaped hex representation
|
41
41
|
def self.to_hex_ascii(str, prefix = "\\x", count = 1, suffix=nil)
|
42
42
|
raise ::RuntimeError, "unable to chunk into #{count} byte chunks" if ((str.length % count) > 0)
|
43
|
-
return str.unpack('H*')[0].gsub(Regexp.new(".{#{count * 2}}",
|
43
|
+
return str.unpack('H*')[0].gsub(Regexp.new(".{#{count * 2}}", Regexp::NOENCODING)) { |s|
|
44
44
|
(0x20..0x7e) === s.to_i(16) ? s.to_i(16).chr : prefix + s + suffix.to_s
|
45
45
|
}
|
46
46
|
end
|
data/lib/rex/text/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rex-text
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.53
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Metasploit Hackers
|
@@ -93,7 +93,7 @@ cert_chain:
|
|
93
93
|
EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
|
94
94
|
9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
|
95
95
|
-----END CERTIFICATE-----
|
96
|
-
date: 2023-
|
96
|
+
date: 2023-10-04 00:00:00.000000000 Z
|
97
97
|
dependencies:
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: rake
|
@@ -141,6 +141,7 @@ files:
|
|
141
141
|
- LICENSE
|
142
142
|
- README.md
|
143
143
|
- Rakefile
|
144
|
+
- cortex.yaml
|
144
145
|
- lib/rex/codepage.map
|
145
146
|
- lib/rex/text.rb
|
146
147
|
- lib/rex/text/badchars.rb
|
metadata.gz.sig
CHANGED
Binary file
|