관리-도구
편집 파일: macosx_libfile.cpython-38.pyc
U -?�f�@ � @ s� d Z ddlmZ ddlZddlZddlZddlmZ ddlm Z e rbddlm Z e eeje f Z dZdZd Zd ZdZdZd ZdZdZdZdZdejfdejfdejfdejfdejfdejfdejfgZedejfg ZdejfdejfgZdejfdejfdejfdejfdejfgZdejfdejfdejfdejfdejfdejfgZ dejfdejfgZ!dejfdejfd ej"d! fd"ejfd#ejfd$ejfd%ejfd&ejfd'ejfd(ejfdejfgZ#dejfdejfd ej"d! fd"ejfd#ejfd$ejfd%ejfd&ejfd'ejfd(ejfdejfgZ$e!d)ejfd*ejfg Z%e!d+ejfd,ejfd*ejfd-ejfg Z&d.d.d/�d0d1�Z'dKd2d3d4d5�d6d7�Z(d8d2d9�d:d;�Z)d<d=�d>d?�Z*dLd2d3d@d5�dAdB�Z+d.dCdD�dEdF�Z,dGd<d<dH�dIdJ�Z-dS )Ma� This module contains function to analyse dynamic library headers to extract system information Currently only for MacOSX Library file on macosx system starts with Mach-O or Fat field. This can be distinguish by first 32 bites and it is called magic number. Proper value of magic number is with suffix _MAGIC. Suffix _CIGAM means reversed bytes order. Both fields can occur in two types: 32 and 64 bytes. FAT field inform that this library contains few version of library (typically for different types version). It contains information where Mach-O headers starts. Each section started with Mach-O header contains one library (So if file starts with this field it contains only one version). After filed Mach-O there are section fields. Each of them starts with two fields: cmd - magic number for this command cmdsize - total size occupied by this section information. In this case only sections LC_VERSION_MIN_MACOSX (for macosx 10.13 and earlier) and LC_BUILD_VERSION (for macosx 10.14 and newer) are interesting, because them contains information about minimal system version. Important remarks: - For fat files this implementation looks for maximum number version. It not check if it is 32 or 64 and do not compare it with currently built package. So it is possible to false report higher version that needed. - All structures signatures are taken form macosx header files. - I think that binary format will be more stable than `otool` output. and if apple introduce some changes both implementation will need to be updated. - The system compile will set the deployment target no lower than 11.0 for arm64 builds. For "Universal 2" builds use the x86_64 deployment target when the arm64 target is 11.0. � )�annotationsN)�BufferedIOBase)� TYPE_CHECKING)�Unionl �:� l �~u} l �:� l �~u l �z�} l �m� l �z�} l �m� �$ �2 i �magic�cputypeZ cpusubtype�filetype�ncmdsZ sizeofcmds�flags�reserved� nfat_arch�offset�size�align�cmd�cmdsizeZsegname� ZvmaddrZvmsizeZfileoff�filesizeZmaxprotZinitprotZnsects�versionZsdk�platform�minosZntools�int)�x�returnc C s0 | d>