{"id":27848,"date":"2015-02-22T11:28:37","date_gmt":"2015-02-22T02:28:37","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=27848"},"modified":"2015-02-22T11:28:38","modified_gmt":"2015-02-22T02:28:38","slug":"kernel-panic-in-latest-os-x","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/kernel-panic-in-latest-os-x\/","title":{"rendered":"\u3010\u60b2\u5831\u301110\u884c\u3067\u6700\u65b0OS X\/iOS\u306b\u30ab\u30fc\u30cd\u30eb\u30d1\u30cb\u30c3\u30af\u3092\u767a\u751f\u3055\u305b\u308bC\u30b3\u30fc\u30c9\u304c\u767a\u898b\u3055\u308c\u308b"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2015\/02\/Ikeyboard-114439_640.jpg\" alt=\"Keyboard 114439 640\" title=\"keyboard-114439_640.jpg\" border=\"0\" width=\"546\" height=\"385\" \/><\/p>\n<p>\u6700\u65b0\u306e\u300cOS X\u300d\u304c\u308f\u305a\u304b10\u884c\u306eC\u30b3\u30fc\u30c9\u3067\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u3066\u3057\u307e\u3046\u2026\u305d\u3093\u306a\u885d\u6483\u7684\u306aC\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059(<a href=\"https:\/\/gist.github.com\/anonymous\/de6b81c556b5dc7cdc8b\">Gist<\/a>\u3001<a href=\"http:\/\/www.reddit.com\/r\/programming\/comments\/2wkdbr\/kernel_panic_in_latest_os_x_in_10_lines_of_c\/\">Reddit<\/a>)\u3002<\/p>\n<pre><code class=\"c\">#include <unistd.h>\n#include <mach\/mach.h>\n#include <mach\/mach_vm.h>\n#include <mach-o\/dyld.h>\n \nint\nmain (int argc, char * argv[])\n{\n  volatile char * library;\n  const mach_vm_size_t page_size = getpagesize ();\n  const mach_vm_size_t buffer_size = 3 * page_size;\n  char buffer[buffer_size];\n  mach_vm_size_t result_size;\n \n  library = (char *) _dyld_get_image_header (1);\n  mach_vm_protect (mach_task_self (), (mach_vm_address_t) (library + page_size), page_size, FALSE, VM_PROT_READ | VM_PROT_WRITE | VM_PROT_COPY | VM_PROT_EXECUTE);\n  library[page_size]++;\n  library[page_size]--;\n  result_size = 0;\n  mach_vm_read_overwrite (mach_task_self (), (mach_vm_address_t) library, buffer_size, (mach_vm_address_t) buffer, &result_size);\n \n  return 0;\n}\n<\/code><\/pre>\n<p>\u767a\u898b\u8005\u306f<a href=\"\">Frida<\/a>\u3068\u547c\u3070\u308c\u308b\u3001\u30d7\u30ed\u30bb\u30b9\u306e\u30c8\u30ec\u30fc\u30b9\u3084\u95a2\u6570\u306e\u30d5\u30c3\u30af\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u30c4\u30fc\u30eb\u306e\u958b\u767a\u8005\u3001Ole Andr\u00e9 Vadla Ravn\u00e5s\u6c0f\u3002Frida\u306e\u4f7f\u7528\u8005\u304b\u3089\u3001\u6642\u6298Kernel\u30d1\u30cb\u30c3\u30af\u304c\u767a\u751f\u3059\u308b\u3068\u306e\u30ec\u30dd\u30fc\u30c8\u3092\u53d7\u3051\u53d6\u308a\u3001\u539f\u56e0\u3092\u8ffd\u6c42\u3059\u308b\u3046\u3061\u306b\u3001Kernel\u306e\u4e0d\u5177\u5408\u304c\u539f\u56e0\u3067\u3042\u308b\u3053\u3068\u3092\u3064\u304d\u3068\u3081\u307e\u3057\u305f\u3002\u6280\u8853\u7684\u306a\u8a73\u7d30\u306f<a href=\"https:\/\/medium.com\/@oleavr\/diy-kernel-panic-os-x-and-ios-in-10-loc-c250d9649159\">\u30d6\u30ed\u30b0<\/a>\u306b\u3066\u7d30\u304b\u304f\u89e3\u8aac\u3055\u308c\u3066\u3044\u3066\u307e\u3059(\u30b7\u30b9\u30c6\u30e0\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u8a73\u3057\u304f\u306a\u3044\u3068\u6b6f\u304c\u305f\u305f\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u2026)\u3002<\/p>\n<p>\u540c\u6c0f\u306f\u3001\u3053\u306e\u4e0d\u5177\u5408\u306b\u5bfe\u5fdc\u3057\u305fFrida 1.6.9\u3092\u9593\u3082\u306a\u304f\u30ea\u30ea\u30fc\u30b9\u3059\u308b\u4e88\u5b9a\u3067\u3001Apple\u306b\u5bfe\u3057\u3066\u3082\u5831\u544a\u6e08\u307f\u3068\u306e\u3053\u3068(\u3053\u308c\u307e\u3067\u306e\u6d41\u308c\u3092\u898b\u308b\u306b\u3059\u3050\u306b\u4fee\u6b63\u3055\u308c\u306a\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u3068\u3082\u6307\u6458\u3057\u3066\u3044\u307e\u3059\u304c)\u3002<\/p>\n<p>\u307e\u305f\u3001\u3053\u306e\u4e0d\u5177\u5408\u3092\u518d\u73fe\u3059\u308b\u305f\u3081\u306eXocde\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u300c<a href=\"https:\/\/github.com\/jdmoreira\/KernelPanic-10LOC\">KernelPanic-10LOC<\/a>\u300d\u3082GitHub\u3067\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u65b0\u306e\u300cOS X\u300d\u304c\u308f\u305a\u304b10\u884c\u306eC\u30b3\u30fc\u30c9\u3067\u30af\u30e9\u30c3\u30b7\u30e5\u3057\u3066\u3057\u307e\u3046\u2026\u305d\u3093\u306a\u885d\u6483\u7684\u306aC\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059(Gist\u3001Reddit)\u3002 #include #include #include #include in [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":27847,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[46,4,75],"tags":[1699,8],"class_list":["post-27848","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ios","category-mac","category-software","tag-kernel","tag-osx"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/27848","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=27848"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/27848\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/27847"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=27848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=27848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=27848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}