{"comment":{"url":"https://api.github.com/repos/ThomasKing2014/ELF-ARM-HOOK-Library/comments/14946447","html_url":"https://github.com/ThomasKing2014/ELF-ARM-HOOK-Library/commit/17b5907e8c7a6271121c29cdc2ad19112484aa18#commitcomment-14946447","id":14946447,"user":{"login":"ThomasKing2014","id":10269230,"avatar_url":"https://avatars.githubusercontent.com/u/10269230?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasKing2014","html_url":"https://github.com/ThomasKing2014","followers_url":"https://api.github.com/users/ThomasKing2014/followers","following_url":"https://api.github.com/users/ThomasKing2014/following{/other_user}","gists_url":"https://api.github.com/users/ThomasKing2014/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasKing2014/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasKing2014/subscriptions","organizations_url":"https://api.github.com/users/ThomasKing2014/orgs","repos_url":"https://api.github.com/users/ThomasKing2014/repos","events_url":"https://api.github.com/users/ThomasKing2014/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasKing2014/received_events","type":"User","site_admin":false},"position":5,"line":53,"path":"utils/TKHooklib.h","commit_id":"17b5907e8c7a6271121c29cdc2ad19112484aa18","created_at":"2015-12-13T13:36:32Z","updated_at":"2015-12-13T13:36:32Z","body":"As you say, the Bridge do 'copy' to restore the original code. And the pros and cons are obvious. \r\nYou do not need analyze the instructions. Because of the inherent characteristic of ARM instruction(eg: 'literal' instructions, ARM or Thumb mode, etc.), there do need some 'rebuild' operations. \r\nBecause of 'copy to restore' operation, it do need some locks to solve the multi-thread problem. \r\nCompared to the previous implementation, the stability of HOOK has been improved. I just do some trade-off between the advantages and disadvantages.\r\n\r\nIf you have any better ideas about the HOOK Implementation, I'd like to disscuss with you. ^_^\r\n\r\n\r\nThomasKingNew@hotmail.com\r\n \r\nFrom: shizhx\r\nDate: 2015-12-08 22:47\r\nTo: ThomasKing2014/ELF-ARM-HOOK-Library\r\nSubject: Re: [ELF-ARM-HOOK-Library] Fix some bugs (17b5907)\r\nWhy need a lock?\r\nBecause there are not any source of this .so file, I do not know how you implement the Bridge, are you copy the original binary code back when some one call the orginal function(by Bridge)? If that's true, I do not think it's a good idea.\r\n—\r\nReply to this email directly or view it on GitHub.\r\n"}}