登录
  • 欢迎访问 Sharezer Blog

iOS中的HOOK技术

[TOC] 一、fishhook 1、介绍 fishhook 是 facebook 出品的一个开源库。利用 mach-o 文件加载原理,通过 rebind_symbols 函数修改__DATA Segment 的符号指针指向,来动态的 Hook C 函数。 2、主要信息 2.1、结构体 struct rebinding { const char *name; //函数名称 void *replacement; //新的函数地址 void **replaced; //保存原始函数地址变量的指针(通常要存储下来,在替换后的方法里调用) }; 2.2、主要接口 /* 交换方……继续阅读 »

sharezer 3年前 (2021-04-19) 1818浏览 0评论 0个赞

MacOS 终端命令记录

// 显示Mac隐藏文件 defaults write com.apple.finder AppleShowAllFiles YES // 隐藏Mac隐藏文件 defaults write com.apple.finder AppleShowAllFiles NO // 强制使用集显 sudo pmset -a GPUSwitch 0 // 强制使用独显 sudo pmset -a GPUSwitch 1 // 自动切换模式 sudo pmset -a GPUSwitch 2 // 修改Mac地址 sudo ifconfig en0 ether [mac地址] ……继续阅读 »

sharezer 5年前 (2019-07-17) 1816浏览 0评论 0个赞

CocoaPods国内镜像

国内Specs 清华大学镜像 https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git 上海大学镜像 https://mirrors.shu.edu.cn/CocoaPods (仅HTTP/HTTPS访问,不支持git拉取) https://mirrors.shu.edu.cn/mgit/Specs (仅git访问) https://git.shuosc.org/CocoaPods/Specs (均支持) 中国区镜像表项 git://cocoapodscn.com/Specs.git 使用方法 对于旧版的 CocoaPods 可以……继续阅读 »

sharezer 5年前 (2019-05-01) 5005浏览 0评论 0个赞

iOS获取照片EXIF信息

废话不多说,直接上代码。 let options = PHImageRequestOptions() options.version = PHImageRequestOptionsVersion.current; options.deliveryMode = PHImageRequestOptionsDeliveryMode.highQualityFormat; options.isSynchronous = true; let phImageManager = PHImageManager.default() phImageManager.requestImageData(for: phot……继续阅读 »

sharezer 5年前 (2018-12-02) 2243浏览 0评论 0个赞

AVFoundation Programming Guide(官方文档翻译)完整版中英对照

新博客: 完整版 - AVFoundation Programming Guide 分章节版: – 第 1 章:About AVFoundation - AVFoundation 概述 – 第 2 章:Using Assets - 使用 Assets – 第 3 章:Playback - 播放 – 第 4 章:Editing - 编辑 – 第 5 章:Still and Video Media Capture - 静态视频媒体捕获 – 第 6 章:Export - 输出 – 第 7 章:Time and Media Representations 时间和媒体表现 版权声明:本文为博主原创翻译……继续阅读 »

sharezer 5年前 (2018-11-23) 5559浏览 0评论 0个赞

Android&iOS一键分享

[TOC] Android与iOS不嵌入微信SDK的情况上发送一份文件给微信好友。 1. iOS 一键分享 let activityVC = UIActivityViewController(activityItems: ["需要分享文件asset" as Any], applicationActivities: nil) activityVC.popoverPresentationController?.sourceView = self.view self.present(activityVC, animated: true, completion: nil) 效果如……继续阅读 »

sharezer 5年前 (2018-11-23) 3095浏览 0评论 0个赞

保存NSImage到文件

@IBAction func SaveImage(_ sender: Any) { if resuleImage.image != nil { let savePanel = NSSavePanel.init() savePanel.allowedFileTypes = [(captureFilePath?.pathExtension)!] savePanel.message = "Choose the path to save the image" savePanel.isExtensionHidden = false ……继续阅读 »

sharezer 7年前 (2016-12-13) 2588浏览 0评论 0个赞