{"action":"created","comment":{"url":"https://api.github.com/repos/trailofbits/manticore/pulls/comments/123819288","pull_request_review_id":46062783,"id":123819288,"diff_hunk":"@@ -534,43 +787,102 @@ def run(self, procs=1, timeout=0):\n             with open(args.replay, 'r') as freplay:\n                 replay = map(lambda x: int(x, 16), freplay.readlines())\n \n-        state = self._make_state(self._binary)\n+        initial_state = self._make_state(self._binary)\n \n-        self._executor = Executor(state,\n+        self._executor = Executor(initial_state,\n                                   workspace=self.workspace, \n                                   policy=self._policy, \n                                   dumpafter=self.dumpafter, \n                                   maxstates=self.maxstates,\n                                   maxstorage=self.maxstorage,\n                                   replay=replay,\n-                                  dumpstats=self.should_profile)\n+                                  dumpstats=self.should_profile,\n+                                  context=self.context)\n         \n \n+\n+        #Link Executor events to default callbacks in manticore object\n+        self._executor.did_read_register += self._read_register_callback\n+        self._executor.will_write_register += self._write_register_callback\n+        self._executor.did_read_memory += self._read_memory_callback\n+        self._executor.will_write_memory += self._write_memory_callback\n+        self._executor.will_execute_instruction += self._execute_instruction_callback\n+        self._executor.will_decode_instruction += self._decode_instruction_callback\n+        self._executor.will_store_state += self._store_state_callback\n+        self._executor.will_load_state += self._load_state_callback\n+        self._executor.will_fork_state += self._fork_state_callback\n+        self._executor.will_terminate_state += self._terminate_state_callback\n+        self._executor.will_generate_testcase += self._generate_testcase_callback\n+\n         if self._hooks:\n-            self._executor.will_execute_pc += self._hook_callback\n+            self._executor.will_execute_instruction += self._hook_callback\n \n         if self._model_hooks:\n-            self._executor.will_execute_pc += self._model_hook_callback\n+            self._executor.will_execute_instruction += self._model_hook_callback\n \n         if self._assertions:\n-            self._executor.will_execute_pc += self._assertions_callback\n+            self._executor.will_execute_instruction += self._assertions_callback\n \n         self._time_started = time.time()\n \n         self._running = True\n \n-\n         if timeout > 0:\n             t = Timer(timeout, self.terminate)\n             t.start()\n         try:\n-            self._start_workers(procs)\n+            self._start_workers(procs, profiling=False)\n \n             self._join_workers()\n         finally:\n             self._running = False\n             if timeout > 0:\n                 t.cancel()\n+        #Copy back the shared conext\n+        self._context = dict(self._executor._shared_context)\n+        self._executor = None\n+\n+        if self.should_profile:\n+\n+            class PstatsFormatted:\n+                def __init__(self, d):\n+                    self.stats = dict(d)\n+                def create_stats(self):\n+                    pass\n+\n+            ps = None\n+            for item in self._stats:","path":"manticore/manticore.py","position":460,"original_position":460,"commit_id":"5af9340c3f9472aa60af1eee5e5ae8a89fe45b34","original_commit_id":"5af9340c3f9472aa60af1eee5e5ae8a89fe45b34","user":{"login":"mossberg","id":2467355,"avatar_url":"https://avatars2.githubusercontent.com/u/2467355?v=3","gravatar_id":"","url":"https://api.github.com/users/mossberg","html_url":"https://github.com/mossberg","followers_url":"https://api.github.com/users/mossberg/followers","following_url":"https://api.github.com/users/mossberg/following{/other_user}","gists_url":"https://api.github.com/users/mossberg/gists{/gist_id}","starred_url":"https://api.github.com/users/mossberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mossberg/subscriptions","organizations_url":"https://api.github.com/users/mossberg/orgs","repos_url":"https://api.github.com/users/mossberg/repos","events_url":"https://api.github.com/users/mossberg/events{/privacy}","received_events_url":"https://api.github.com/users/mossberg/received_events","type":"User","site_admin":false},"body":"`_stats` is undeclared. this breaks when you use `manticore --profile`","created_at":"2017-06-23T18:43:57Z","updated_at":"2017-06-23T18:43:57Z","html_url":"https://github.com/trailofbits/manticore/pull/341#discussion_r123819288","pull_request_url":"https://api.github.com/repos/trailofbits/manticore/pulls/341","_links":{"self":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/comments/123819288"},"html":{"href":"https://github.com/trailofbits/manticore/pull/341#discussion_r123819288"},"pull_request":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/341"}}},"pull_request":{"url":"https://api.github.com/repos/trailofbits/manticore/pulls/341","id":126649474,"html_url":"https://github.com/trailofbits/manticore/pull/341","diff_url":"https://github.com/trailofbits/manticore/pull/341.diff","patch_url":"https://github.com/trailofbits/manticore/pull/341.patch","issue_url":"https://api.github.com/repos/trailofbits/manticore/issues/341","number":341,"state":"open","locked":false,"title":"Dev - events","user":{"login":"feliam","id":1017522,"avatar_url":"https://avatars2.githubusercontent.com/u/1017522?v=3","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":"Deja vu!","created_at":"2017-06-20T23:13:52Z","updated_at":"2017-06-23T18:43:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb28cd0704388ad7ecc7029002983ddcb5f750ec","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/trailofbits/manticore/pulls/341/commits","review_comments_url":"https://api.github.com/repos/trailofbits/manticore/pulls/341/comments","review_comment_url":"https://api.github.com/repos/trailofbits/manticore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trailofbits/manticore/issues/341/comments","statuses_url":"https://api.github.com/repos/trailofbits/manticore/statuses/5af9340c3f9472aa60af1eee5e5ae8a89fe45b34","head":{"label":"trailofbits:dev-events","ref":"dev-events","sha":"5af9340c3f9472aa60af1eee5e5ae8a89fe45b34","user":{"login":"trailofbits","id":2314423,"avatar_url":"https://avatars3.githubusercontent.com/u/2314423?v=3","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,"name":"manticore","full_name":"trailofbits/manticore","owner":{"login":"trailofbits","id":2314423,"avatar_url":"https://avatars3.githubusercontent.com/u/2314423?v=3","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":"Dynamic binary analysis 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":"2017-06-22T14:49:04Z","pushed_at":"2017-06-23T14:33:23Z","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":11253,"stargazers_count":631,"watchers_count":631,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":69,"mirror_url":null,"open_issues_count":82,"forks":69,"open_issues":82,"watchers":631,"default_branch":"master"}},"base":{"label":"trailofbits:master","ref":"master","sha":"a3f0d92393de8b162cbea56a64d1d46c0fb65975","user":{"login":"trailofbits","id":2314423,"avatar_url":"https://avatars3.githubusercontent.com/u/2314423?v=3","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,"name":"manticore","full_name":"trailofbits/manticore","owner":{"login":"trailofbits","id":2314423,"avatar_url":"https://avatars3.githubusercontent.com/u/2314423?v=3","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":"Dynamic binary analysis 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":"2017-06-22T14:49:04Z","pushed_at":"2017-06-23T14:33:23Z","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":11253,"stargazers_count":631,"watchers_count":631,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":69,"mirror_url":null,"open_issues_count":82,"forks":69,"open_issues":82,"watchers":631,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/341"},"html":{"href":"https://github.com/trailofbits/manticore/pull/341"},"issue":{"href":"https://api.github.com/repos/trailofbits/manticore/issues/341"},"comments":{"href":"https://api.github.com/repos/trailofbits/manticore/issues/341/comments"},"review_comments":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/341/comments"},"review_comment":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trailofbits/manticore/pulls/341/commits"},"statuses":{"href":"https://api.github.com/repos/trailofbits/manticore/statuses/5af9340c3f9472aa60af1eee5e5ae8a89fe45b34"}}}}
{"actor":{"display_login":"mossberg"}}