main_arm64
用MachOView去查看这个main_arm64: Mach-O 64-bit executable arm64
Mach64 Header
内容:
- Mach64 Header
MH_MAGIC_64
CPU_TYPE_ARM64
CPU_SUBTYPE_ARM64_ALL
MH_EXECUTE
- Number for Load Commands:
17
- Flags
MH_NOUNDEFS
MH_DYLDLINK
MH_TWOLEVEL
MH_PIC
- Reserved: 0
Load Commands
LC_SEGMENT_64 (__PAGEZERO
)
LC_SEGMENT_64 (__TEXT
)
__TEXT,__text
__TEXT,__stubs
__TEXT,__stub_helper
__TEXT,__cstring
__TEXT,__unwind_info
LC_SEGMENT_64 (__DATA_CONST
)
__DATA_CONST,__got
LC_SEGMENT_64 (__DATA
)
__DATA,__la_symbol_ptr
__DATA,__data
__DATA,__common
LC_SEGMENT_64 (__LINKEDIT
)
LC_DYLD_INFO_ONLY
LC_SYMTAB
LC_DYSYMTAB
LC_LOAD_DYLINKER
LC_UUID
??? (unsupported)
LC_SOURCE_VERSION
LC_MAIN
估计就是 入口函数 入口地址 = 一般叫做 main函数的 地方了
LC_LOAD_DYLIB (libSystem.B.dylib)
LC_FUNCTION_STARTS
好像是:需要启动运行的函数的列表?
LC_DATA_IN_CODE
LC_CODE_SIGNATURE
Sections
Section64 (__TEXT,__text
)
- Assembly
- Assembly
Section64 (__TEXT,__stubs
)
- Symbol Stubs
- Symbol Stubs
好像是:
stub=表示 桩 ,地基
表示,代码运行前,要打地基 = 做好准备
所以此处表示:所引用的外部的函数
此处分别是:
___strcpy_chk
_free
_malloc
_printf
Section64 (__TEXT,__stub_helper
)
- Assembly
- Assembly
Section64 (__TEXT,__cstring
)
- C String Literals
- C String Literals
Section64 (__TEXT,__unwind_info
)
Section64 (__DATA_CONST,__got
)
- Non-Lazy Symbol Pointers
- Non-Lazy Symbol Pointers
Section64 (__DATA,__la_symbol_ptr
)
- Lazy Symbol Pointers
- Lazy Symbol Pointers
Section64 (__DATA,__data
)
Dynamic Loader Info
- Rebase Info
- Opcodes
- Actions
- Opcodes
- Binding Info
- Opcodes
- Opcodes
- Actions
- Lazy Binding Info
- Opcodes
- Opcodes
- Actions
- Export Info
- Opcodes
- Opcodes
- Actions
- Rebase Info
对应原先代码中的,全局变量:
// demo Data segment
const char* gAuthor = "crifan"; // demo const string, place where?
char* gFullName = "CrifanLi"; // demo non-const string, place where?
int gInputArgsCount; // demo uninitialized data
int gCurDate = 20230419; // demo initialized data
好像还额外去导出了这些全局变量?
Function Starts
- Functions
- Functions
Symbol Table
- Symbols
- Symbols
Data in Code Entries
Dynamic Symbol Table
- Indirect Symbols
- Indirect Symbols
String Table
- Strings Parse
- Strings Parse