{"action":"opened","issue":{"url":"https://api.github.com/repos/angr/angr/issues/636","repository_url":"https://api.github.com/repos/angr/angr","labels_url":"https://api.github.com/repos/angr/angr/issues/636/labels{/name}","comments_url":"https://api.github.com/repos/angr/angr/issues/636/comments","events_url":"https://api.github.com/repos/angr/angr/issues/636/events","html_url":"https://github.com/angr/angr/issues/636","id":256138666,"number":636,"title":"scanf issue","user":{"login":"Owlz","id":7632864,"avatar_url":"https://avatars1.githubusercontent.com/u/7632864?v=4","gravatar_id":"","url":"https://api.github.com/users/Owlz","html_url":"https://github.com/Owlz","followers_url":"https://api.github.com/users/Owlz/followers","following_url":"https://api.github.com/users/Owlz/following{/other_user}","gists_url":"https://api.github.com/users/Owlz/gists{/gist_id}","starred_url":"https://api.github.com/users/Owlz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Owlz/subscriptions","organizations_url":"https://api.github.com/users/Owlz/orgs","repos_url":"https://api.github.com/users/Owlz/repos","events_url":"https://api.github.com/users/Owlz/events{/privacy}","received_events_url":"https://api.github.com/users/Owlz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-08T04:35:56Z","updated_at":"2017-09-08T04:35:56Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"There's an issue where the interpretation of scanf seems to be right, and wrong, both at the same time.\r\n\r\nHere's the C code:\r\n```c\r\n#include <stdio.h>\r\n#include <stdlib.h>\r\n\r\nint main() {\r\n    int i;\r\n\r\n    scanf(\"%d\",&i);\r\n    printf(\"Your input: %d\\n\", i);\r\n    if (i == 1337)\r\n        printf(\"Win\\n\");\r\n}\r\n```\r\n\r\nHere's a test run:\r\n```python\r\nIn [1]: import angr\r\nWARNING | 2017-09-08 04:30:55,180 | angr.state_plugins.unicorn_engine | failed loading \"angr_native.so\", unicorn support disabled (/home/angr/angr-dev/angr/angr/lib/angr_native.so: undefined symbol: simunicorn_executed_pages: /home/angr/angr-dev/angr/angr/lib/angr_native.so: undefined symbol: simunicorn_executed_pages)\r\n\r\nIn [2]: proj = angr.Project(\"./a.out\")\r\n\r\nIn [3]: sim = proj.factory.simgr()\r\n\r\nIn [4]: sim.explore()\r\nWARNING | 2017-09-08 04:31:21,377 | angr.state_plugins.symbolic_memory | Concretizing symbolic length. Much sad; think about implementing.\r\nOut[4]: <SimulationManager with 2 deadended>\r\n\r\nIn [5]: sim.deadended[1].posix.dumps(1)\r\nOut[5]: 'Your input: -147275146\\nWin\\n'\r\n\r\nIn [6]: sim.deadended[1].posix.dumps(0)\r\nOut[6]: '+0000001337\\n'\r\n```\r\n\r\nThis issue, angr correctly identifies that a valid input could be \"+0000001337\", but when attempting to re-create the stdout, it gives a negative number."}}
{"actor":{"display_login":"Owlz"}}