mirror of
https://github.com/frida/frida-python
synced 2026-06-08 14:16:17 +00:00
Fix the byte array sniffing to avoid false positives
This commit is contained in:
+8
-4
@@ -358,11 +358,15 @@ WARNING: Unable to find package 'gnureadline' needed for tab completion;
|
||||
}
|
||||
|
||||
function isByteArray(v) {
|
||||
if (!v || !v.hasOwnProperty('length'))
|
||||
if (!v || typeof v !== 'object' || typeof v.length !== 'number' || v.length < 1)
|
||||
return false;
|
||||
return Array.prototype.every.call(v, function (e) {
|
||||
return typeof e === 'number';
|
||||
});
|
||||
if (v instanceof Array) // Object returned by Memory.readByteArray() isn't an Array
|
||||
return false;
|
||||
for (var i = 0; i !== v.length; i++) {
|
||||
if (typeof v[i] !== 'number')
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
const onStanza = function (stanza) {
|
||||
|
||||
Reference in New Issue
Block a user