Commit b7b3249b authored by yann300's avatar yann300

decodeFromMemory DynamicByteArray

parent 185f2ff3
......@@ -39,17 +39,21 @@ DynamicByteArray.prototype.decodeLocals = function (stackHeight, stack, memory)
if (stack.length - 1 < stackHeight) {
return {
value: '0x',
length: '0x'
length: '0x0'
}
} else {
var offset = stack[stack.length - 1 - stackHeight]
offset = 2 * parseInt(offset, 16)
var length = memory.substr(offset, 64)
length = parseInt(length, 16)
return {
length: 2 * length,
value: '0x' + memory.substr(offset + 64, 2 * length)
}
return this.decodeFromMemory(offset, memory)
}
}
DynamicByteArray.prototype.decodeFromMemory = function (offset, memory) {
var length = memory.substr(offset, 64)
length = 2 * parseInt(length, 16)
return {
length: '0x' + length.toString(16),
value: '0x' + memory.substr(offset + 64, length)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment