Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question about the process of "CALLDATASIZE " #34

Open
smartcontract-detect-yzu opened this issue Sep 15, 2020 · 0 comments
Open

question about the process of "CALLDATASIZE " #34

smartcontract-detect-yzu opened this issue Sep 15, 2020 · 0 comments

Comments

@smartcontract-detect-yzu

i have one question that why have to check fixed calldatasize length “branch_array_size = [0,8,8+132,8+232]” alone.
the code is at:

MAIAN/tool/execute_block.py

Lines 334 to 346 in ab387e1

# or Branch on 4 different FIXED sizes
branch_array_size = [0,8,8+1*32,8+2*32]
for one_branch_size in branch_array_size:
storage2 = copy.deepcopy(storage)
stack2 = copy.deepcopy(stack)
trace2 = copy.deepcopy(trace)
mmemory2 = copy.deepcopy(mmemory)
data2 = copy.deepcopy(data)
stack2.append( {'type':'constant','step':ops[pos]['id'], 'z3': BitVecVal(one_branch_size,256)} )
execute_one_block(ops,stack2, pos+1, trace2, storage2, mmemory2, data2, configurations, search_op, search_function, jumpdepth, calldepth, debug, read_from_blockchain )

before that have already treat the calldatasize as symbolic variables, this is still cannot cover these fixed size?
the code is at

MAIAN/tool/execute_block.py

Lines 328 to 331 in ab387e1

if -1 not in data2:
data2['inputlength-'+str(calldepth)] = BitVec('inputlength-'+str(calldepth), 256)
stack2.append( {'type':'constant','step':ops[pos]['id'], 'z3': data2['inputlength-'+str(calldepth)]} )
execute_one_block(ops,stack2, pos+1, trace2, storage2, mmemory2, data2, configurations, search_op, search_function, jumpdepth, calldepth, debug, read_from_blockchain )

i wondering why these fixed size of calldatasize must be check again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant