{"id":36006,"date":"2022-05-26T16:17:12","date_gmt":"2022-05-26T20:17:12","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=36006"},"modified":"2022-05-26T16:17:12","modified_gmt":"2022-05-26T20:17:12","slug":"code-injection-with-dyld-interposing","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2022\/05\/26\/code-injection-with-dyld-interposing\/","title":{"rendered":"Code Injection with Dyld Interposing"},"content":{"rendered":"<p><a href=\"https:\/\/www.emergetools.com\/blog\/posts\/DyldInterposing\">Noah Martin<\/a>:<\/p>\n<blockquote cite=\"https:\/\/www.emergetools.com\/blog\/posts\/DyldInterposing\"><p>Swizzling handles Objective-C methods, but cannot be used for C\/C++ functions. Non-Obj-C lower level calls can be useful for reverse engineering iOS apps, but sometimes you need to intercept them in an app that you don&rsquo;t have the source code for.<\/p><p>In this post we&rsquo;ll be looking at a lesser known technique for injecting code at a function call, one that works with C\/C++ functions and with unmodified app binaries.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/steipete.wtf\/posts\/mac-catalyst-crash-hunt\/\">Peter Steinberger<\/a>:<\/p>\n<blockquote cite=\"https:\/\/steipete.wtf\/posts\/mac-catalyst-crash-hunt\/\">\n<p>As of macOS 10.15.4, text input in Mac Catalyst apps sometimes crashes. I&rsquo;ve noticed this a lot in <a href=\"https:\/\/apps.apple.com\/us\/app\/twitter\/id1482454543?mt=12\">Twitter for Mac<\/a>, however, we also saw crash reports for <a href=\"https:\/\/pdfviewer.io\">PDF Viewer for Mac<\/a>. My hope was Apple would fix this in 10.15.5, but now the release is out and things are still crashing, so let&rsquo;s fix this ourselves.<\/p>\n<\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2020\/06\/01\/interposekit\/\">InterposeKit<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2019\/01\/25\/xcode-10-2-beta-release-notes\/\">Xcode 10.2 Beta Release Notes<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Noah Martin: Swizzling handles Objective-C methods, but cannot be used for C\/C++ functions. Non-Obj-C lower level calls can be useful for reverse engineering iOS apps, but sometimes you need to intercept them in an app that you don&rsquo;t have the source code for.In this post we&rsquo;ll be looking at a lesser known technique for injecting [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2022-05-26T20:17:15Z","apple_news_api_id":"70a0fdd6-5461-4fe7-bc9a-79f4a929e922","apple_news_api_modified_at":"2022-05-26T20:17:15Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AcKD91lRhT-e8mnn0qSnpIg","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[131,326,1621,205,31,2078,30,1666,71],"class_list":["post-36006","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-bug","tag-c-plus-plus","tag-marzipan","tag-dyld","tag-ios","tag-ios-15","tag-mac","tag-macos-10-15","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36006","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=36006"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36006\/revisions"}],"predecessor-version":[{"id":36007,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/36006\/revisions\/36007"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=36006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=36006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=36006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}