rex-text 0.2.40 → 0.2.41

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6aa8880ab44795dde36fab9173dcfbbe2f2ad0afecb1574dad0620d57f3b7d70
4
- data.tar.gz: 404c7abc28c4cde12fe46a1de4a3ceff55b96faf1734d3d913690977e4895f5a
3
+ metadata.gz: 99760857150edd0c9d0c3147b6529fa51244895878cf8aabb265cc17054931ed
4
+ data.tar.gz: 0bf2431de8fbdd5618a65925972e09e768f1e5b3c960a63cd4764d4bbc1252e5
5
5
  SHA512:
6
- metadata.gz: d3719c96add95b2694c20572562674e1ba5de06ecab52d43e2e7921b71d790acaf197d416326674c3ae276d9fcffb0cc3dc601ea74be6bd2b3cf67d111df7125
7
- data.tar.gz: 4c114558bae64642e567c73a43ca8462cae5df391a469b9017ef18672238dbf04097ace28b6bad24758836f078a6a99f8d098cc43a330f131487fe5281ad8f93
6
+ metadata.gz: 10dc8566dc93c40022a13b03cb0f2e4ebde49e1bba0a7133d7048512635be71a084e54c4e68e39a7b3b36f44da57a81db6896c9cd739b314b49133cce4d9bcb3
7
+ data.tar.gz: 92daf4cf40ba727164f354be16b7193b0c84dc2bf87f89f4dd59ea2d6ac1172ac58993ad12dc30216a9e490d24f1c8aaad7083d75f01033f461fe0628cd0c6c8
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/rex/text/lang.rb CHANGED
@@ -38,6 +38,28 @@ module Rex
38
38
  ret << " };\n"
39
39
  end
40
40
 
41
+ #
42
+ # Converts to a golang style array of bytes
43
+ #
44
+ def self.to_golang(str, wrap = DefaultWrap, name = "buf")
45
+ ret = "#{name} := []byte{"
46
+ i = -1;
47
+ while (i += 1) < str.length
48
+ ret << "\n" if i%(wrap/4) == 0
49
+ ret << "0x" << str[i].unpack("H*")[0] << ", "
50
+ end
51
+ ret = ret[0..ret.length-3] #cut off last comma
52
+ ret << " }\n"
53
+
54
+ end
55
+
56
+ #
57
+ # Creates a golang style comment
58
+ #
59
+ def self.to_golang_comment(str, wrap = DefaultWrap)
60
+ return "/*\n" + wordwrap(str, 0, wrap, '', '') + "*/\n"
61
+ end
62
+
41
63
  #
42
64
  # Creates a c-style comment
43
65
  #
@@ -1,5 +1,5 @@
1
1
  module Rex
2
2
  module Text
3
- VERSION = "0.2.40"
3
+ VERSION = "0.2.41"
4
4
  end
5
5
  end
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.40
4
+ version: 0.2.41
5
5
  platform: ruby
6
6
  authors:
7
7
  - Metasploit Hackers
metadata.gz.sig CHANGED
Binary file