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

bit-vector size must be greater than zero #4

Open
gsalzer opened this issue Dec 8, 2021 · 0 comments
Open

bit-vector size must be greater than zero #4

gsalzer opened this issue Dec 8, 2021 · 0 comments

Comments

@gsalzer
Copy link

gsalzer commented Dec 8, 2021

$ cat demo.hex 
341561000a57600080fd5b600436101561001857610ecc565b600035601c5274012a05f1fffffffffffffffffffffffffdabf41c006080527ffffffffffffffffffffffffed5fa0e000000000000000000000000000000000060a0526000156100ce575b6101805261014052610160526101405161016051808202821582848304141761008b57600080fd5b80905090509050604e600454106100a157600080fd5b600454600a0a80806100b257600080fd5b8204905090506101a0526101a051600052600051610180515650005b639006e50460005114156101995760043560a01c156100ec57600080fd5b60243560a01c156100fc57600080fd5b60443560a01c1561010c57600080fd5b60643560a01c1561011c57600080fd5b60843560a01c1561012c57600080fd5b60a43560a01c1561013c57600080fd5b60c43560a01c1561014c57600080fd5b60e43560a01c1561015c57600080fd5b600435600255602435600755604435600855606435600955608435600a5560a435600b5560c435600c5560e435600d55600160005260206000f350005b634ef04f5060005114156101ba57600435600e55600160005260206000f350005b63f8fe1ffd60005114156101dc5760043560055560055460005260206000f350005b6373d5ba8e60005114156103835760206101e0604463095ea7b361014052600754610160527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101805261015c60006003545af161023957600080fd5b601f3d1161024657600080fd5b6000506101e05060206101e0604463095ea7b361014052600754610160527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101805261015c6000600b545af161029c57600080fd5b601f3d116102a957600080fd5b6000506101e05060206101e0604463095ea7b361014052600754610160527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101805261015c6000600c545af16102ff57600080fd5b601f3d1161030c57600080fd5b6000506101e05060206101e0604463095ea7b361014052600754610160527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101805261015c6000600d545af161036257600080fd5b601f3d1161036f57600080fd5b6000506101e050600160005260206000f350005b63be2d0686600051141561052a5760206101e0604463095ea7b361014052600154610160527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101805261015c60006003545af16103e057600080fd5b601f3d116103ed57600080fd5b6000506101e05060206101e0604463095ea7b361014052600154610160527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101805261015c6000600b545af161044357600080fd5b601f3d1161045057600080fd5b6000506101e05060206101e0604463095ea7b361014052600154610160527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101805261015c6000600c545af16104a657600080fd5b601f3d116104b357600080fd5b6000506101e05060206101e0604463095ea7b361014052600154610160527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6101805261015c6000600d545af161050957600080fd5b601f3d1161051657600080fd5b6000506101e050600160005260206000f350005b63d6d21dfd60005114156105495733600f55600160005260206000f350005b63ab3ae4a060005114156108535760206101e060246370a08231610160526002546101805261017c6003545afa61057f57600080fd5b601f3d1161058c57600080fd5b6000506101e0516101405260206101e060046318160ddd6101805261019c6003545afa6105b857600080fd5b601f3d116105c557600080fd5b6000506101e05161016052610140516101605161018051610160516101a0526005546101c0526101c0516101a05160065801610063565b6102205261018052610160526101405261022051610180526101805161014051101515610845576101405161016051610180516101a051610140516101c052600654605f808202821582848304141761065457600080fd5b809050905090506101e0526101e0516101c05160065801610063565b610240526101a052610180526101605261014052610240516101a05260206102a0606463bd5f68b06101e0526101a0516102005260035461022052600b54610240526101fc6007545afa6106c357600080fd5b601f3d116106d057600080fd5b6000506102a0516101c0526101405161016051610180516101a0516101c0516101e0516101c05161020052600654600e54808202821582848304141761071557600080fd5b8090509050905061022052610220516102005160065801610063565b610280526101e0526101c0526101a052610180526101605261014052610280516101e0526101c0516101e0518082101561076a57600080fd5b808203905090506102005260206102c0604463095ea7b361022052600754610240526101a0516102605261023c60006003545af16107a757600080fd5b601f3d116107b457600080fd5b6000506102c050602061034060c463ff502bb5610220526101a05161024052610200516102605260035461028052600b546102a0526002546102c05242610e1081818301101561080357600080fd5b808201905090506102e05261023c60006007545af161082157600080fd5b601f3d1161082e57600080fd5b60005061034050600160005260206000f350610851565b600060005260206000f3505b005b6359ef67a460005114156109035760443560a01c1561087157600080fd5b60643560a01c1561088157600080fd5b60843560a01c1561089157600080fd5b602061026060c463ff502bb5610140526004356101605260243561018052604480356101a05280602001356101c052506084356101e05260a4356102005261015c60006007545af16108e257600080fd5b601f3d116108ef57600080fd5b60005061026050600160005260206000f350005b6330cee7aa6000511415610c5e5760206101e060246370a08231610160526002546101805261017c6003545afa61093957600080fd5b601f3d1161094657600080fd5b6000506101e05161014052602061020060246370a08231610180526002546101a05261019c600b545afa61097957600080fd5b601f3d1161098657600080fd5b6000506102005161016052602061022060246370a082316101a0526009546101c0526101bc600b545afa6109b957600080fd5b601f3d116109c657600080fd5b6000506102205161018052602061024060246370a082316101c0526009546101e0526101dc600c545afa6109f957600080fd5b601f3d11610a0657600080fd5b600050610240516101a052610180516101a0518080610a2457600080fd5b820490509050604e60045410610a3957600080fd5b600454600a0a8082028215828483041417610a5357600080fd5b809050905090506101c052610140516101c0518082028215828483041417610a7a57600080fd5b80905090509050670de0b6b3a7640000808204905090506101e052610140516101405161016051610180516101a0516101c0516101e051610200516101405161022052600654600e548082028215828483041417610ad757600080fd5b8090509050905061024052610240516102205160065801610063565b6102a052610200526101e0526101c0526101a0526101805261016052610140526102a05180821015610b2457600080fd5b80820390509050610200526101e0516101405161016051610180516101a0516101c0516101e05161020051610220516101e05161024052600654600e548082028215828483041417610b7557600080fd5b8090509050905061026052610260516102405160065801610063565b6102c05261022052610200526101e0526101c0526101a0526101805261016052610140526102c05180821015610bc657600080fd5b808203905090506102205260206103a061010463e8e337006102405260035461026052600b5461028052610140516102a0526101e0516102c052610200516102e05261022051610300526002546103205242610e10818183011015610c2a57600080fd5b808201905090506103405261025c60006007545af1610c4857600080fd5b601f3d11610c5557600080fd5b6000506103a050005b630c55699c6000511415610c7e576001543314610c7a57600080fd5b33ff005b638052474d6000511415610d275760008060c052602060c020610180602082540161012060006003818352015b82610120516020021115610cbe57610ce0565b61012051850154610120516020028501525b8151600101808352811415610cab575b50505050505061018051806101a001818260206001820306601f82010390500336823750506020610160526040610180510160206001820306601f8201039050610160f350005b63967c33b36000511415610d435760015460005260206000f350005b63e21a6b556000511415610d5f5760025460005260206000f350005b6317819f476000511415610d7b5760035460005260206000f350005b6333f761786000511415610d975760045460005260206000f350005b630445b6676000511415610db35760055460005260206000f350005b6382f568416000511415610dcf5760065460005260206000f350005b63a0e47bf66000511415610deb5760075460005260206000f350005b63e1d177406000511415610e075760085460005260206000f350005b6372985bb36000511415610e235760095460005260206000f350005b63cd73c7376000511415610e3f57600a5460005260206000f350005b63142d2c626000511415610e5b57600b5460005260206000f350005b63f15a21576000511415610e7757600c5460005260206000f350005b6375cd14ad6000511415610e9357600d5460005260206000f350005b633e032a3b6000511415610eaf57600e5460005260206000f350005b63e7004c896000511415610ecb57600f5460005260206000f350005b5b60006000fd
$ python conkas.py demo.hex 
Analysing demo.hex...
b'bit-vector size must be greater than zero'
Traceback (most recent call last):
  File "conkas.py", line 108, in main
    traces = sym_exec.execute()
  File "/data-hdd/ethereum/tools/conkas/sym_exec/symbolic_executor.py", line 51, in execute
    new_traces = self.__sym_exec_traces(traces_to_execute)
  File "/data-hdd/ethereum/tools/conkas/sym_exec/symbolic_executor.py", line 64, in __sym_exec_traces
    new_blocks = self.__sym_exec_block(block_to_analyse, trace.state)
  File "/data-hdd/ethereum/tools/conkas/sym_exec/symbolic_executor.py", line 93, in __sym_exec_block
    new_blocks = self.__sym_exec_instruction(instruction, state)
  File "/data-hdd/ethereum/tools/conkas/sym_exec/symbolic_executor.py", line 116, in __sym_exec_instruction
    return func(instruction, state)
  File "/data-hdd/ethereum/tools/conkas/sym_exec/instructions/contract_context.py", line 135, in inst_calldatacopy
    bv = BitVec(str(hash(instruction)), length * 8)
  File "/data-hdd/ethereum/tools/conkas/venv/lib/python3.8/site-packages/z3/z3.py", line 3813, in BitVec
    bv = BitVecSort(bv, ctx)
  File "/data-hdd/ethereum/tools/conkas/venv/lib/python3.8/site-packages/z3/z3.py", line 3775, in BitVecSort
    return BitVecSortRef(Z3_mk_bv_sort(ctx.ref(), sz), ctx)
  File "/data-hdd/ethereum/tools/conkas/venv/lib/python3.8/site-packages/z3/z3core.py", line 1558, in Z3_mk_bv_sort
    _elems.Check(a0)
  File "/data-hdd/ethereum/tools/conkas/venv/lib/python3.8/site-packages/z3/z3core.py", line 1385, in Check
    raise self.Exception(self.get_error_message(ctx, err))
z3.z3types.Z3Exception: b'bit-vector size must be greater than zero'
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