rex-text 0.2.44 → 0.2.45
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 +2 -2
- data/lib/rex/text/lang.rb +25 -0
- data/lib/rex/text/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -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: 35b8656aec1d2bd88d707649036693d4421362967f7602e1d18de3aae6e3ea57
|
4
|
+
data.tar.gz: 974fe908dd1312fe9a0ccdaa3844b9a537e83e6f001afe5ae28dc153350e5261
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c3599bb12273e92655678f398595257fc357e0875e8c52ef109e16cb8861c226da817a901a3d884437e0ce2c051796005e297f5c2e33127e48c288e8d72f253
|
7
|
+
data.tar.gz: 1cab334469f0ed24807b4d651c87b2c677ab9a9b46616822f3715326e8917bfd0716f157e92b6ae4169c9b98b5dfc89b57bab928834c7c34ebbe7f3495284073
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
�
|
1
|
+
T�3�vM��r�)��T�C������S���?�f��B-�/�5���13�� ,���oܚ���<[���9BaM��ϐ n�5E�B@�H�o6EH�m���1[V�_*+������Z��q�"�M��Y
|
2
|
+
'=�j��"����#�C��C�6�Ԙ��3B~ߔ�4�I�T�K�{�,� �q�`��{یO���%N�8_��ԎJ��֯G>�����ာ�kU J�����ϱW�S�vP��|�R��[�_�%N
|
data/lib/rex/text/lang.rb
CHANGED
@@ -61,6 +61,31 @@ module Rex
|
|
61
61
|
return "/*\n" + wordwrap(str, 0, wrap, '', '') + "*/\n"
|
62
62
|
end
|
63
63
|
|
64
|
+
#
|
65
|
+
# Converts to a nim style array of bytes
|
66
|
+
#
|
67
|
+
def self.to_nim(str, wrap = DefaultWrap, name = "buf")
|
68
|
+
raise ArgumentError.new('str can not be empty') if str.empty?
|
69
|
+
|
70
|
+
ret = "var #{name}: array[#{str.length}, byte] = [\n"
|
71
|
+
ret << "byte "
|
72
|
+
str.each_char do |char|
|
73
|
+
# "0x##,".length is 5, check if we're going over the wrap boundary
|
74
|
+
ret << "\n" if ret.split("\n").last.length + 5 > wrap
|
75
|
+
ret << "0x" << char.unpack('H*')[0] << ","
|
76
|
+
end
|
77
|
+
ret = ret[0..ret.length - 2] unless str.empty? # cut off last comma
|
78
|
+
ret << "\n" if ret.split("\n").last.length + 1 > wrap
|
79
|
+
ret << "]\n"
|
80
|
+
end
|
81
|
+
|
82
|
+
#
|
83
|
+
# Creates a nim style comment
|
84
|
+
#
|
85
|
+
def self.to_nim_comment(str, wrap = DefaultWrap)
|
86
|
+
return "#[\n" + wordwrap(str, 0, wrap, '', '') + "]#\n"
|
87
|
+
end
|
88
|
+
|
64
89
|
#
|
65
90
|
# Creates a c-style comment
|
66
91
|
#
|
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.45
|
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: 2022-09-
|
96
|
+
date: 2022-09-06 00:00:00.000000000 Z
|
97
97
|
dependencies:
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
99
|
name: rake
|
metadata.gz.sig
CHANGED
Binary file
|