rex-text 0.2.52 → 0.2.54
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/cortex.yaml +15 -0
- data/lib/rex/text/hex.rb +3 -3
- data/lib/rex/text/lang.rb +12 -13
- data/lib/rex/text/version.rb +1 -1
- data.tar.gz.sig +2 -4
- 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: c05ee609d7b945466cea4997460b0309d45768ab3d1baa1b7fedaf24fb4e94a0
|
4
|
+
data.tar.gz: 9c43e502375129ec13d9f11695ac1fa6409e1aa28abe33289008b46c1d4bd8cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 061327edbe4d52cd8a374539b8e9bde0cc01c156c95235ab48f528f25c3f806726b194d679e81a52e230bbbd77ceb70ed33f9227356c85fea1c05251a4c3c584
|
7
|
+
data.tar.gz: 7a2d1a026f030fa69403dd167378da42cf51629b5b942de03899d3f0dda52ede8f55e5d258fcfc4dd42180dc1d1089fc86c32f3d79265d269a294959eb4b237d
|
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: "/"
|
data/lib/rex/text/hex.rb
CHANGED
@@ -171,8 +171,8 @@ module Rex
|
|
171
171
|
#
|
172
172
|
# General-case method to handle both "\xAA\xBB\xCC" format and 0xAA,0xBB,0xCC format
|
173
173
|
#
|
174
|
-
def self.hexify_general(str, char_prefix, col = DefaultWrap, line_start = '', line_end = '', buf_start = '', buf_end = '', between='')
|
175
|
-
encoded_char_length = 2 + char_prefix.length + between.length
|
174
|
+
def self.hexify_general(str, char_prefix, col = DefaultWrap, line_start = '', line_end = '', buf_start = '', buf_end = '', between='', char_suffix: '')
|
175
|
+
encoded_char_length = 2 + char_prefix.length + char_suffix.length + between.length
|
176
176
|
if col < line_start.length + encoded_char_length + line_end.length
|
177
177
|
# raise an exception
|
178
178
|
raise ArgumentError.new('insufficient column width')
|
@@ -188,7 +188,7 @@ module Rex
|
|
188
188
|
ret << "#{line_end}\n#{line_start}"
|
189
189
|
last_line_length = line_start.length
|
190
190
|
end
|
191
|
-
ret << char_prefix << char.unpack('H*')[0] << between
|
191
|
+
ret << char_prefix << char.unpack('H*')[0] << char_suffix << between
|
192
192
|
last_line_length += encoded_char_length
|
193
193
|
end
|
194
194
|
# Remove the last in-between characters, if required
|
data/lib/rex/text/lang.rb
CHANGED
@@ -48,17 +48,17 @@ module Rex
|
|
48
48
|
#
|
49
49
|
# Converts to a masm style array of bytes
|
50
50
|
#
|
51
|
-
def self.to_masm(str, wrap = DefaultWrap, name = "")
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
return
|
51
|
+
def self.to_masm(str, wrap = DefaultWrap, name = "buf")
|
52
|
+
result = hexify_general(str, "", wrap, "#{' ' * (name.length + 1)}DB ", '', "#{name} DB ", '', ',', char_suffix: 'h')
|
53
|
+
result.gsub!(",\n", "\n")
|
54
|
+
result
|
55
|
+
end
|
56
|
+
|
57
|
+
#
|
58
|
+
# Creates a masm style comment
|
59
|
+
#
|
60
|
+
def self.to_masm_comment(str, wrap = DefaultWrap)
|
61
|
+
return wordwrap(str, 0, wrap, '', '; ')
|
62
62
|
end
|
63
63
|
|
64
64
|
#
|
@@ -72,7 +72,6 @@ module Rex
|
|
72
72
|
# Converts to a nim style array of bytes
|
73
73
|
#
|
74
74
|
def self.to_nim(str, wrap = DefaultWrap, name = "buf")
|
75
|
-
raise ArgumentError.new('str can not be empty') if str.empty?
|
76
75
|
return numhexify(str, wrap, '', '', "var #{name}: array[#{str.length}, byte] = [\nbyte ", "]", ',')
|
77
76
|
end
|
78
77
|
|
@@ -89,7 +88,7 @@ module Rex
|
|
89
88
|
def self.to_rust(str, wrap = DefaultWrap, name = "buf")
|
90
89
|
return numhexify(str, wrap, '', '', "let #{name}: [u8; #{str.length}] = [", "];", ',')
|
91
90
|
end
|
92
|
-
|
91
|
+
|
93
92
|
#
|
94
93
|
# Creates a Rust style comment
|
95
94
|
#
|
data/lib/rex/text/version.rb
CHANGED
data.tar.gz.sig
CHANGED
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.54
|
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-19 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
|