|
|
@ -61,17 +61,21 @@ DynamicByteArray.prototype.decodeLocals = function (stackHeight, stack, memory) |
|
|
|
if (stack.length - 1 < stackHeight) { |
|
|
|
if (stack.length - 1 < stackHeight) { |
|
|
|
return { |
|
|
|
return { |
|
|
|
value: '0x', |
|
|
|
value: '0x', |
|
|
|
length: '0x' |
|
|
|
length: '0x0' |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
var offset = stack[stack.length - 1 - stackHeight] |
|
|
|
var offset = stack[stack.length - 1 - stackHeight] |
|
|
|
offset = 2 * parseInt(offset, 16) |
|
|
|
offset = 2 * parseInt(offset, 16) |
|
|
|
var length = memory.substr(offset, 64) |
|
|
|
return this.decodeFromMemory(offset, memory) |
|
|
|
length = parseInt(length, 16) |
|
|
|
} |
|
|
|
return { |
|
|
|
} |
|
|
|
length: 2 * length, |
|
|
|
|
|
|
|
value: '0x' + memory.substr(offset + 64, 2 * length) |
|
|
|
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) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|