Browse Source

avoid inserting a float into instruction generation randomly

Brent Cook 1 year ago
parent
commit
53b369d702
1 changed files with 8 additions and 4 deletions
  1. 8
    4
      modules/nops/sparc/random.rb

+ 8
- 4
modules/nops/sparc/random.rb View File

@@ -196,11 +196,15 @@ class MetasploitModule < Msf::Nop
196 196
     return '' if len == 0
197 197
     len = 0x3fffff if (len >= 0x400000)
198 198
 
199
+    a = rand(2).floor
200
+    b = ref[0]
201
+    c = rand(len - 1).floor
202
+
199 203
     return [
200
-      (rand(2) << 29) |
201
-      (ref[0] << 25)  |
202
-      (2 << 22)       |
203
-      rand(len - 1) + 1
204
+      (a << 29)  |
205
+      (b << 25)  |
206
+      (2 << 22)  |
207
+      c + 1
204 208
     ].pack('N')
205 209
   end
206 210
 end

Loading…
Cancel
Save