crytic / ethersplay

EVM dissassembler
GNU Affero General Public License v3.0
834 stars 116 forks source link

TypeError: argument of type 'NoneType' is not iterable #34

Closed gaasedelen closed 6 years ago

gaasedelen commented 6 years ago

From etherscan:

https://etherscan.io/address/0xe2c122847767effbb3f306724cded7e93a9dd9b9 https://etherscan.io/address/0x3ab4a46beae2a0b025eeed54db05819814ff287a

EVM/Ethersplay form: pocs.zip

Both these contracts will yield the following callstacks:

Traceback (most recent call last):
  File "C:\tools\disassemblers\BinaryNinja\plugins\..\python\binaryninja\binaryview.py", line 234, in _function_updated
    self.notify.function_updated(self.view, function.Function(self.view, core.BNNewFunctionReference(func)))
  File "C:\Users\user\AppData\Roaming\Binary Ninja\plugins\ethersplay\analysis.py", line 234, in function_updated
    function_dynamic_jump_start(view, func)
  File "C:\Users\user\AppData\Roaming\Binary Ninja\plugins\ethersplay\stack_value_analysis.py", line 821, in function_dynamic_jump_start
    sv.explore()
  File "C:\Users\user\AppData\Roaming\Binary Ninja\plugins\ethersplay\stack_value_analysis.py", line 805, in explore
    elems = [filter_vals(x.get_vals()) for x in elems]
  File "C:\Users\user\AppData\Roaming\Binary Ninja\plugins\ethersplay\stack_value_analysis.py", line 798, in filter_vals
    if None in vals:
TypeError: argument of type 'NoneType' is not iterable
gaasedelen commented 6 years ago

It's worth noting this callstack also seems to manifest in the contract given in issue #33, but that testscase experiences failures (StopIteration) before any of these callstacks are produced.

joshwatson commented 6 years ago

This was a pretty easy fix, I think. It's currently in the fix-34 branch, which I'll merge in a little bit.

bonedaddy commented 6 years ago

@joshwatson any update on the merge? :D

joshwatson commented 6 years ago

I was waiting for a fix for #33 but it turns out that one is probably going to be nontrivial and it’s kinda fallen behind in current priorities, so I’ll make a PR for that branch tomorrow morning and get it merged. Sorry for the delay!