{"action":"created","comment":{"url":"https://api.github.com/repos/trailofbits/manticore/pulls/comments/192190992","pull_request_review_id":124919072,"id":192190992,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjE5MDk5Mg==","diff_hunk":"@@ -356,24 +356,26 @@ def __build_source_map(self, bytecode, srcmap):\n         f = int(md.get(2, 0))\n         j = md.get(3, None)\n \n+        pos_to_offset = {}\n         for i in evm.EVMAsm.disassemble_all(bytecode):\n-            if asm_pos in srcmap and len(srcmap[asm_pos]):\n-                md = srcmap[asm_pos]\n-                if len(md):\n-                    d = {}\n-                    for p, k in enumerate(md.split(':')):\n-                        if len(k):\n-                            d[p] = k\n-\n-                    s = int(d.get(0, s))\n-                    l = int(d.get(1, l))\n-                    f = int(d.get(2, f))\n-                    j = d.get(3, j)\n-\n-            new_srcmap[asm_offset] = (s, l, f, j)\n+            pos_to_offset[asm_pos] = asm_offset\n             asm_pos += 1\n             asm_offset += i.size\n \n+        for asm_pos, md in enumerate(srcmap):\n+            if len(md):\n+                d = {}\n+                for p, k in enumerate(md.split(':')):\n+                    if len(k):\n+                        d[p] = k\n+\n+                s = int(d.get(0, s))\n+                l = int(d.get(1, l))\n+                f = int(d.get(2, f))\n+                j = d.get(3, j)","path":"manticore/ethereum.py","position":287,"original_position":52,"commit_id":"8aefa9423c70d1ae5a3f1b8e0ab9fd88e05cec03","original_commit_id":"8aefa9423c70d1ae5a3f1b8e0ab9fd88e05cec03","user":{"login":"disconnect3d","id":10009354,"node_id":"MDQ6VXNlcjEwMDA5MzU0","avatar_url":"https://avatars2.githubusercontent.com/u/10009354?v=4","gravatar_id":"","url":"https://api.github.com/users/disconnect3d","html_url":"https://github.com/disconnect3d","followers_url":"https://api.github.com/users/disconnect3d/followers","following_url":"https://api.github.com/users/disconnect3d/following{/other_user}","gists_url":"https://api.github.com/users/disconnect3d/gists{/gist_id}","starred_url":"https://api.github.com/users/disconnect3d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/disconnect3d/subscriptions","organizations_url":"https://api.github.com/users/disconnect3d/orgs","repos_url":"https://api.github.com/users/disconnect3d/repos","events_url":"https://api.github.com/users/disconnect3d/events{/privacy}","received_events_url":"https://api.github.com/users/disconnect3d/received_events","type":"User","site_admin":false},"body":"can we rename those to sth more explicit? ;/","created_at":"2018-05-31T18:16:52Z","updated_at":"2018-05-31T18:16:52Z","html_url":"https://github.com/trailofbits/manticore/pull/910#discussion_r192190992","pull_request_url":"https://api.github.com/repos/trailofbits/manticore/pulls/910","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/comments/192190992"},"html":{"href":"https://github.com/trailofbits/manticore/pull/910#discussion_r192190992"},"pull_request":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/910"}}},"pull_request":{"url":"https://api.github.com/repos/trailofbits/manticore/pulls/910","id":191601875,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxNjAxODc1","html_url":"https://github.com/trailofbits/manticore/pull/910","diff_url":"https://github.com/trailofbits/manticore/pull/910.diff","patch_url":"https://github.com/trailofbits/manticore/pull/910.patch","issue_url":"https://api.github.com/repos/trailofbits/manticore/issues/910","number":910,"state":"open","locked":false,"title":"Dev evm INVALID detector","user":{"login":"feliam","id":1017522,"node_id":"MDQ6VXNlcjEwMTc1MjI=","avatar_url":"https://avatars1.githubusercontent.com/u/1017522?v=4","gravatar_id":"","url":"https://api.github.com/users/feliam","html_url":"https://github.com/feliam","followers_url":"https://api.github.com/users/feliam/followers","following_url":"https://api.github.com/users/feliam/following{/other_user}","gists_url":"https://api.github.com/users/feliam/gists{/gist_id}","starred_url":"https://api.github.com/users/feliam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feliam/subscriptions","organizations_url":"https://api.github.com/users/feliam/orgs","repos_url":"https://api.github.com/users/feliam/repos","events_url":"https://api.github.com/users/feliam/events{/privacy}","received_events_url":"https://api.github.com/users/feliam/received_events","type":"User","site_admin":false},"body":"* Some Detector improvements and rearrangements.\r\n* Command line arguments for enabling detectors\r\n```\r\n  --detect-io           Enable integer overflow detection (Ethereum only)\r\n  --detect-invalid      Enable INVALID instruction detection (Ethereum only)\r\n  --detect-uninitialized-memory\r\n                        Enable detection of uninitialized memory usage\r\n                        (Ethereum only)\r\n  --detect-uninitialized-storage\r\n                        Enable detection of uninitialized storage usage\r\n                        (Ethereum only)\r\n  --detect-all          Enable all detector heuristics (Ethereum only)\r\n\r\n```\r\n\r\n* A simple Detector to report on INVALID instruction even in internal tx.\r\n* Fix reporting so each state has a local Detector report. If a detector found something on a specific state it will now print this out to the test_000000.summary file. (Note there is global list of findings at global.summary too)\r\n\r\n```\r\n$evm-analyzer-benchmark-suite/benchmarks $ python -m manticore --detect-invalid assert_minimal.sol \r\n2018-05-30 19:16:54,188: [6022] m.main:INFO: Beginning analysis\r\n2018-05-30 19:16:54,335: [6022] m.ethereum:INFO: Starting symbolic transaction: 1\r\n2018-05-30 19:16:54,922: [6022] m.ethereum:WARNING: INVALID intruction\r\n2018-05-30 19:16:55,258: [6022] m.ethereum:INFO: Finished symbolic transaction: 1 | Code Coverage: 89% | Terminated States: 4 | Alive States: 0\r\n2018-05-30 19:16:55,499: [6093] m.ethereum:INFO: Generated testcase No. 0 - RETURN\r\n2018-05-30 19:16:56,437: [6093] m.ethereum:INFO: Generated testcase No. 1 - THROW\r\n2018-05-30 19:16:57,805: [6093] m.ethereum:INFO: Generated testcase No. 2 - REVERT\r\n2018-05-30 19:16:59,324: [6093] m.ethereum:INFO: Generated testcase No. 3 - REVERT\r\n2018-05-30 19:17:01,046: [6022] m.ethereum:INFO: Results in benchmarks/mcore_0D03sE\r\n$evm-analyzer-benchmark-suite/benchmarks $ cat benchmarks/mcore_0D03sE/test_00000001.summary \r\nMessage: \r\nLast exception: THROW\r\n\r\nFindings:\r\nINVALID intruction\r\n\tContract: 0x67518339e369ab3d591d3569ab0a0d83b2ff5198\r\n\tEVM Program counter: 95\r\n\tSnippet:\r\n\t\t    6  contract Benchmark {\r\n\t\t    7      function run() public {\r\n\t\t    8          assert(false);\r\n\t\t    9      }\r\n\t\t    10  }\r\n\t\t\r\n\r\nLast instruction at contract 67518339e369ab3d591d3569ab0a0d83b2ff5198 offset 5e\r\n    6  contract Benchmark {\r\n    7      function run() public {\r\n    8          assert(false);\r\n    9      }\r\n    10  }\r\n\r\n3 accounts.\r\nAddress: 0x67518339e369ab3d591d3569ab0a0d83b2ff5198 \r\nBalance: 0 (*)\r\nStorage: STORAGE_6\r\nCode:\r\n\t606060405260043610603f576000357c01000000000000000000000000000000\r\n\t00000000000000000000000000900463ffffffff168063c0406226146044575b\r\n\t600080fd5b3415604e57600080fd5b60546056565b005b60001515605f57fe5b\r\n\t5600a165627a7a72305820a8651cc94cc6f988dee33272d6726010fd92092087\r\n\tda0e3a7a39847850ef7dac0029\r\nCoverage 75% (on this state)\r\n\r\nAddress: 0xd30a286ec6737b8b2a6a7b5fbb5d75b895f62956 \r\nBalance: 1000 \r\nStorage: STORAGE_3\r\n\r\nAddress: 0x1bfa530d5d685155e98cd7d9dd23f7b6a801cfef \r\nBalance: 1000 (*)\r\nStorage: STORAGE_4\r\n\r\n\r\n\r\n(*) Example solution given. Value is symbolic and may take other values\r\n```\r\n\r\n\r\n\r\n<!-- Reviewable:start -->\r\n---\r\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/trailofbits/manticore/910)\r\n<!-- Reviewable:end -->\r\n","created_at":"2018-05-30T22:50:56Z","updated_at":"2018-05-31T18:16:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d60c5606626c46ea02ad9b09a569b3354cca3836","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/trailofbits/manticore/pulls/910/commits","review_comments_url":"https://api.github.com/repos/trailofbits/manticore/pulls/910/comments","review_comment_url":"https://api.github.com/repos/trailofbits/manticore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trailofbits/manticore/issues/910/comments","statuses_url":"https://api.github.com/repos/trailofbits/manticore/statuses/8aefa9423c70d1ae5a3f1b8e0ab9fd88e05cec03","head":{"label":"trailofbits:dev-evm-detect-invalid","ref":"dev-evm-detect-invalid","sha":"8aefa9423c70d1ae5a3f1b8e0ab9fd88e05cec03","user":{"login":"trailofbits","id":2314423,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTQ0MjM=","avatar_url":"https://avatars0.githubusercontent.com/u/2314423?v=4","gravatar_id":"","url":"https://api.github.com/users/trailofbits","html_url":"https://github.com/trailofbits","followers_url":"https://api.github.com/users/trailofbits/followers","following_url":"https://api.github.com/users/trailofbits/following{/other_user}","gists_url":"https://api.github.com/users/trailofbits/gists{/gist_id}","starred_url":"https://api.github.com/users/trailofbits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trailofbits/subscriptions","organizations_url":"https://api.github.com/users/trailofbits/orgs","repos_url":"https://api.github.com/users/trailofbits/repos","events_url":"https://api.github.com/users/trailofbits/events{/privacy}","received_events_url":"https://api.github.com/users/trailofbits/received_events","type":"Organization","site_admin":false},"repo":{"id":81612762,"node_id":"MDEwOlJlcG9zaXRvcnk4MTYxMjc2Mg==","name":"manticore","full_name":"trailofbits/manticore","owner":{"login":"trailofbits","id":2314423,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTQ0MjM=","avatar_url":"https://avatars0.githubusercontent.com/u/2314423?v=4","gravatar_id":"","url":"https://api.github.com/users/trailofbits","html_url":"https://github.com/trailofbits","followers_url":"https://api.github.com/users/trailofbits/followers","following_url":"https://api.github.com/users/trailofbits/following{/other_user}","gists_url":"https://api.github.com/users/trailofbits/gists{/gist_id}","starred_url":"https://api.github.com/users/trailofbits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trailofbits/subscriptions","organizations_url":"https://api.github.com/users/trailofbits/orgs","repos_url":"https://api.github.com/users/trailofbits/repos","events_url":"https://api.github.com/users/trailofbits/events{/privacy}","received_events_url":"https://api.github.com/users/trailofbits/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trailofbits/manticore","description":"Symbolic execution tool","fork":false,"url":"https://api.github.com/repos/trailofbits/manticore","forks_url":"https://api.github.com/repos/trailofbits/manticore/forks","keys_url":"https://api.github.com/repos/trailofbits/manticore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trailofbits/manticore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trailofbits/manticore/teams","hooks_url":"https://api.github.com/repos/trailofbits/manticore/hooks","issue_events_url":"https://api.github.com/repos/trailofbits/manticore/issues/events{/number}","events_url":"https://api.github.com/repos/trailofbits/manticore/events","assignees_url":"https://api.github.com/repos/trailofbits/manticore/assignees{/user}","branches_url":"https://api.github.com/repos/trailofbits/manticore/branches{/branch}","tags_url":"https://api.github.com/repos/trailofbits/manticore/tags","blobs_url":"https://api.github.com/repos/trailofbits/manticore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trailofbits/manticore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trailofbits/manticore/git/refs{/sha}","trees_url":"https://api.github.com/repos/trailofbits/manticore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trailofbits/manticore/statuses/{sha}","languages_url":"https://api.github.com/repos/trailofbits/manticore/languages","stargazers_url":"https://api.github.com/repos/trailofbits/manticore/stargazers","contributors_url":"https://api.github.com/repos/trailofbits/manticore/contributors","subscribers_url":"https://api.github.com/repos/trailofbits/manticore/subscribers","subscription_url":"https://api.github.com/repos/trailofbits/manticore/subscription","commits_url":"https://api.github.com/repos/trailofbits/manticore/commits{/sha}","git_commits_url":"https://api.github.com/repos/trailofbits/manticore/git/commits{/sha}","comments_url":"https://api.github.com/repos/trailofbits/manticore/comments{/number}","issue_comment_url":"https://api.github.com/repos/trailofbits/manticore/issues/comments{/number}","contents_url":"https://api.github.com/repos/trailofbits/manticore/contents/{+path}","compare_url":"https://api.github.com/repos/trailofbits/manticore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trailofbits/manticore/merges","archive_url":"https://api.github.com/repos/trailofbits/manticore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trailofbits/manticore/downloads","issues_url":"https://api.github.com/repos/trailofbits/manticore/issues{/number}","pulls_url":"https://api.github.com/repos/trailofbits/manticore/pulls{/number}","milestones_url":"https://api.github.com/repos/trailofbits/manticore/milestones{/number}","notifications_url":"https://api.github.com/repos/trailofbits/manticore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trailofbits/manticore/labels{/name}","releases_url":"https://api.github.com/repos/trailofbits/manticore/releases{/id}","deployments_url":"https://api.github.com/repos/trailofbits/manticore/deployments","created_at":"2017-02-10T22:28:34Z","updated_at":"2018-05-31T16:40:46Z","pushed_at":"2018-05-31T18:10:01Z","git_url":"git://github.com/trailofbits/manticore.git","ssh_url":"git@github.com:trailofbits/manticore.git","clone_url":"https://github.com/trailofbits/manticore.git","svn_url":"https://github.com/trailofbits/manticore","homepage":"https://blog.trailofbits.com/2017/04/27/manticore-symbolic-execution-for-humans/","size":15508,"stargazers_count":1121,"watchers_count":1121,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":157,"mirror_url":null,"archived":false,"open_issues_count":169,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":157,"open_issues":169,"watchers":1121,"default_branch":"master"}},"base":{"label":"trailofbits:master","ref":"master","sha":"058943763b6aa44ee834538b60593667cf4f1070","user":{"login":"trailofbits","id":2314423,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTQ0MjM=","avatar_url":"https://avatars0.githubusercontent.com/u/2314423?v=4","gravatar_id":"","url":"https://api.github.com/users/trailofbits","html_url":"https://github.com/trailofbits","followers_url":"https://api.github.com/users/trailofbits/followers","following_url":"https://api.github.com/users/trailofbits/following{/other_user}","gists_url":"https://api.github.com/users/trailofbits/gists{/gist_id}","starred_url":"https://api.github.com/users/trailofbits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trailofbits/subscriptions","organizations_url":"https://api.github.com/users/trailofbits/orgs","repos_url":"https://api.github.com/users/trailofbits/repos","events_url":"https://api.github.com/users/trailofbits/events{/privacy}","received_events_url":"https://api.github.com/users/trailofbits/received_events","type":"Organization","site_admin":false},"repo":{"id":81612762,"node_id":"MDEwOlJlcG9zaXRvcnk4MTYxMjc2Mg==","name":"manticore","full_name":"trailofbits/manticore","owner":{"login":"trailofbits","id":2314423,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIzMTQ0MjM=","avatar_url":"https://avatars0.githubusercontent.com/u/2314423?v=4","gravatar_id":"","url":"https://api.github.com/users/trailofbits","html_url":"https://github.com/trailofbits","followers_url":"https://api.github.com/users/trailofbits/followers","following_url":"https://api.github.com/users/trailofbits/following{/other_user}","gists_url":"https://api.github.com/users/trailofbits/gists{/gist_id}","starred_url":"https://api.github.com/users/trailofbits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trailofbits/subscriptions","organizations_url":"https://api.github.com/users/trailofbits/orgs","repos_url":"https://api.github.com/users/trailofbits/repos","events_url":"https://api.github.com/users/trailofbits/events{/privacy}","received_events_url":"https://api.github.com/users/trailofbits/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trailofbits/manticore","description":"Symbolic execution tool","fork":false,"url":"https://api.github.com/repos/trailofbits/manticore","forks_url":"https://api.github.com/repos/trailofbits/manticore/forks","keys_url":"https://api.github.com/repos/trailofbits/manticore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trailofbits/manticore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trailofbits/manticore/teams","hooks_url":"https://api.github.com/repos/trailofbits/manticore/hooks","issue_events_url":"https://api.github.com/repos/trailofbits/manticore/issues/events{/number}","events_url":"https://api.github.com/repos/trailofbits/manticore/events","assignees_url":"https://api.github.com/repos/trailofbits/manticore/assignees{/user}","branches_url":"https://api.github.com/repos/trailofbits/manticore/branches{/branch}","tags_url":"https://api.github.com/repos/trailofbits/manticore/tags","blobs_url":"https://api.github.com/repos/trailofbits/manticore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trailofbits/manticore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trailofbits/manticore/git/refs{/sha}","trees_url":"https://api.github.com/repos/trailofbits/manticore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trailofbits/manticore/statuses/{sha}","languages_url":"https://api.github.com/repos/trailofbits/manticore/languages","stargazers_url":"https://api.github.com/repos/trailofbits/manticore/stargazers","contributors_url":"https://api.github.com/repos/trailofbits/manticore/contributors","subscribers_url":"https://api.github.com/repos/trailofbits/manticore/subscribers","subscription_url":"https://api.github.com/repos/trailofbits/manticore/subscription","commits_url":"https://api.github.com/repos/trailofbits/manticore/commits{/sha}","git_commits_url":"https://api.github.com/repos/trailofbits/manticore/git/commits{/sha}","comments_url":"https://api.github.com/repos/trailofbits/manticore/comments{/number}","issue_comment_url":"https://api.github.com/repos/trailofbits/manticore/issues/comments{/number}","contents_url":"https://api.github.com/repos/trailofbits/manticore/contents/{+path}","compare_url":"https://api.github.com/repos/trailofbits/manticore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trailofbits/manticore/merges","archive_url":"https://api.github.com/repos/trailofbits/manticore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trailofbits/manticore/downloads","issues_url":"https://api.github.com/repos/trailofbits/manticore/issues{/number}","pulls_url":"https://api.github.com/repos/trailofbits/manticore/pulls{/number}","milestones_url":"https://api.github.com/repos/trailofbits/manticore/milestones{/number}","notifications_url":"https://api.github.com/repos/trailofbits/manticore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trailofbits/manticore/labels{/name}","releases_url":"https://api.github.com/repos/trailofbits/manticore/releases{/id}","deployments_url":"https://api.github.com/repos/trailofbits/manticore/deployments","created_at":"2017-02-10T22:28:34Z","updated_at":"2018-05-31T16:40:46Z","pushed_at":"2018-05-31T18:10:01Z","git_url":"git://github.com/trailofbits/manticore.git","ssh_url":"git@github.com:trailofbits/manticore.git","clone_url":"https://github.com/trailofbits/manticore.git","svn_url":"https://github.com/trailofbits/manticore","homepage":"https://blog.trailofbits.com/2017/04/27/manticore-symbolic-execution-for-humans/","size":15508,"stargazers_count":1121,"watchers_count":1121,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":157,"mirror_url":null,"archived":false,"open_issues_count":169,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":157,"open_issues":169,"watchers":1121,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/910"},"html":{"href":"https://github.com/trailofbits/manticore/pull/910"},"issue":{"href":"https://api.github.com/repos/trailofbits/manticore/issues/910"},"comments":{"href":"https://api.github.com/repos/trailofbits/manticore/issues/910/comments"},"review_comments":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/910/comments"},"review_comment":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/910/commits"},"statuses":{"href":"https://api.github.com/repos/trailofbits/manticore/statuses/8aefa9423c70d1ae5a3f1b8e0ab9fd88e05cec03"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"disconnect3d"}}