{"action":"created","issue":{"url":"https://api.github.com/repos/yegord/snowman/issues/51","labels_url":"https://api.github.com/repos/yegord/snowman/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/yegord/snowman/issues/51/comments","events_url":"https://api.github.com/repos/yegord/snowman/issues/51/events","html_url":"https://github.com/yegord/snowman/issues/51","id":105653632,"number":51,"title":"Use relocations to disassemble more accurately","user":{"login":"jrmuizel","id":332653,"avatar_url":"https://avatars.githubusercontent.com/u/332653?v=3","gravatar_id":"","url":"https://api.github.com/users/jrmuizel","html_url":"https://github.com/jrmuizel","followers_url":"https://api.github.com/users/jrmuizel/followers","following_url":"https://api.github.com/users/jrmuizel/following{/other_user}","gists_url":"https://api.github.com/users/jrmuizel/gists{/gist_id}","starred_url":"https://api.github.com/users/jrmuizel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrmuizel/subscriptions","organizations_url":"https://api.github.com/users/jrmuizel/orgs","repos_url":"https://api.github.com/users/jrmuizel/repos","events_url":"https://api.github.com/users/jrmuizel/events{/privacy}","received_events_url":"https://api.github.com/users/jrmuizel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-09T18:17:11Z","updated_at":"2015-10-06T07:07:25Z","closed_at":null,"body":"Snowman gets pretty confused with the following dll:\r\nhttp://people.mozilla.org/~jmuizelaar/snowman/switch.dll\r\n\r\n```c\r\n__declspec(dllexport)\r\nconst char *get(int k)\r\n{\r\n        switch (k+1) {\r\n                case 0:\r\n                        return \"zero\";\r\n                case 1:\r\n                        return \"one\";\r\n                case 2:\r\n                        return \"two\";\r\n                case 3:\r\n                        return \"three\";\r\n                default:\r\n                        return \"other\";\r\n        }\r\n}\r\n\r\nconst char *get2(int k)\r\n{\r\n        switch (k) {\r\n                case 0:\r\n                        return \"zero\";\r\n                case 1:\r\n                        return \"one\";\r\n                case 2:\r\n                        return \"two\";\r\n                case 3:\r\n                        return \"three\";\r\n                default:\r\n                        return \"other\";\r\n        }\r\n}\r\n\r\n__declspec(dllexport)\r\nconst char *(*get3)(int k) = get2;\r\n\r\nint DllMain(long handle, long reason, void* reserved)\r\n{\r\n        return 1;\r\n}\r\n```\r\n\r\nUsing the relocations in .reloc we can avoid treating the addresses in the jump table as instructions for disassembly.\r\n"},"comment":{"url":"https://api.github.com/repos/yegord/snowman/issues/comments/145764235","html_url":"https://github.com/yegord/snowman/issues/51#issuecomment-145764235","issue_url":"https://api.github.com/repos/yegord/snowman/issues/51","id":145764235,"user":{"login":"uxmal","id":10154465,"avatar_url":"https://avatars.githubusercontent.com/u/10154465?v=3","gravatar_id":"","url":"https://api.github.com/users/uxmal","html_url":"https://github.com/uxmal","followers_url":"https://api.github.com/users/uxmal/followers","following_url":"https://api.github.com/users/uxmal/following{/other_user}","gists_url":"https://api.github.com/users/uxmal/gists{/gist_id}","starred_url":"https://api.github.com/users/uxmal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uxmal/subscriptions","organizations_url":"https://api.github.com/users/uxmal/orgs","repos_url":"https://api.github.com/users/uxmal/repos","events_url":"https://api.github.com/users/uxmal/events{/privacy}","received_events_url":"https://api.github.com/users/uxmal/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T07:07:25Z","updated_at":"2015-10-06T07:07:25Z","body":"@jrmuizel : I wanted to ask your permission to add the DLL you mention above (http://people.mozilla.org/~jmuizelaar/snowman/switch.dll) to the [reko](https://github.com/uxmal/reko) decompiler project as a regression test. I apologize for using this channel; I wasn't sure how else to contact you."}}