{"action":"created","issue":{"url":"https://api.github.com/repos/angr/angr/issues/157","repository_url":"https://api.github.com/repos/angr/angr","labels_url":"https://api.github.com/repos/angr/angr/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/angr/angr/issues/157/comments","events_url":"https://api.github.com/repos/angr/angr/issues/157/events","html_url":"https://github.com/angr/angr/issues/157","id":166085700,"number":157,"title":"SimProcedureError when constructing CFGFast for attached file (this happens for all of git's executables)","user":{"login":"nimrodpar","id":1827359,"avatar_url":"https://avatars.githubusercontent.com/u/1827359?v=3","gravatar_id":"","url":"https://api.github.com/users/nimrodpar","html_url":"https://github.com/nimrodpar","followers_url":"https://api.github.com/users/nimrodpar/followers","following_url":"https://api.github.com/users/nimrodpar/following{/other_user}","gists_url":"https://api.github.com/users/nimrodpar/gists{/gist_id}","starred_url":"https://api.github.com/users/nimrodpar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nimrodpar/subscriptions","organizations_url":"https://api.github.com/users/nimrodpar/orgs","repos_url":"https://api.github.com/users/nimrodpar/repos","events_url":"https://api.github.com/users/nimrodpar/events{/privacy}","received_events_url":"https://api.github.com/users/nimrodpar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-18T12:48:30Z","updated_at":"2016-07-18T21:18:12Z","closed_at":null,"body":"Traceback = \r\n```\r\nfunctions = binary.analyses.CFGFast(resolve_indirect_jumps=False).kb.functions\r\n  File \"/usr/local/lib/python2.7/dist-packages/angr/analysis.py\", line 99, in make_analysis\r\n    oself.__init__(*args, **kwargs)\r\n  File \"/usr/local/lib/python2.7/dist-packages/angr/analyses/cfg_fast.py\", line 595, in __init__\r\n    self._analyze()\r\n  File \"/usr/local/lib/python2.7/dist-packages/angr/analyses/forward_analysis.py\", line 186, in _analyze\r\n    self._handle_entry(entry_info)\r\n  File \"/usr/local/lib/python2.7/dist-packages/angr/analyses/forward_analysis.py\", line 213, in _handle_entry\r\n    successors = self._get_successors(entry)\r\n  File \"/usr/local/lib/python2.7/dist-packages/angr/analyses/cfg_fast.py\", line 839, in _get_successors\r\n    return self._scan_block(addr, current_function_addr, jumpkind, src_node, src_stmt_idx)\r\n  File \"/usr/local/lib/python2.7/dist-packages/angr/analyses/cfg_fast.py\", line 1066, in _scan_block\r\n    previous_src_stmt_idx)\r\n  File \"/usr/local/lib/python2.7/dist-packages/angr/analyses/cfg_fast.py\", line 1120, in _scan_procedure\r\n    new_exits = hooker.static_exits(self.project.arch, blocks_ahead)\r\n  File \"/usr/local/lib/python2.7/dist-packages/simuvex/s_procedure.py\", line 303, in static_exits\r\n    raise SimProcedureError(\"static_exits() is not implemented for SimProcedure %s\" % cls.__name__)\r\nSimProcedureError: static_exits() is not implemented for SimProcedure pthread_create\r\n```\r\n[gcc-4.8__O2__git-2.10.0__git-var.zip](https://github.com/angr/angr/files/369031/gcc-4.8__O2__git-2.10.0__git-var.zip)\r\n"},"comment":{"url":"https://api.github.com/repos/angr/angr/issues/comments/233462020","html_url":"https://github.com/angr/angr/issues/157#issuecomment-233462020","issue_url":"https://api.github.com/repos/angr/angr/issues/157","id":233462020,"user":{"login":"rhelmot","id":2498805,"avatar_url":"https://avatars.githubusercontent.com/u/2498805?v=3","gravatar_id":"","url":"https://api.github.com/users/rhelmot","html_url":"https://github.com/rhelmot","followers_url":"https://api.github.com/users/rhelmot/followers","following_url":"https://api.github.com/users/rhelmot/following{/other_user}","gists_url":"https://api.github.com/users/rhelmot/gists{/gist_id}","starred_url":"https://api.github.com/users/rhelmot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhelmot/subscriptions","organizations_url":"https://api.github.com/users/rhelmot/orgs","repos_url":"https://api.github.com/users/rhelmot/repos","events_url":"https://api.github.com/users/rhelmot/events{/privacy}","received_events_url":"https://api.github.com/users/rhelmot/received_events","type":"User","site_admin":false},"created_at":"2016-07-18T21:18:12Z","updated_at":"2016-07-18T21:18:12Z","body":"```\r\ndiff --git a/simuvex/procedures/libc___so___6/pthread_create.py b/simuvex/procedures/libc___so___6/pthread_create.py\r\nindex 7b9ef7a..78d4855 100644\r\n--- a/simuvex/procedures/libc___so___6/pthread_create.py\r\n+++ b/simuvex/procedures/libc___so___6/pthread_create.py\r\n@@ -1,4 +1,5 @@\r\n import simuvex\r\n+import pyvex\r\n\r\n ######################################\r\n # pthread_create\r\n@@ -21,3 +22,30 @@ class pthread_create(simuvex.SimProcedure):\r\n\r\n         self.add_successor(new_state, code_addr, new_state.se.true, jumpkind='Ijk_Call')\r\n         return self.state.se.BVV(0, self.state.arch.bits)\r\n+\r\n+    @classmethod\r\n+    def static_exits(cls, arch, blocks):\r\n+        # Execute those blocks with a blank state, and then dump the arguments\r\n+        blank_state = simuvex.SimState(arch=arch, mode=\"fastpath\")\r\n+\r\n+        # Execute each block\r\n+        state = blank_state\r\n+        for b in blocks:\r\n+            # state.regs.ip = next(iter(stmt for stmt in b.statements if isinstance(stmt, pyvex.IRStmt.IMark))).addr\r\n+            irsb = simuvex.SimIRSB(state, b,\r\n+                        addr=next(iter(stmt for stmt in b.statements if isinstance(stmt, pyvex.IRStmt.IMark))).addr)\r\n+            if irsb.successors:\r\n+                state = irsb.successors[0]\r\n+            else:\r\n+                break\r\n+\r\n+        cc = simuvex.DefaultCC[arch.name](arch)\r\n+        callfunc = cc.arg(state, 2)\r\n+        retaddr = state.memory.load(state.regs.sp, arch.bytes)\r\n+\r\n+        all_exits = [\r\n+            (callfunc, 'Ijk_Call'),\r\n+            (retaddr, 'Ijk_Ret')\r\n+        ]\r\n+\r\n+        return all_exits\r\n```"}}
{"actor":{"display_login":"rhelmot"}}