{"action":"opened","issue":{"url":"https://api.github.com/repos/unicorn-engine/unicorn/issues/956","repository_url":"https://api.github.com/repos/unicorn-engine/unicorn","labels_url":"https://api.github.com/repos/unicorn-engine/unicorn/issues/956/labels{/name}","comments_url":"https://api.github.com/repos/unicorn-engine/unicorn/issues/956/comments","events_url":"https://api.github.com/repos/unicorn-engine/unicorn/issues/956/events","html_url":"https://github.com/unicorn-engine/unicorn/issues/956","id":313276500,"number":956,"title":"Why is uc_mem_protect calling uc_emu_stop when removing UC_PROT_EXEC on non-executed mem-area","user":{"login":"MichaWe","id":22656506,"avatar_url":"https://avatars2.githubusercontent.com/u/22656506?v=4","gravatar_id":"","url":"https://api.github.com/users/MichaWe","html_url":"https://github.com/MichaWe","followers_url":"https://api.github.com/users/MichaWe/followers","following_url":"https://api.github.com/users/MichaWe/following{/other_user}","gists_url":"https://api.github.com/users/MichaWe/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaWe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaWe/subscriptions","organizations_url":"https://api.github.com/users/MichaWe/orgs","repos_url":"https://api.github.com/users/MichaWe/repos","events_url":"https://api.github.com/users/MichaWe/events{/privacy}","received_events_url":"https://api.github.com/users/MichaWe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-11T11:05:55Z","updated_at":"2018-04-11T11:05:55Z","closed_at":null,"author_association":"NONE","body":"I was running an ELF executable in a x86_64 environment and noticed, that by calling `uc_mem_protect(uc, addr, size, UC_PROT_NONE)` causes the emulator to quit and continue at the same position.\r\n\r\nThis behavior results from the given code:\r\n\r\n```c\r\nif (((mr->perms & UC_PROT_EXEC) != 0) && ((perms & UC_PROT_EXEC) == 0))\r\n    remove_exec = true;\r\n...\r\nif (remove_exec) {\r\n    uc->quit_request = true;\r\n    uc_emu_stop(uc);\r\n}\r\n```\r\n\r\nIs it correct that execution is suspended and resumed even if the currently executed instruction is outside of `addr`? It appears strange to me that changing permissions of a different memory segment than the one with the currently executed code would trigger such behavior."}}
{"actor":{"display_login":"MichaWe"}}