otool
-fprint the fat headers-aprint the archive header-hprint the mach header-lprint the load commands-Lprint shared libraries used-Dprint shared library id name-tprint the text section (disassemble with -v)-xprint all text sections (disassemble with -v)-pstart dissassemble from routine name -sprint contents of section -dprint the data section-oprint the Objective-C segment-rprint the relocation entries-Sprint the table of contents of a library (obsolete)-Tprint the table of contents of a dynamic shared library (obsolete)-Mprint the module table of a dynamic shared library (obsolete)-Rprint the reference table of a dynamic shared library (obsolete)-Iprint the indirect symbol table-Hprint the two-level hints table (obsolete)-Gprint the data in code table-vprint verbosely (symbolically) when possible-Vprint disassembled operands symbolically-cprint argument strings of a core file-Xprint no leading addresses or headers-mdon't use archive(member) syntax-Bforce Thumb disassembly (ARM objects only)-quse llvm's disassembler (the default)-Quse otool(1)'s disassembler-mcpu=arguseargas the cpu for disassembly-jprint opcode bytes-Pprint the info plist section as strings-Cprint linker optimization hints--versionprint the version
示例
|
1 2 3 4 5 6 7 |
otool -h libuecm.dylib # 显示如下 libuecm.dylib: Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags 0xfeedfacf 16777223 3 0x00 6 16 1640 0x00118085 |
|
1 |
otool -l EnSoftwareColl.dylib |
|
1 |
otool -L /path/to/executable |
|
1 |
otool -tV /path/to/executable |
|
1 2 |
# 有没有加密 otool -l clion | grep crypt |
install_name_tool
change
|
1 |
install_name_tool -change old_path new_path executable |
- 上述命令是macOS 上的一个命令行工具,它允许您更改可执行文件或共享库所依赖的动态链接库的路径。
old_path是当前依赖库的路径new_path是要替换为的新路径executable是要修改的可执行文件或共享库的路径
spctl
验证文件来源
|
1 |
spctl --assess --verbose --type <file> |
|
1 2 3 4 5 6 |
spctl --assess --verbose --type execute /Applications/CLion.app/Contents/MacOS/clion # spctl --assess --verbose --type install /path/to/Installer.pkg res: /Applications/CLion.app/Contents/MacOS/clion: accepted source=Notarized Developer ID |
控制执行权限
|
1 |
spctl --add --label <label> --path <file> |
|
1 2 |
$ spctl --add --label "MyApp" --path /Applications/MyApp.app # 该命令会将 /Applications/MyApp.app 添加到允许执行的列表中,并分配一个标签 "MyApp" |
查询当前安全策略状态
|
1 |
spctl --status |
|
1 2 |
assessment enabled # 结果显示安全评估功能处于启用状态 |
声明:本文为原创文章,版权归Aet所有,欢迎分享本文,转载请保留出处!
你可能也喜欢
- ♥ 各平台调试方法总结记述一09/25
- ♥ VMaware:安装MacOS 10.14.610/16
- ♥ Macos服务相关03/27
- ♥ 51CTO:C++网络通信引擎架构与实现一09/09
- ♥ macOS应用记述一10/26
- ♥ Macos开发相关工具03/21