├── .clang-format ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── LICENSE ├── Podfile ├── Podfile.lock ├── Pods ├── AFNetworking │ ├── AFNetworking │ │ ├── AFHTTPRequestOperation.h │ │ ├── AFHTTPRequestOperation.m │ │ ├── AFHTTPRequestOperationManager.h │ │ ├── AFHTTPRequestOperationManager.m │ │ ├── AFHTTPSessionManager.h │ │ ├── AFHTTPSessionManager.m │ │ ├── AFNetworkReachabilityManager.h │ │ ├── AFNetworkReachabilityManager.m │ │ ├── AFNetworking.h │ │ ├── AFSecurityPolicy.h │ │ ├── AFSecurityPolicy.m │ │ ├── AFURLConnectionOperation.h │ │ ├── AFURLConnectionOperation.m │ │ ├── AFURLRequestSerialization.h │ │ ├── AFURLRequestSerialization.m │ │ ├── AFURLResponseSerialization.h │ │ ├── AFURLResponseSerialization.m │ │ ├── AFURLSessionManager.h │ │ └── AFURLSessionManager.m │ ├── LICENSE │ └── README.md ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj ├── SSZipArchive │ ├── LICENSE.txt │ ├── README.md │ └── SSZipArchive │ │ ├── SSZipArchive.h │ │ ├── SSZipArchive.m │ │ ├── SSZipCommon.h │ │ ├── ZipArchive.h │ │ └── minizip │ │ ├── mz.h │ │ ├── mz_compat.c │ │ ├── mz_compat.h │ │ ├── mz_crypt.c │ │ ├── mz_crypt.h │ │ ├── mz_crypt_apple.c │ │ ├── mz_os.c │ │ ├── mz_os.h │ │ ├── mz_os_posix.c │ │ ├── mz_strm.c │ │ ├── mz_strm.h │ │ ├── mz_strm_buf.c │ │ ├── mz_strm_buf.h │ │ ├── mz_strm_mem.c │ │ ├── mz_strm_mem.h │ │ ├── mz_strm_os.h │ │ ├── mz_strm_os_posix.c │ │ ├── mz_strm_pkcrypt.c │ │ ├── mz_strm_pkcrypt.h │ │ ├── mz_strm_split.c │ │ ├── mz_strm_split.h │ │ ├── mz_strm_wzaes.c │ │ ├── mz_strm_wzaes.h │ │ ├── mz_strm_zlib.c │ │ ├── mz_strm_zlib.h │ │ ├── mz_zip.c │ │ ├── mz_zip.h │ │ ├── mz_zip_rw.c │ │ └── mz_zip_rw.h └── Target Support Files │ ├── AFNetworking │ ├── AFNetworking-Info.plist │ ├── AFNetworking-dummy.m │ ├── AFNetworking-prefix.pch │ ├── AFNetworking-umbrella.h │ ├── AFNetworking.debug.xcconfig │ ├── AFNetworking.modulemap │ └── AFNetworking.release.xcconfig │ ├── Pods-Ramiel │ ├── Pods-Ramiel-Info.plist │ ├── Pods-Ramiel-acknowledgements.markdown │ ├── Pods-Ramiel-acknowledgements.plist │ ├── Pods-Ramiel-dummy.m │ ├── Pods-Ramiel-frameworks-Debug-input-files.xcfilelist │ ├── Pods-Ramiel-frameworks-Debug-output-files.xcfilelist │ ├── Pods-Ramiel-frameworks-Release-input-files.xcfilelist │ ├── Pods-Ramiel-frameworks-Release-output-files.xcfilelist │ ├── Pods-Ramiel-frameworks.sh │ ├── Pods-Ramiel-umbrella.h │ ├── Pods-Ramiel.debug.xcconfig │ ├── Pods-Ramiel.modulemap │ └── Pods-Ramiel.release.xcconfig │ └── SSZipArchive │ ├── SSZipArchive-Info.plist │ ├── SSZipArchive-dummy.m │ ├── SSZipArchive-prefix.pch │ ├── SSZipArchive-umbrella.h │ ├── SSZipArchive.debug.xcconfig │ ├── SSZipArchive.modulemap │ └── SSZipArchive.release.xcconfig ├── README.md ├── Ramiel.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ ├── IDEWorkspaceChecks.plist │ └── WorkspaceSettings.xcsettings ├── Ramiel.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ ├── IDEWorkspaceChecks.plist │ ├── WorkspaceSettings.xcsettings │ └── xcschemes │ └── Ramiel.xcscheme ├── Ramiel ├── APNonceSetterViewController.h ├── APNonceSetterViewController.m ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── 1024.png │ │ ├── 128.png │ │ ├── 16.png │ │ ├── 256.png │ │ ├── 32.png │ │ ├── 512.png │ │ ├── 64.png │ │ └── Contents.json │ ├── Contents.json │ └── image.imageset │ │ ├── Contents.json │ │ └── image.png ├── Base.lproj │ └── Main.storyboard ├── CreditsViewController.h ├── CreditsViewController.m ├── DependenciesViewController.h ├── DependenciesViewController.m ├── Device.h ├── Device.m ├── Exploits │ ├── Fugu │ │ └── .keep │ ├── eclipsa7000 │ ├── eclipsa7001 │ ├── eclipsa8000 │ ├── eclipsa8003 │ └── iPwnder32 ├── FileMDHash.c ├── FileMDHash.h ├── FirmwareKeys.h ├── FirmwareKeys.m ├── IPSW.h ├── IPSW.m ├── Info.plist ├── Ramiel.entitlements ├── RamielRelease.entitlements ├── RamielView.h ├── RamielView.m ├── SHSHDumperViewController.h ├── SHSHDumperViewController.m ├── SHSHViewController.h ├── SHSHViewController.m ├── SettingsView.h ├── SettingsView.m ├── bootlogo.im4p ├── iPatcher ├── main.m ├── partial.c ├── partial.h ├── shsh │ ├── 0x7000.shsh │ ├── 0x7001.shsh │ ├── 0x8000.shsh │ ├── 0x8003.shsh │ ├── 0x8010.shsh │ ├── 0x8011.shsh │ ├── 0x8015.shsh │ └── shsh.shsh └── ssh │ ├── Kernel64Patcher │ ├── Kernel64PatcherA │ ├── Kernel64PatcherB │ ├── compare.py │ ├── dd_ent.xml │ ├── dump.py │ ├── ent.xml │ ├── gtar │ ├── iproxy │ ├── kc.bpatch │ ├── ldid2 │ └── sshLogo.im4p ├── formatCode.sh ├── ibootim ├── ibootim.c ├── ibootim.h ├── ibootimMain.h ├── ibootim_LICENSE ├── ibootimmain.c ├── lzss.c └── lzss.h ├── images ├── Project.png ├── dylibs.png └── selection.png └── kairos ├── .gitignore ├── README.md ├── decoders.c ├── include ├── decoders.h ├── instructions.h ├── mac_policy.h ├── mach-o_loader.h ├── mach-o_nlist.h ├── newpatch.h └── patchfinder64.h ├── instructions.c ├── kairos.c ├── kairos.h ├── kairos_LICENSE ├── newpatch.c └── patchfinder64.c /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: LLVM 2 | AllowShortIfStatementsOnASingleLine: false 3 | AllowShortBlocksOnASingleLine: false 4 | AllowShortFunctionsOnASingleLine: false 5 | AllowShortLoopsOnASingleLine: false 6 | AlwaysBreakBeforeMultilineStrings: false 7 | IndentCaseLabels: true 8 | ColumnLimit: 120 9 | ObjCSpaceAfterProperty: true 10 | ObjCSpaceBeforeProtocolList: true 11 | KeepEmptyLinesAtTheStartOfBlocks: true 12 | PenaltyBreakString: 1000000 13 | SpacesInContainerLiterals: false 14 | ObjCBlockIndentWidth: 4 15 | UseTab: Never 16 | IndentWidth: 4 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a bug report to help me easily figure out the issue 4 | title: "[Bug]" 5 | labels: bug, help wanted 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - macOS Version: [e.g. 10.15.2] 28 | - Machine Model: [e.g. 2020 Macbook Pro] 29 | 30 | **iOS/iPadOS Device(please complete the following information):** 31 | - Model: [e.g. iPhone10,3] 32 | - iOS Version Being Booted: [e.g. iOS 14.4] 33 | - Dualbooted: [e.g. Y/N] 34 | 35 | **Additional context** 36 | Add any other context about the problem here. 37 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for Ramiel 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Compile_Release.sh 2 | .DS_Store 3 | 4 | # Xcode 5 | # 6 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 7 | 8 | ## User settings 9 | xcuserdata/ 10 | 11 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 12 | *.xcscmblueprint 13 | *.xccheckout 14 | 15 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 16 | build/ 17 | DerivedData/ 18 | *.moved-aside 19 | *.pbxuser 20 | !default.pbxuser 21 | *.mode1v3 22 | !default.mode1v3 23 | *.mode2v3 24 | !default.mode2v3 25 | *.perspectivev3 26 | !default.perspectivev3 27 | 28 | ## Obj-C/Swift specific 29 | *.hmap 30 | 31 | ## App packaging 32 | *.ipa 33 | *.dSYM.zip 34 | *.dSYM 35 | *.app 36 | *.xcarchive 37 | # CocoaPods 38 | # 39 | # We recommend against adding the Pods directory to your .gitignore. However 40 | # you should judge for yourself, the pros and cons are mentioned at: 41 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 42 | # 43 | # Pods/ 44 | # 45 | # Add this line if you want to avoid checking in source code from the Xcode workspace 46 | # *.xcworkspace 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build/ 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. 58 | # Instead, use fastlane to re-generate the screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots/**/*.png 65 | fastlane/test_output 66 | 67 | # Code Injection 68 | # 69 | # After new code Injection tools there's a generated folder /iOSInjectionProject 70 | # https://github.com/johnno1962/injectionforxcode 71 | 72 | iOSInjectionProject/ 73 | .irecovery 74 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :macos, '10.13' 3 | 4 | target 'Ramiel' do 5 | # Comment the next line if you don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for Ramiel 9 | pod 'AFNetworking', '~> 2.0' 10 | pod 'SSZipArchive' 11 | end 12 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (2.7.0): 3 | - AFNetworking/NSURLConnection (= 2.7.0) 4 | - AFNetworking/NSURLSession (= 2.7.0) 5 | - AFNetworking/Reachability (= 2.7.0) 6 | - AFNetworking/Security (= 2.7.0) 7 | - AFNetworking/Serialization (= 2.7.0) 8 | - AFNetworking/UIKit (= 2.7.0) 9 | - AFNetworking/NSURLConnection (2.7.0): 10 | - AFNetworking/Reachability 11 | - AFNetworking/Security 12 | - AFNetworking/Serialization 13 | - AFNetworking/NSURLSession (2.7.0): 14 | - AFNetworking/Reachability 15 | - AFNetworking/Security 16 | - AFNetworking/Serialization 17 | - AFNetworking/Reachability (2.7.0) 18 | - AFNetworking/Security (2.7.0) 19 | - AFNetworking/Serialization (2.7.0) 20 | - SSZipArchive (2.2.3) 21 | 22 | DEPENDENCIES: 23 | - AFNetworking (~> 2.0) 24 | - SSZipArchive 25 | 26 | SPEC REPOS: 27 | trunk: 28 | - AFNetworking 29 | - SSZipArchive 30 | 31 | SPEC CHECKSUMS: 32 | AFNetworking: 8dd5f9b9691e09186393069a12cc3b5ed7c8b511 33 | SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9 34 | 35 | PODFILE CHECKSUM: f10aeaad7e1dd6a2c1d0e03a8d3f0b1892cbf35d 36 | 37 | COCOAPODS: 1.10.1 38 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h: -------------------------------------------------------------------------------- 1 | // AFHTTPRequestOperation.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | #import "AFURLConnectionOperation.h" 24 | 25 | NS_ASSUME_NONNULL_BEGIN 26 | 27 | /** 28 | `AFHTTPRequestOperation` is a subclass of `AFURLConnectionOperation` for requests using the HTTP or HTTPS protocols. It encapsulates the concept of acceptable status codes and content types, which determine the success or failure of a request. 29 | */ 30 | @interface AFHTTPRequestOperation : AFURLConnectionOperation 31 | 32 | ///------------------------------------------------ 33 | /// @name Getting HTTP URL Connection Information 34 | ///------------------------------------------------ 35 | 36 | /** 37 | The last HTTP response received by the operation's connection. 38 | */ 39 | @property (readonly, nonatomic, strong, nullable) NSHTTPURLResponse *response; 40 | 41 | /** 42 | Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an AFHTTPResponse serializer, which uses the raw data as its response object. The serializer validates the status code to be in the `2XX` range, denoting success. If the response serializer generates an error in `-responseObjectForResponse:data:error:`, the `failure` callback of the session task or request operation will be executed; otherwise, the `success` callback will be executed. 43 | 44 | @warning `responseSerializer` must not be `nil`. Setting a response serializer will clear out any cached value 45 | */ 46 | @property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; 47 | 48 | /** 49 | An object constructed by the `responseSerializer` from the response and response data. Returns `nil` unless the operation `isFinished`, has a `response`, and has `responseData` with non-zero content length. If an error occurs during serialization, `nil` will be returned, and the `error` property will be populated with the serialization error. 50 | */ 51 | @property (readonly, nonatomic, strong, nullable) id responseObject; 52 | 53 | ///----------------------------------------------------------- 54 | /// @name Setting Completion Block Success / Failure Callbacks 55 | ///----------------------------------------------------------- 56 | 57 | /** 58 | Sets the `completionBlock` property with a block that executes either the specified success or failure block, depending on the state of the request on completion. If `error` returns a value, which can be caused by an unacceptable status code or content type, then `failure` is executed. Otherwise, `success` is executed. 59 | 60 | This method should be overridden in subclasses in order to specify the response object passed into the success block. 61 | 62 | @param success The block to be executed on the completion of a successful request. This block has no return value and takes two arguments: the receiver operation and the object constructed from the response data of the request. 63 | @param failure The block to be executed on the completion of an unsuccessful request. This block has no return value and takes two arguments: the receiver operation and the error that occurred during the request. 64 | */ 65 | - (void)setCompletionBlockWithSuccess:(nullable void (^)(AFHTTPRequestOperation *operation, id __nullable responseObject))success 66 | failure:(nullable void (^)(AFHTTPRequestOperation *operation, NSError *error))failure; 67 | 68 | @end 69 | 70 | NS_ASSUME_NONNULL_END 71 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.m: -------------------------------------------------------------------------------- 1 | // AFHTTPRequestOperation.m 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import "AFHTTPRequestOperation.h" 23 | 24 | static dispatch_queue_t http_request_operation_processing_queue() { 25 | static dispatch_queue_t af_http_request_operation_processing_queue; 26 | static dispatch_once_t onceToken; 27 | dispatch_once(&onceToken, ^{ 28 | af_http_request_operation_processing_queue = dispatch_queue_create("com.alamofire.networking.http-request.processing", DISPATCH_QUEUE_CONCURRENT); 29 | }); 30 | 31 | return af_http_request_operation_processing_queue; 32 | } 33 | 34 | static dispatch_group_t http_request_operation_completion_group() { 35 | static dispatch_group_t af_http_request_operation_completion_group; 36 | static dispatch_once_t onceToken; 37 | dispatch_once(&onceToken, ^{ 38 | af_http_request_operation_completion_group = dispatch_group_create(); 39 | }); 40 | 41 | return af_http_request_operation_completion_group; 42 | } 43 | 44 | #pragma mark - 45 | 46 | @interface AFURLConnectionOperation () 47 | @property (readwrite, nonatomic, strong) NSURLRequest *request; 48 | @property (readwrite, nonatomic, strong) NSURLResponse *response; 49 | @end 50 | 51 | @interface AFHTTPRequestOperation () 52 | @property (readwrite, nonatomic, strong) NSHTTPURLResponse *response; 53 | @property (readwrite, nonatomic, strong, nullable) id responseObject; 54 | @property (readwrite, nonatomic, strong) NSError *responseSerializationError; 55 | @property (readwrite, nonatomic, strong) NSRecursiveLock *lock; 56 | @end 57 | 58 | @implementation AFHTTPRequestOperation 59 | @dynamic response; 60 | @dynamic lock; 61 | 62 | - (instancetype)initWithRequest:(NSURLRequest *)urlRequest { 63 | self = [super initWithRequest:urlRequest]; 64 | if (!self) { 65 | return nil; 66 | } 67 | 68 | self.responseSerializer = [AFHTTPResponseSerializer serializer]; 69 | 70 | return self; 71 | } 72 | 73 | - (void)setResponseSerializer:(AFHTTPResponseSerializer *)responseSerializer { 74 | NSParameterAssert(responseSerializer); 75 | 76 | [self.lock lock]; 77 | _responseSerializer = responseSerializer; 78 | self.responseObject = nil; 79 | self.responseSerializationError = nil; 80 | [self.lock unlock]; 81 | } 82 | 83 | - (id)responseObject { 84 | [self.lock lock]; 85 | if (!_responseObject && [self isFinished] && !self.error) { 86 | NSError *error = nil; 87 | self.responseObject = [self.responseSerializer responseObjectForResponse:self.response data:self.responseData error:&error]; 88 | if (error) { 89 | self.responseSerializationError = error; 90 | } 91 | } 92 | [self.lock unlock]; 93 | 94 | return _responseObject; 95 | } 96 | 97 | - (NSError *)error { 98 | if (_responseSerializationError) { 99 | return _responseSerializationError; 100 | } else { 101 | return [super error]; 102 | } 103 | } 104 | 105 | #pragma mark - AFHTTPRequestOperation 106 | 107 | - (void)setCompletionBlockWithSuccess:(void (^)(AFHTTPRequestOperation *operation, id __nullable responseObject))success 108 | failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure 109 | { 110 | // completionBlock is manually nilled out in AFURLConnectionOperation to break the retain cycle. 111 | #pragma clang diagnostic push 112 | #pragma clang diagnostic ignored "-Warc-retain-cycles" 113 | #pragma clang diagnostic ignored "-Wgnu" 114 | self.completionBlock = ^{ 115 | if (self.completionGroup) { 116 | dispatch_group_enter(self.completionGroup); 117 | } 118 | 119 | dispatch_async(http_request_operation_processing_queue(), ^{ 120 | if (self.error) { 121 | if (failure) { 122 | dispatch_group_async(self.completionGroup ?: http_request_operation_completion_group(), self.completionQueue ?: dispatch_get_main_queue(), ^{ 123 | failure(self, self.error); 124 | }); 125 | } 126 | } else { 127 | id responseObject = self.responseObject; 128 | if (self.error) { 129 | if (failure) { 130 | dispatch_group_async(self.completionGroup ?: http_request_operation_completion_group(), self.completionQueue ?: dispatch_get_main_queue(), ^{ 131 | failure(self, self.error); 132 | }); 133 | } 134 | } else { 135 | if (success) { 136 | dispatch_group_async(self.completionGroup ?: http_request_operation_completion_group(), self.completionQueue ?: dispatch_get_main_queue(), ^{ 137 | success(self, responseObject); 138 | }); 139 | } 140 | } 141 | } 142 | 143 | if (self.completionGroup) { 144 | dispatch_group_leave(self.completionGroup); 145 | } 146 | }); 147 | }; 148 | #pragma clang diagnostic pop 149 | } 150 | 151 | #pragma mark - AFURLRequestOperation 152 | 153 | - (void)pause { 154 | [super pause]; 155 | 156 | u_int64_t offset = 0; 157 | if ([self.outputStream propertyForKey:NSStreamFileCurrentOffsetKey]) { 158 | offset = [(NSNumber *)[self.outputStream propertyForKey:NSStreamFileCurrentOffsetKey] unsignedLongLongValue]; 159 | } else { 160 | offset = [(NSData *)[self.outputStream propertyForKey:NSStreamDataWrittenToMemoryStreamKey] length]; 161 | } 162 | 163 | NSMutableURLRequest *mutableURLRequest = [self.request mutableCopy]; 164 | if ([self.response respondsToSelector:@selector(allHeaderFields)] && [[self.response allHeaderFields] valueForKey:@"ETag"]) { 165 | [mutableURLRequest setValue:[[self.response allHeaderFields] valueForKey:@"ETag"] forHTTPHeaderField:@"If-Range"]; 166 | } 167 | [mutableURLRequest setValue:[NSString stringWithFormat:@"bytes=%llu-", offset] forHTTPHeaderField:@"Range"]; 168 | self.request = mutableURLRequest; 169 | } 170 | 171 | #pragma mark - NSSecureCoding 172 | 173 | + (BOOL)supportsSecureCoding { 174 | return YES; 175 | } 176 | 177 | - (id)initWithCoder:(NSCoder *)decoder { 178 | self = [super initWithCoder:decoder]; 179 | if (!self) { 180 | return nil; 181 | } 182 | 183 | self.responseSerializer = [decoder decodeObjectOfClass:[AFHTTPResponseSerializer class] forKey:NSStringFromSelector(@selector(responseSerializer))]; 184 | 185 | return self; 186 | } 187 | 188 | - (void)encodeWithCoder:(NSCoder *)coder { 189 | [super encodeWithCoder:coder]; 190 | 191 | [coder encodeObject:self.responseSerializer forKey:NSStringFromSelector(@selector(responseSerializer))]; 192 | } 193 | 194 | #pragma mark - NSCopying 195 | 196 | - (id)copyWithZone:(NSZone *)zone { 197 | AFHTTPRequestOperation *operation = [super copyWithZone:zone]; 198 | 199 | operation.responseSerializer = [self.responseSerializer copyWithZone:zone]; 200 | operation.completionQueue = self.completionQueue; 201 | operation.completionGroup = self.completionGroup; 202 | 203 | return operation; 204 | } 205 | 206 | @end 207 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFNetworking.h: -------------------------------------------------------------------------------- 1 | // AFNetworking.h 2 | // 3 | // Copyright (c) 2013 AFNetworking (http://afnetworking.com/) 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #import 24 | #import 25 | 26 | #ifndef _AFNETWORKING_ 27 | #define _AFNETWORKING_ 28 | 29 | #import "AFURLRequestSerialization.h" 30 | #import "AFURLResponseSerialization.h" 31 | #import "AFSecurityPolicy.h" 32 | #if !TARGET_OS_WATCH 33 | #import "AFNetworkReachabilityManager.h" 34 | #import "AFURLConnectionOperation.h" 35 | #import "AFHTTPRequestOperation.h" 36 | #import "AFHTTPRequestOperationManager.h" 37 | #endif 38 | 39 | #if ( ( defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 1090) || \ 40 | ( defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 ) || \ 41 | TARGET_OS_WATCH ) 42 | #import "AFURLSessionManager.h" 43 | #import "AFHTTPSessionManager.h" 44 | #endif 45 | 46 | #endif /* _AFNETWORKING_ */ 47 | -------------------------------------------------------------------------------- /Pods/AFNetworking/AFNetworking/AFSecurityPolicy.h: -------------------------------------------------------------------------------- 1 | // AFSecurityPolicy.h 2 | // Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files (the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in 12 | // all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | // THE SOFTWARE. 21 | 22 | #import 23 | #import 24 | 25 | typedef NS_ENUM(NSUInteger, AFSSLPinningMode) { 26 | AFSSLPinningModeNone, 27 | AFSSLPinningModePublicKey, 28 | AFSSLPinningModeCertificate, 29 | }; 30 | 31 | /** 32 | `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections. 33 | 34 | Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled. 35 | */ 36 | 37 | NS_ASSUME_NONNULL_BEGIN 38 | 39 | @interface AFSecurityPolicy : NSObject 40 | 41 | /** 42 | The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`. 43 | */ 44 | @property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode; 45 | 46 | /** 47 | The certificates used to evaluate server trust according to the SSL pinning mode. By default, this property is set to any (`.cer`) certificates included in the app bundle. Note that if you create an array with duplicate certificates, the duplicate certificates will be removed. Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches. 48 | */ 49 | @property (nonatomic, strong, nullable) NSArray *pinnedCertificates; 50 | 51 | /** 52 | Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`. 53 | */ 54 | @property (nonatomic, assign) BOOL allowInvalidCertificates; 55 | 56 | /** 57 | Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`. 58 | */ 59 | @property (nonatomic, assign) BOOL validatesDomainName; 60 | 61 | ///----------------------------------------- 62 | /// @name Getting Specific Security Policies 63 | ///----------------------------------------- 64 | 65 | /** 66 | Returns the shared default security policy, which does not allow invalid certificates, validates domain name, and does not validate against pinned certificates or public keys. 67 | 68 | @return The default security policy. 69 | */ 70 | + (instancetype)defaultPolicy; 71 | 72 | ///--------------------- 73 | /// @name Initialization 74 | ///--------------------- 75 | 76 | /** 77 | Creates and returns a security policy with the specified pinning mode. 78 | 79 | @param pinningMode The SSL pinning mode. 80 | 81 | @return A new security policy. 82 | */ 83 | + (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode; 84 | 85 | ///------------------------------ 86 | /// @name Evaluating Server Trust 87 | ///------------------------------ 88 | 89 | /** 90 | Whether or not the specified server trust should be accepted, based on the security policy. 91 | 92 | This method should be used when responding to an authentication challenge from a server. 93 | 94 | @param serverTrust The X.509 certificate trust of the server. 95 | 96 | @return Whether or not to trust the server. 97 | 98 | @warning This method has been deprecated in favor of `-evaluateServerTrust:forDomain:`. 99 | */ 100 | - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust DEPRECATED_ATTRIBUTE; 101 | 102 | /** 103 | Whether or not the specified server trust should be accepted, based on the security policy. 104 | 105 | This method should be used when responding to an authentication challenge from a server. 106 | 107 | @param serverTrust The X.509 certificate trust of the server. 108 | @param domain The domain of serverTrust. If `nil`, the domain will not be validated. 109 | 110 | @return Whether or not to trust the server. 111 | */ 112 | - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust 113 | forDomain:(nullable NSString *)domain; 114 | 115 | @end 116 | 117 | NS_ASSUME_NONNULL_END 118 | 119 | ///---------------- 120 | /// @name Constants 121 | ///---------------- 122 | 123 | /** 124 | ## SSL Pinning Modes 125 | 126 | The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes. 127 | 128 | enum { 129 | AFSSLPinningModeNone, 130 | AFSSLPinningModePublicKey, 131 | AFSSLPinningModeCertificate, 132 | } 133 | 134 | `AFSSLPinningModeNone` 135 | Do not used pinned certificates to validate servers. 136 | 137 | `AFSSLPinningModePublicKey` 138 | Validate host certificates against public keys of pinned certificates. 139 | 140 | `AFSSLPinningModeCertificate` 141 | Validate host certificates against pinned certificates. 142 | */ 143 | -------------------------------------------------------------------------------- /Pods/AFNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (2.7.0): 3 | - AFNetworking/NSURLConnection (= 2.7.0) 4 | - AFNetworking/NSURLSession (= 2.7.0) 5 | - AFNetworking/Reachability (= 2.7.0) 6 | - AFNetworking/Security (= 2.7.0) 7 | - AFNetworking/Serialization (= 2.7.0) 8 | - AFNetworking/UIKit (= 2.7.0) 9 | - AFNetworking/NSURLConnection (2.7.0): 10 | - AFNetworking/Reachability 11 | - AFNetworking/Security 12 | - AFNetworking/Serialization 13 | - AFNetworking/NSURLSession (2.7.0): 14 | - AFNetworking/Reachability 15 | - AFNetworking/Security 16 | - AFNetworking/Serialization 17 | - AFNetworking/Reachability (2.7.0) 18 | - AFNetworking/Security (2.7.0) 19 | - AFNetworking/Serialization (2.7.0) 20 | - SSZipArchive (2.2.3) 21 | 22 | DEPENDENCIES: 23 | - AFNetworking (~> 2.0) 24 | - SSZipArchive 25 | 26 | SPEC REPOS: 27 | trunk: 28 | - AFNetworking 29 | - SSZipArchive 30 | 31 | SPEC CHECKSUMS: 32 | AFNetworking: 8dd5f9b9691e09186393069a12cc3b5ed7c8b511 33 | SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9 34 | 35 | PODFILE CHECKSUM: f10aeaad7e1dd6a2c1d0e03a8d3f0b1892cbf35d 36 | 37 | COCOAPODS: 1.10.1 38 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2015, Sam Soffes, https://soff.es 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/README.md: -------------------------------------------------------------------------------- 1 | 2 | [![Build Status](https://travis-ci.org/ZipArchive/ZipArchive.svg?branch=master)](https://travis-ci.org/ZipArchive/ZipArchive) 3 | 4 | # SSZipArchive 5 | 6 | ZipArchive is a simple utility class for zipping and unzipping files on iOS, macOS and tvOS. 7 | 8 | - Unzip zip files; 9 | - Unzip password protected zip files; 10 | - Unzip AES encrypted zip files; 11 | - Create zip files; 12 | - Create password protected zip files; 13 | - Create AES encrypted zip files; 14 | - Choose compression level; 15 | - Zip-up NSData instances. (with a filename) 16 | 17 | ## Installation and Setup 18 | 19 | *The main release branch is configured to support Objective-C and Swift 3+.* 20 | 21 | SSZipArchive works on Xcode 7-11 and above, iOS 9-13 and above, tvOS 9 and above, macOS 10.8-10.15 and above, watchOS 2 and above. 22 | 23 | ### CocoaPods 24 | In your Podfile: 25 | `pod 'SSZipArchive'` 26 | 27 | You should define your minimum deployment target explicitly, like: 28 | `platform :ios, '9.0'` 29 | 30 | Recommended CocoaPods version should be at least CocoaPods 1.7.5. 31 | 32 | ### Carthage 33 | In your Cartfile: 34 | `github "ZipArchive/ZipArchive"` 35 | 36 | ### Manual 37 | 38 | 1. Add the `SSZipArchive` and `minizip` folders to your project. 39 | 2. Add the `libz` and `libiconv` libraries to your target. 40 | 3. Add the `Security` framework to your target. 41 | 4. Add the following GCC_PREPROCESSOR_DEFINITIONS: `HAVE_INTTYPES_H HAVE_PKCRYPT HAVE_STDINT_H HAVE_WZAES HAVE_ZLIB $(inherited)`. 42 | 43 | SSZipArchive requires ARC. 44 | 45 | ## Usage 46 | 47 | ### Objective-C 48 | 49 | ```objective-c 50 | // Create 51 | [SSZipArchive createZipFileAtPath:zipPath withContentsOfDirectory:sampleDataPath]; 52 | 53 | // Unzip 54 | [SSZipArchive unzipFileAtPath:zipPath toDestination:unzipPath]; 55 | ``` 56 | 57 | ### Swift 58 | 59 | ```swift 60 | // Create 61 | SSZipArchive.createZipFileAtPath(zipPath, withContentsOfDirectory: sampleDataPath) 62 | 63 | // Unzip 64 | SSZipArchive.unzipFileAtPath(zipPath, toDestination: unzipPath) 65 | ``` 66 | 67 | ## License 68 | 69 | SSZipArchive is protected under the [MIT license](https://github.com/samsoffes/ssziparchive/raw/master/LICENSE) and our slightly modified version of [Minizip](https://github.com/nmoinvaz/minizip) 1.2 is licensed under the [Zlib license](https://www.zlib.net/zlib_license.html). 70 | 71 | ## Acknowledgments 72 | 73 | * Big thanks to *aish* for creating [ZipArchive](https://code.google.com/archive/p/ziparchive/). The project that inspired SSZipArchive. 74 | * Thank you [@soffes](https://github.com/soffes) for the actual name of SSZipArchive. 75 | * Thank you [@randomsequence](https://github.com/randomsequence) for implementing the creation support tech. 76 | * Thank you [@johnezang](https://github.com/johnezang) for all his amazing help along the way. 77 | * Thank you [@nmoinvaz](https://github.com/nmoinvaz) for minizip, the core of ZipArchive. 78 | * Thank you to [all the contributors](https://github.com/ZipArchive/ZipArchive/graphs/contributors). 79 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/SSZipArchive.h: -------------------------------------------------------------------------------- 1 | // 2 | // SSZipArchive.h 3 | // SSZipArchive 4 | // 5 | // Created by Sam Soffes on 7/21/10. 6 | // Copyright (c) Sam Soffes 2010-2015. All rights reserved. 7 | // 8 | 9 | #ifndef _SSZIPARCHIVE_H 10 | #define _SSZIPARCHIVE_H 11 | 12 | #import 13 | #include "SSZipCommon.h" 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | extern NSString *const SSZipArchiveErrorDomain; 18 | typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) { 19 | SSZipArchiveErrorCodeFailedOpenZipFile = -1, 20 | SSZipArchiveErrorCodeFailedOpenFileInZip = -2, 21 | SSZipArchiveErrorCodeFileInfoNotLoadable = -3, 22 | SSZipArchiveErrorCodeFileContentNotReadable = -4, 23 | SSZipArchiveErrorCodeFailedToWriteFile = -5, 24 | SSZipArchiveErrorCodeInvalidArguments = -6, 25 | }; 26 | 27 | @protocol SSZipArchiveDelegate; 28 | 29 | @interface SSZipArchive : NSObject 30 | 31 | // Password check 32 | + (BOOL)isFilePasswordProtectedAtPath:(NSString *)path; 33 | + (BOOL)isPasswordValidForArchiveAtPath:(NSString *)path password:(NSString *)pw error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NOTHROW; 34 | 35 | // Total payload size 36 | + (NSNumber *)payloadSizeForArchiveAtPath:(NSString *)path error:(NSError **)error; 37 | 38 | // Unzip 39 | + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination; 40 | + (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(nullable id)delegate; 41 | 42 | + (BOOL)unzipFileAtPath:(NSString *)path 43 | toDestination:(NSString *)destination 44 | overwrite:(BOOL)overwrite 45 | password:(nullable NSString *)password 46 | error:(NSError * *)error; 47 | 48 | + (BOOL)unzipFileAtPath:(NSString *)path 49 | toDestination:(NSString *)destination 50 | overwrite:(BOOL)overwrite 51 | password:(nullable NSString *)password 52 | error:(NSError * *)error 53 | delegate:(nullable id)delegate NS_REFINED_FOR_SWIFT; 54 | 55 | + (BOOL)unzipFileAtPath:(NSString *)path 56 | toDestination:(NSString *)destination 57 | preserveAttributes:(BOOL)preserveAttributes 58 | overwrite:(BOOL)overwrite 59 | password:(nullable NSString *)password 60 | error:(NSError * *)error 61 | delegate:(nullable id)delegate; 62 | 63 | + (BOOL)unzipFileAtPath:(NSString *)path 64 | toDestination:(NSString *)destination 65 | progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler 66 | completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler; 67 | 68 | + (BOOL)unzipFileAtPath:(NSString *)path 69 | toDestination:(NSString *)destination 70 | overwrite:(BOOL)overwrite 71 | password:(nullable NSString *)password 72 | progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler 73 | completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler; 74 | 75 | + (BOOL)unzipFileAtPath:(NSString *)path 76 | toDestination:(NSString *)destination 77 | preserveAttributes:(BOOL)preserveAttributes 78 | overwrite:(BOOL)overwrite 79 | nestedZipLevel:(NSInteger)nestedZipLevel 80 | password:(nullable NSString *)password 81 | error:(NSError **)error 82 | delegate:(nullable id)delegate 83 | progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler 84 | completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler; 85 | 86 | // Zip 87 | // default compression level is Z_DEFAULT_COMPRESSION (from "zlib.h") 88 | // keepParentDirectory: if YES, then unzipping will give `directoryName/fileName`. If NO, then unzipping will just give `fileName`. Default is NO. 89 | 90 | // without password 91 | + (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths; 92 | + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath; 93 | 94 | + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory; 95 | 96 | // with optional password, default encryption is AES 97 | // don't use AES if you need compatibility with native macOS unzip and Archive Utility 98 | + (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(nullable NSString *)password; 99 | + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password; 100 | + (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password; 101 | + (BOOL)createZipFileAtPath:(NSString *)path 102 | withContentsOfDirectory:(NSString *)directoryPath 103 | keepParentDirectory:(BOOL)keepParentDirectory 104 | withPassword:(nullable NSString *)password 105 | andProgressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler; 106 | + (BOOL)createZipFileAtPath:(NSString *)path 107 | withContentsOfDirectory:(NSString *)directoryPath 108 | keepParentDirectory:(BOOL)keepParentDirectory 109 | compressionLevel:(int)compressionLevel 110 | password:(nullable NSString *)password 111 | AES:(BOOL)aes 112 | progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler; 113 | 114 | - (instancetype)init NS_UNAVAILABLE; 115 | - (instancetype)initWithPath:(NSString *)path NS_DESIGNATED_INITIALIZER; 116 | - (BOOL)open; 117 | 118 | /// write empty folder 119 | - (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password; 120 | /// write file 121 | - (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password; 122 | - (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password; 123 | - (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes; 124 | /// write data 125 | - (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password; 126 | - (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes; 127 | 128 | - (BOOL)close; 129 | 130 | @end 131 | 132 | @protocol SSZipArchiveDelegate 133 | 134 | @optional 135 | 136 | - (void)zipArchiveWillUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo; 137 | - (void)zipArchiveDidUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo unzippedPath:(NSString *)unzippedPath; 138 | 139 | - (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; 140 | - (void)zipArchiveWillUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; 141 | - (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; 142 | - (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath unzippedFilePath:(NSString *)unzippedFilePath; 143 | 144 | - (void)zipArchiveProgressEvent:(unsigned long long)loaded total:(unsigned long long)total; 145 | 146 | @end 147 | 148 | NS_ASSUME_NONNULL_END 149 | 150 | #endif /* _SSZIPARCHIVE_H */ 151 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/SSZipCommon.h: -------------------------------------------------------------------------------- 1 | #ifndef SSZipCommon 2 | #define SSZipCommon 3 | 4 | // typedefs moved from mz_compat.h to here for public access 5 | 6 | /* unz_global_info structure contain global data about the ZIPfile 7 | These data comes from the end of central dir */ 8 | typedef struct unz_global_info64_s 9 | { 10 | uint64_t number_entry; /* total number of entries in the central dir on this disk */ 11 | uint32_t number_disk_with_CD; /* number the the disk with central dir, used for spanning ZIP */ 12 | uint16_t size_comment; /* size of the global comment of the zipfile */ 13 | } unz_global_info64; 14 | 15 | typedef struct unz_global_info_s 16 | { 17 | uint32_t number_entry; /* total number of entries in the central dir on this disk */ 18 | uint32_t number_disk_with_CD; /* number the the disk with central dir, used for spanning ZIP */ 19 | uint16_t size_comment; /* size of the global comment of the zipfile */ 20 | } unz_global_info; 21 | 22 | /* unz_file_info contain information about a file in the zipfile */ 23 | /* https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT */ 24 | typedef struct unz_file_info64_s 25 | { 26 | uint16_t version; /* version made by 2 bytes */ 27 | uint16_t version_needed; /* version needed to extract 2 bytes */ 28 | uint16_t flag; /* general purpose bit flag 2 bytes */ 29 | uint16_t compression_method; /* compression method 2 bytes */ 30 | uint32_t dos_date; /* last mod file date in Dos fmt 4 bytes */ 31 | uint32_t crc; /* crc-32 4 bytes */ 32 | uint64_t compressed_size; /* compressed size 8 bytes */ 33 | uint64_t uncompressed_size; /* uncompressed size 8 bytes */ 34 | uint16_t size_filename; /* filename length 2 bytes */ 35 | uint16_t size_file_extra; /* extra field length 2 bytes */ 36 | uint16_t size_file_comment; /* file comment length 2 bytes */ 37 | 38 | uint32_t disk_num_start; /* disk number start 4 bytes */ 39 | uint16_t internal_fa; /* internal file attributes 2 bytes */ 40 | uint32_t external_fa; /* external file attributes 4 bytes */ 41 | 42 | uint64_t disk_offset; 43 | 44 | uint16_t size_file_extra_internal; 45 | } unz_file_info64; 46 | 47 | typedef struct unz_file_info_s 48 | { 49 | uint16_t version; /* version made by 2 bytes */ 50 | uint16_t version_needed; /* version needed to extract 2 bytes */ 51 | uint16_t flag; /* general purpose bit flag 2 bytes */ 52 | uint16_t compression_method; /* compression method 2 bytes */ 53 | uint32_t dos_date; /* last mod file date in Dos fmt 4 bytes */ 54 | uint32_t crc; /* crc-32 4 bytes */ 55 | uint32_t compressed_size; /* compressed size 4 bytes */ 56 | uint32_t uncompressed_size; /* uncompressed size 4 bytes */ 57 | uint16_t size_filename; /* filename length 2 bytes */ 58 | uint16_t size_file_extra; /* extra field length 2 bytes */ 59 | uint16_t size_file_comment; /* file comment length 2 bytes */ 60 | 61 | uint16_t disk_num_start; /* disk number start 2 bytes */ 62 | uint16_t internal_fa; /* internal file attributes 2 bytes */ 63 | uint32_t external_fa; /* external file attributes 4 bytes */ 64 | 65 | uint64_t disk_offset; 66 | } unz_file_info; 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/ZipArchive.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZipArchive.h 3 | // ZipArchive 4 | // 5 | // Created by Serhii Mumriak on 12/1/15. 6 | // Copyright © 2015 smumryak. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for ZipArchive. 12 | FOUNDATION_EXPORT double ZipArchiveVersionNumber; 13 | 14 | //! Project version string for ZipArchive. 15 | FOUNDATION_EXPORT const unsigned char ZipArchiveVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | #import "SSZipArchive.h" 20 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/mz.h: -------------------------------------------------------------------------------- 1 | /* mz.h -- Errors codes, zip flags and magic 2 | Version 2.9.2, February 12, 2020 3 | part of the MiniZip project 4 | 5 | Copyright (C) 2010-2020 Nathan Moinvaziri 6 | https://github.com/nmoinvaz/minizip 7 | 8 | This program is distributed under the terms of the same license as zlib. 9 | See the accompanying LICENSE file for the full text of the license. 10 | */ 11 | 12 | #ifndef MZ_H 13 | #define MZ_H 14 | 15 | /***************************************************************************/ 16 | 17 | /* MZ_VERSION */ 18 | #define MZ_VERSION ("2.9.2") 19 | 20 | /* MZ_ERROR */ 21 | #define MZ_OK (0) /* zlib */ 22 | #define MZ_STREAM_ERROR (-1) /* zlib */ 23 | #define MZ_DATA_ERROR (-3) /* zlib */ 24 | #define MZ_MEM_ERROR (-4) /* zlib */ 25 | #define MZ_BUF_ERROR (-5) /* zlib */ 26 | #define MZ_VERSION_ERROR (-6) /* zlib */ 27 | 28 | #define MZ_END_OF_LIST (-100) 29 | #define MZ_END_OF_STREAM (-101) 30 | 31 | #define MZ_PARAM_ERROR (-102) 32 | #define MZ_FORMAT_ERROR (-103) 33 | #define MZ_INTERNAL_ERROR (-104) 34 | #define MZ_CRC_ERROR (-105) 35 | #define MZ_CRYPT_ERROR (-106) 36 | #define MZ_EXIST_ERROR (-107) 37 | #define MZ_PASSWORD_ERROR (-108) 38 | #define MZ_SUPPORT_ERROR (-109) 39 | #define MZ_HASH_ERROR (-110) 40 | #define MZ_OPEN_ERROR (-111) 41 | #define MZ_CLOSE_ERROR (-112) 42 | #define MZ_SEEK_ERROR (-113) 43 | #define MZ_TELL_ERROR (-114) 44 | #define MZ_READ_ERROR (-115) 45 | #define MZ_WRITE_ERROR (-116) 46 | #define MZ_SIGN_ERROR (-117) 47 | #define MZ_SYMLINK_ERROR (-118) 48 | 49 | /* MZ_OPEN */ 50 | #define MZ_OPEN_MODE_READ (0x01) 51 | #define MZ_OPEN_MODE_WRITE (0x02) 52 | #define MZ_OPEN_MODE_READWRITE (MZ_OPEN_MODE_READ | MZ_OPEN_MODE_WRITE) 53 | #define MZ_OPEN_MODE_APPEND (0x04) 54 | #define MZ_OPEN_MODE_CREATE (0x08) 55 | #define MZ_OPEN_MODE_EXISTING (0x10) 56 | 57 | /* MZ_SEEK */ 58 | #define MZ_SEEK_SET (0) 59 | #define MZ_SEEK_CUR (1) 60 | #define MZ_SEEK_END (2) 61 | 62 | /* MZ_COMPRESS */ 63 | #define MZ_COMPRESS_METHOD_STORE (0) 64 | #define MZ_COMPRESS_METHOD_DEFLATE (8) 65 | #define MZ_COMPRESS_METHOD_BZIP2 (12) 66 | #define MZ_COMPRESS_METHOD_LZMA (14) 67 | #define MZ_COMPRESS_METHOD_AES (99) 68 | 69 | #define MZ_COMPRESS_LEVEL_DEFAULT (-1) 70 | #define MZ_COMPRESS_LEVEL_FAST (2) 71 | #define MZ_COMPRESS_LEVEL_NORMAL (6) 72 | #define MZ_COMPRESS_LEVEL_BEST (9) 73 | 74 | /* MZ_ZIP_FLAG */ 75 | #define MZ_ZIP_FLAG_ENCRYPTED (1 << 0) 76 | #define MZ_ZIP_FLAG_LZMA_EOS_MARKER (1 << 1) 77 | #define MZ_ZIP_FLAG_DEFLATE_MAX (1 << 1) 78 | #define MZ_ZIP_FLAG_DEFLATE_NORMAL (0) 79 | #define MZ_ZIP_FLAG_DEFLATE_FAST (1 << 2) 80 | #define MZ_ZIP_FLAG_DEFLATE_SUPER_FAST (MZ_ZIP_FLAG_DEFLATE_FAST | \ 81 | MZ_ZIP_FLAG_DEFLATE_MAX) 82 | #define MZ_ZIP_FLAG_DATA_DESCRIPTOR (1 << 3) 83 | #define MZ_ZIP_FLAG_UTF8 (1 << 11) 84 | #define MZ_ZIP_FLAG_MASK_LOCAL_INFO (1 << 13) 85 | 86 | /* MZ_ZIP_EXTENSION */ 87 | #define MZ_ZIP_EXTENSION_ZIP64 (0x0001) 88 | #define MZ_ZIP_EXTENSION_NTFS (0x000a) 89 | #define MZ_ZIP_EXTENSION_AES (0x9901) 90 | #define MZ_ZIP_EXTENSION_UNIX1 (0x000d) 91 | #define MZ_ZIP_EXTENSION_SIGN (0x10c5) 92 | #define MZ_ZIP_EXTENSION_HASH (0x1a51) 93 | #define MZ_ZIP_EXTENSION_CDCD (0xcdcd) 94 | 95 | /* MZ_ZIP64 */ 96 | #define MZ_ZIP64_AUTO (0) 97 | #define MZ_ZIP64_FORCE (1) 98 | #define MZ_ZIP64_DISABLE (2) 99 | 100 | /* MZ_HOST_SYSTEM */ 101 | #define MZ_HOST_SYSTEM(VERSION_MADEBY) ((uint8_t)(VERSION_MADEBY >> 8)) 102 | #define MZ_HOST_SYSTEM_MSDOS (0) 103 | #define MZ_HOST_SYSTEM_UNIX (3) 104 | #define MZ_HOST_SYSTEM_WINDOWS_NTFS (10) 105 | #define MZ_HOST_SYSTEM_RISCOS (13) 106 | #define MZ_HOST_SYSTEM_OSX_DARWIN (19) 107 | 108 | /* MZ_PKCRYPT */ 109 | #define MZ_PKCRYPT_HEADER_SIZE (12) 110 | 111 | /* MZ_AES */ 112 | #define MZ_AES_VERSION (1) 113 | #define MZ_AES_ENCRYPTION_MODE_128 (0x01) 114 | #define MZ_AES_ENCRYPTION_MODE_192 (0x02) 115 | #define MZ_AES_ENCRYPTION_MODE_256 (0x03) 116 | #define MZ_AES_KEY_LENGTH(MODE) (8 * (MODE & 3) + 8) 117 | #define MZ_AES_KEY_LENGTH_MAX (32) 118 | #define MZ_AES_BLOCK_SIZE (16) 119 | #define MZ_AES_HEADER_SIZE(MODE) ((4 * (MODE & 3) + 4) + 2) 120 | #define MZ_AES_FOOTER_SIZE (10) 121 | 122 | /* MZ_HASH */ 123 | #define MZ_HASH_MD5 (10) 124 | #define MZ_HASH_MD5_SIZE (16) 125 | #define MZ_HASH_SHA1 (20) 126 | #define MZ_HASH_SHA1_SIZE (20) 127 | #define MZ_HASH_SHA256 (23) 128 | #define MZ_HASH_SHA256_SIZE (32) 129 | #define MZ_HASH_MAX_SIZE (256) 130 | 131 | /* MZ_ENCODING */ 132 | #define MZ_ENCODING_CODEPAGE_437 (437) 133 | #define MZ_ENCODING_CODEPAGE_932 (932) 134 | #define MZ_ENCODING_CODEPAGE_936 (936) 135 | #define MZ_ENCODING_CODEPAGE_950 (950) 136 | #define MZ_ENCODING_UTF8 (65001) 137 | 138 | /* MZ_UTILITY */ 139 | #define MZ_UNUSED(SYMBOL) ((void)SYMBOL) 140 | 141 | #ifndef MZ_CUSTOM_ALLOC 142 | #define MZ_ALLOC(SIZE) (malloc(SIZE)) 143 | #endif 144 | #ifndef MZ_CUSTOM_FREE 145 | #define MZ_FREE(PTR) (free(PTR)) 146 | #endif 147 | 148 | #if defined(_WINDOWS) && defined(MZ_EXPORTS) 149 | #define MZ_EXPORT __declspec(dllexport) 150 | #else 151 | #define MZ_EXPORT 152 | #endif 153 | 154 | /***************************************************************************/ 155 | 156 | #include /* size_t, NULL, malloc */ 157 | #include /* time_t, time() */ 158 | #include /* memset, strncpy, strlen */ 159 | #include 160 | 161 | #ifdef HAVE_STDINT_H 162 | # include 163 | #endif 164 | 165 | #ifndef __INT8_TYPE__ 166 | typedef signed char int8_t; 167 | #endif 168 | #ifndef __INT16_TYPE__ 169 | typedef short int16_t; 170 | #endif 171 | #ifndef __INT32_TYPE__ 172 | typedef int int32_t; 173 | #endif 174 | #ifndef __INT64_TYPE__ 175 | typedef long long int64_t; 176 | #endif 177 | #ifndef __UINT8_TYPE__ 178 | typedef unsigned char uint8_t; 179 | #endif 180 | #ifndef __UINT16_TYPE__ 181 | typedef unsigned short uint16_t; 182 | #endif 183 | #ifndef __UINT32_TYPE__ 184 | typedef unsigned int uint32_t; 185 | #endif 186 | #ifndef __UINT64_TYPE__ 187 | typedef unsigned long long uint64_t; 188 | #endif 189 | 190 | #ifdef HAVE_INTTYPES_H 191 | # include 192 | #endif 193 | 194 | #ifndef PRId8 195 | # define PRId8 "hhd" 196 | #endif 197 | #ifndef PRId16 198 | # define PRId16 "hd" 199 | #endif 200 | #ifndef PRId32 201 | # define PRId32 "d" 202 | #endif 203 | #ifndef PRIu32 204 | # define PRIu32 "u" 205 | #endif 206 | #ifndef PRIx32 207 | # define PRIx32 "x" 208 | #endif 209 | #if ULONG_MAX == 4294967295UL 210 | # ifndef PRId64 211 | # define PRId64 "lld" 212 | # endif 213 | # ifndef PRIu64 214 | # define PRIu64 "llu" 215 | # endif 216 | # ifndef PRIx64 217 | # define PRIx64 "llx" 218 | # endif 219 | #else 220 | # ifndef PRId64 221 | # define PRId64 "ld" 222 | # endif 223 | # ifndef PRIu64 224 | # define PRIu64 "lu" 225 | # endif 226 | # ifndef PRIx64 227 | # define PRIx64 "lx" 228 | # endif 229 | #endif 230 | 231 | #ifndef INT16_MAX 232 | # define INT16_MAX 32767 233 | #endif 234 | #ifndef INT32_MAX 235 | # define INT32_MAX 2147483647L 236 | #endif 237 | #ifndef INT64_MAX 238 | # define INT64_MAX 9223372036854775807LL 239 | #endif 240 | #ifndef UINT16_MAX 241 | # define UINT16_MAX 65535U 242 | #endif 243 | #ifndef UINT32_MAX 244 | # define UINT32_MAX 4294967295UL 245 | #endif 246 | #ifndef UINT64_MAX 247 | # define UINT64_MAX 18446744073709551615ULL 248 | #endif 249 | 250 | /***************************************************************************/ 251 | 252 | #endif 253 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/mz_crypt.c: -------------------------------------------------------------------------------- 1 | /* mz_crypt.c -- Crypto/hash functions 2 | Version 2.9.2, February 12, 2020 3 | part of the MiniZip project 4 | 5 | Copyright (C) 2010-2020 Nathan Moinvaziri 6 | https://github.com/nmoinvaz/minizip 7 | 8 | This program is distributed under the terms of the same license as zlib. 9 | See the accompanying LICENSE file for the full text of the license. 10 | */ 11 | 12 | 13 | #include "mz.h" 14 | #include "mz_crypt.h" 15 | 16 | #if defined(HAVE_ZLIB) 17 | # include "zlib.h" 18 | # if defined(ZLIBNG_VERNUM) && !defined(ZLIB_COMPAT) 19 | # include "zlib-ng.h" 20 | # endif 21 | #elif defined(HAVE_LZMA) 22 | # include "lzma.h" 23 | #endif 24 | 25 | /***************************************************************************/ 26 | /* Define z_crc_t in zlib 1.2.5 and less or if using zlib-ng */ 27 | 28 | #if defined(HAVE_ZLIB) && defined(ZLIBNG_VERNUM) 29 | # if defined(ZLIB_COMPAT) 30 | # define ZLIB_PREFIX(x) x 31 | # else 32 | # define ZLIB_PREFIX(x) zng_ ## x 33 | # endif 34 | typedef uint32_t z_crc_t; 35 | #elif defined(HAVE_ZLIB) 36 | # define ZLIB_PREFIX(x) x 37 | # if (ZLIB_VERNUM < 0x1270) 38 | typedef unsigned long z_crc_t; 39 | # endif 40 | #endif 41 | 42 | /***************************************************************************/ 43 | 44 | uint32_t mz_crypt_crc32_update(uint32_t value, const uint8_t *buf, int32_t size) 45 | { 46 | #if defined(HAVE_ZLIB) 47 | return (uint32_t)ZLIB_PREFIX(crc32)((z_crc_t)value, buf, (uInt)size); 48 | #elif defined(HAVE_LZMA) 49 | return (uint32_t)lzma_crc32(buf, (size_t)size, (uint32_t)value); 50 | #else 51 | static uint32_t crc32_table[256] = { 52 | 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 53 | 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 54 | 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 55 | 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 56 | 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 57 | 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 58 | 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, 0x35b5a8fa, 0x42b2986c, 59 | 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 60 | 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 61 | 0xcfba9599, 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 62 | 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, 0x01db7106, 63 | 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, 64 | 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 65 | 0x91646c97, 0xe6635c01, 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 66 | 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, 67 | 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, 68 | 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 69 | 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 70 | 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 71 | 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, 72 | 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 73 | 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 74 | 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, 0xe3630b12, 0x94643b84, 75 | 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 76 | 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 77 | 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 78 | 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, 0xd6d6a3e8, 0xa1d1937e, 79 | 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 80 | 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 81 | 0x316e8eef, 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 82 | 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, 0xb2bd0b28, 83 | 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, 84 | 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 85 | 0x72076785, 0x05005713, 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 86 | 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, 87 | 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, 88 | 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 89 | 0x616bffd3, 0x166ccf45, 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 90 | 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 91 | 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, 92 | 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 93 | 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 94 | 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d 95 | }; 96 | value = ~value; 97 | 98 | while (size > 0) 99 | { 100 | value = (value >> 8) ^ crc32_table[(value ^ *buf) & 0xFF]; 101 | 102 | buf += 1; 103 | size -= 1; 104 | } 105 | 106 | return ~value; 107 | #endif 108 | } 109 | 110 | #ifndef MZ_ZIP_NO_ENCRYPTION 111 | int32_t mz_crypt_pbkdf2(uint8_t *password, int32_t password_length, uint8_t *salt, 112 | int32_t salt_length, int32_t iteration_count, uint8_t *key, int32_t key_length) 113 | { 114 | void *hmac1 = NULL; 115 | void *hmac2 = NULL; 116 | void *hmac3 = NULL; 117 | int32_t err = MZ_OK; 118 | uint16_t i = 0; 119 | uint16_t j = 0; 120 | uint16_t k = 0; 121 | uint16_t block_count = 0; 122 | uint8_t uu[MZ_HASH_SHA1_SIZE]; 123 | uint8_t ux[MZ_HASH_SHA1_SIZE]; 124 | 125 | if (password == NULL || salt == NULL || key == NULL) 126 | return MZ_PARAM_ERROR; 127 | 128 | memset(key, 0, key_length); 129 | 130 | mz_crypt_hmac_create(&hmac1); 131 | mz_crypt_hmac_create(&hmac2); 132 | mz_crypt_hmac_create(&hmac3); 133 | 134 | mz_crypt_hmac_set_algorithm(hmac1, MZ_HASH_SHA1); 135 | mz_crypt_hmac_set_algorithm(hmac2, MZ_HASH_SHA1); 136 | mz_crypt_hmac_set_algorithm(hmac3, MZ_HASH_SHA1); 137 | 138 | err = mz_crypt_hmac_init(hmac1, password, password_length); 139 | if (err == MZ_OK) 140 | err = mz_crypt_hmac_init(hmac2, password, password_length); 141 | if (err == MZ_OK) 142 | err = mz_crypt_hmac_update(hmac2, salt, salt_length); 143 | 144 | block_count = 1 + ((uint16_t)key_length - 1) / MZ_HASH_SHA1_SIZE; 145 | 146 | for (i = 0; (err == MZ_OK) && (i < block_count); i += 1) 147 | { 148 | memset(ux, 0, sizeof(ux)); 149 | 150 | err = mz_crypt_hmac_copy(hmac2, hmac3); 151 | if (err != MZ_OK) 152 | break; 153 | 154 | uu[0] = (uint8_t)((i + 1) >> 24); 155 | uu[1] = (uint8_t)((i + 1) >> 16); 156 | uu[2] = (uint8_t)((i + 1) >> 8); 157 | uu[3] = (uint8_t)(i + 1); 158 | 159 | for (j = 0, k = 4; j < iteration_count; j += 1) 160 | { 161 | err = mz_crypt_hmac_update(hmac3, uu, k); 162 | if (err == MZ_OK) 163 | err = mz_crypt_hmac_end(hmac3, uu, sizeof(uu)); 164 | if (err != MZ_OK) 165 | break; 166 | 167 | for(k = 0; k < MZ_HASH_SHA1_SIZE; k += 1) 168 | ux[k] ^= uu[k]; 169 | 170 | err = mz_crypt_hmac_copy(hmac1, hmac3); 171 | if (err != MZ_OK) 172 | break; 173 | } 174 | 175 | if (err != MZ_OK) 176 | break; 177 | 178 | j = 0; 179 | k = i * MZ_HASH_SHA1_SIZE; 180 | 181 | while (j < MZ_HASH_SHA1_SIZE && k < key_length) 182 | key[k++] = ux[j++]; 183 | } 184 | 185 | /* hmac3 uses the same provider as hmac2, so it must be deleted 186 | before the context is destroyed. */ 187 | mz_crypt_hmac_delete(&hmac3); 188 | mz_crypt_hmac_delete(&hmac1); 189 | mz_crypt_hmac_delete(&hmac2); 190 | 191 | return err; 192 | } 193 | #endif 194 | 195 | /***************************************************************************/ 196 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/mz_crypt.h: -------------------------------------------------------------------------------- 1 | /* mz_crypt.h -- Crypto/hash functions 2 | Version 2.9.2, February 12, 2020 3 | part of the MiniZip project 4 | 5 | Copyright (C) 2010-2020 Nathan Moinvaziri 6 | https://github.com/nmoinvaz/minizip 7 | 8 | This program is distributed under the terms of the same license as zlib. 9 | See the accompanying LICENSE file for the full text of the license. 10 | */ 11 | 12 | #ifndef MZ_CRYPT_H 13 | #define MZ_CRYPT_H 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /***************************************************************************/ 20 | 21 | uint32_t mz_crypt_crc32_update(uint32_t value, const uint8_t *buf, int32_t size); 22 | 23 | int32_t mz_crypt_pbkdf2(uint8_t *password, int32_t password_length, uint8_t *salt, 24 | int32_t salt_length, int32_t iteration_count, uint8_t *key, int32_t key_length); 25 | 26 | /***************************************************************************/ 27 | 28 | int32_t mz_crypt_rand(uint8_t *buf, int32_t size); 29 | 30 | void mz_crypt_sha_reset(void *handle); 31 | int32_t mz_crypt_sha_begin(void *handle); 32 | int32_t mz_crypt_sha_update(void *handle, const void *buf, int32_t size); 33 | int32_t mz_crypt_sha_end(void *handle, uint8_t *digest, int32_t digest_size); 34 | void mz_crypt_sha_set_algorithm(void *handle, uint16_t algorithm); 35 | void* mz_crypt_sha_create(void **handle); 36 | void mz_crypt_sha_delete(void **handle); 37 | 38 | void mz_crypt_aes_reset(void *handle); 39 | int32_t mz_crypt_aes_encrypt(void *handle, uint8_t *buf, int32_t size); 40 | int32_t mz_crypt_aes_decrypt(void *handle, uint8_t *buf, int32_t size); 41 | int32_t mz_crypt_aes_set_encrypt_key(void *handle, const void *key, int32_t key_length); 42 | int32_t mz_crypt_aes_set_decrypt_key(void *handle, const void *key, int32_t key_length); 43 | void mz_crypt_aes_set_mode(void *handle, int32_t mode); 44 | void* mz_crypt_aes_create(void **handle); 45 | void mz_crypt_aes_delete(void **handle); 46 | 47 | void mz_crypt_hmac_reset(void *handle); 48 | int32_t mz_crypt_hmac_init(void *handle, const void *key, int32_t key_length); 49 | int32_t mz_crypt_hmac_update(void *handle, const void *buf, int32_t size); 50 | int32_t mz_crypt_hmac_end(void *handle, uint8_t *digest, int32_t digest_size); 51 | int32_t mz_crypt_hmac_copy(void *src_handle, void *target_handle); 52 | void mz_crypt_hmac_set_algorithm(void *handle, uint16_t algorithm); 53 | void* mz_crypt_hmac_create(void **handle); 54 | void mz_crypt_hmac_delete(void **handle); 55 | 56 | int32_t mz_crypt_sign(uint8_t *message, int32_t message_size, uint8_t *cert_data, int32_t cert_data_size, 57 | const char *cert_pwd, uint8_t **signature, int32_t *signature_size); 58 | int32_t mz_crypt_sign_verify(uint8_t *message, int32_t message_size, uint8_t *signature, int32_t signature_size); 59 | 60 | /***************************************************************************/ 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/mz_os.h: -------------------------------------------------------------------------------- 1 | /* mz_os.h -- System functions 2 | Version 2.9.2, February 12, 2020 3 | part of the MiniZip project 4 | 5 | Copyright (C) 2010-2020 Nathan Moinvaziri 6 | https://github.com/nmoinvaz/minizip 7 | 8 | This program is distributed under the terms of the same license as zlib. 9 | See the accompanying LICENSE file for the full text of the license. 10 | */ 11 | 12 | #ifndef MZ_OS_H 13 | #define MZ_OS_H 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /***************************************************************************/ 20 | 21 | #if defined(__APPLE__) 22 | # define MZ_VERSION_MADEBY_HOST_SYSTEM (MZ_HOST_SYSTEM_OSX_DARWIN) 23 | #elif defined(__riscos__) 24 | # define MZ_VERSION_MADEBY_HOST_SYSTEM (MZ_HOST_SYSTEM_RISCOS) 25 | #elif defined(__unix__) 26 | # define MZ_VERSION_MADEBY_HOST_SYSTEM (MZ_HOST_SYSTEM_UNIX) 27 | #elif defined(_WIN32) 28 | # define MZ_VERSION_MADEBY_HOST_SYSTEM (MZ_HOST_SYSTEM_WINDOWS_NTFS) 29 | #endif 30 | 31 | #if defined(HAVE_LZMA) 32 | # define MZ_VERSION_MADEBY_ZIP_VERSION (63) 33 | #elif defined(HAVE_WZAES) 34 | # define MZ_VERSION_MADEBY_ZIP_VERSION (51) 35 | #elif defined(HAVE_BZIP2) 36 | # define MZ_VERSION_MADEBY_ZIP_VERSION (46) 37 | #else 38 | # define MZ_VERSION_MADEBY_ZIP_VERSION (45) 39 | #endif 40 | 41 | #define MZ_VERSION_MADEBY ((MZ_VERSION_MADEBY_HOST_SYSTEM << 8) | \ 42 | (MZ_VERSION_MADEBY_ZIP_VERSION)) 43 | 44 | #define MZ_PATH_SLASH_UNIX ('/') 45 | #if defined(_WIN32) 46 | # define MZ_PATH_SLASH_PLATFORM ('\\') 47 | #else 48 | # define MZ_PATH_SLASH_PLATFORM (MZ_PATH_SLASH_UNIX) 49 | #endif 50 | 51 | /***************************************************************************/ 52 | 53 | #if defined(_WIN32) 54 | struct dirent { 55 | char d_name[256]; 56 | }; 57 | typedef void* DIR; 58 | #else 59 | #include 60 | #endif 61 | 62 | /***************************************************************************/ 63 | /* Shared functions */ 64 | 65 | int32_t mz_path_combine(char *path, const char *join, int32_t max_path); 66 | /* Combines two paths */ 67 | 68 | int32_t mz_path_append_slash(char *path, int32_t max_path, char slash); 69 | /* Appends a path slash on to the end of the path */ 70 | 71 | int32_t mz_path_remove_slash(char *path); 72 | /* Removes a path slash from the end of the path */ 73 | 74 | int32_t mz_path_has_slash(const char *path); 75 | /* Returns whether or not the path ends with slash */ 76 | 77 | int32_t mz_path_convert_slashes(char *path, char slash); 78 | /* Converts the slashes in a path */ 79 | 80 | int32_t mz_path_compare_wc(const char *path, const char *wildcard, uint8_t ignore_case); 81 | /* Compare two paths with wildcard */ 82 | 83 | int32_t mz_path_resolve(const char *path, char *target, int32_t max_target); 84 | /* Resolves path */ 85 | 86 | int32_t mz_path_remove_filename(char *path); 87 | /* Remove the filename from a path */ 88 | 89 | int32_t mz_path_remove_extension(char *path); 90 | /* Remove the extension from a path */ 91 | 92 | int32_t mz_path_get_filename(const char *path, const char **filename); 93 | /* Get the filename from a path */ 94 | 95 | int32_t mz_dir_make(const char *path); 96 | /* Creates a directory recursively */ 97 | 98 | int32_t mz_file_get_crc(const char *path, uint32_t *result_crc); 99 | /* Gets the crc32 hash of a file */ 100 | 101 | /***************************************************************************/ 102 | /* Platform specific functions */ 103 | 104 | wchar_t *mz_os_unicode_string_create(const char *string, int32_t encoding); 105 | /* Create unicode string from a utf8 string */ 106 | 107 | void mz_os_unicode_string_delete(wchar_t **string); 108 | /* Delete a unicode string that was created */ 109 | 110 | uint8_t *mz_os_utf8_string_create(const char *string, int32_t encoding); 111 | /* Create a utf8 string from a string with another encoding */ 112 | 113 | void mz_os_utf8_string_delete(uint8_t **string); 114 | /* Delete a utf8 string that was created */ 115 | 116 | int32_t mz_os_rand(uint8_t *buf, int32_t size); 117 | /* Random number generator (not cryptographically secure) */ 118 | 119 | int32_t mz_os_rename(const char *source_path, const char *target_path); 120 | /* Rename a file */ 121 | 122 | int32_t mz_os_unlink(const char *path); 123 | /* Delete an existing file */ 124 | 125 | int32_t mz_os_file_exists(const char *path); 126 | /* Check to see if a file exists */ 127 | 128 | int64_t mz_os_get_file_size(const char *path); 129 | /* Gets the length of a file */ 130 | 131 | int32_t mz_os_get_file_date(const char *path, time_t *modified_date, time_t *accessed_date, time_t *creation_date); 132 | /* Gets a file's modified, access, and creation dates if supported */ 133 | 134 | int32_t mz_os_set_file_date(const char *path, time_t modified_date, time_t accessed_date, time_t creation_date); 135 | /* Sets a file's modified, access, and creation dates if supported */ 136 | 137 | int32_t mz_os_get_file_attribs(const char *path, uint32_t *attributes); 138 | /* Gets a file's attributes */ 139 | 140 | int32_t mz_os_set_file_attribs(const char *path, uint32_t attributes); 141 | /* Sets a file's attributes */ 142 | 143 | int32_t mz_os_make_dir(const char *path); 144 | /* Recursively creates a directory */ 145 | 146 | DIR* mz_os_open_dir(const char *path); 147 | /* Opens a directory for listing */ 148 | struct 149 | dirent* mz_os_read_dir(DIR *dir); 150 | /* Reads a directory listing entry */ 151 | 152 | int32_t mz_os_close_dir(DIR *dir); 153 | /* Closes a directory that has been opened for listing */ 154 | 155 | int32_t mz_os_is_dir(const char *path); 156 | /* Checks to see if path is a directory */ 157 | 158 | int32_t mz_os_is_symlink(const char *path); 159 | /* Checks to see if path is a symbolic link */ 160 | 161 | int32_t mz_os_make_symlink(const char *path, const char *target_path); 162 | /* Creates a symbolic link pointing to a target */ 163 | 164 | int32_t mz_os_read_symlink(const char *path, char *target_path, int32_t max_target_path); 165 | /* Gets the target path for a symbolic link */ 166 | 167 | uint64_t mz_os_ms_time(void); 168 | /* Gets the time in milliseconds */ 169 | 170 | /***************************************************************************/ 171 | 172 | #ifdef __cplusplus 173 | } 174 | #endif 175 | 176 | #endif 177 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/mz_strm.h: -------------------------------------------------------------------------------- 1 | /* mz_strm.h -- Stream interface 2 | Version 2.9.2, February 12, 2020 3 | part of the MiniZip project 4 | 5 | Copyright (C) 2010-2020 Nathan Moinvaziri 6 | https://github.com/nmoinvaz/minizip 7 | 8 | This program is distributed under the terms of the same license as zlib. 9 | See the accompanying LICENSE file for the full text of the license. 10 | */ 11 | 12 | #ifndef MZ_STREAM_H 13 | #define MZ_STREAM_H 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /***************************************************************************/ 20 | 21 | #define MZ_STREAM_PROP_TOTAL_IN (1) 22 | #define MZ_STREAM_PROP_TOTAL_IN_MAX (2) 23 | #define MZ_STREAM_PROP_TOTAL_OUT (3) 24 | #define MZ_STREAM_PROP_TOTAL_OUT_MAX (4) 25 | #define MZ_STREAM_PROP_HEADER_SIZE (5) 26 | #define MZ_STREAM_PROP_FOOTER_SIZE (6) 27 | #define MZ_STREAM_PROP_DISK_SIZE (7) 28 | #define MZ_STREAM_PROP_DISK_NUMBER (8) 29 | #define MZ_STREAM_PROP_COMPRESS_LEVEL (9) 30 | #define MZ_STREAM_PROP_COMPRESS_ALGORITHM (10) 31 | #define MZ_STREAM_PROP_COMPRESS_WINDOW (11) 32 | 33 | /***************************************************************************/ 34 | 35 | typedef int32_t (*mz_stream_open_cb) (void *stream, const char *path, int32_t mode); 36 | typedef int32_t (*mz_stream_is_open_cb) (void *stream); 37 | typedef int32_t (*mz_stream_read_cb) (void *stream, void *buf, int32_t size); 38 | typedef int32_t (*mz_stream_write_cb) (void *stream, const void *buf, int32_t size); 39 | typedef int64_t (*mz_stream_tell_cb) (void *stream); 40 | typedef int32_t (*mz_stream_seek_cb) (void *stream, int64_t offset, int32_t origin); 41 | typedef int32_t (*mz_stream_close_cb) (void *stream); 42 | typedef int32_t (*mz_stream_error_cb) (void *stream); 43 | typedef void* (*mz_stream_create_cb) (void **stream); 44 | typedef void (*mz_stream_destroy_cb) (void **stream); 45 | 46 | typedef int32_t (*mz_stream_get_prop_int64_cb) (void *stream, int32_t prop, int64_t *value); 47 | typedef int32_t (*mz_stream_set_prop_int64_cb) (void *stream, int32_t prop, int64_t value); 48 | 49 | typedef int32_t (*mz_stream_find_cb) (void *stream, const void *find, int32_t find_size, 50 | int64_t max_seek, int64_t *position); 51 | 52 | /***************************************************************************/ 53 | 54 | typedef struct mz_stream_vtbl_s 55 | { 56 | mz_stream_open_cb open; 57 | mz_stream_is_open_cb is_open; 58 | mz_stream_read_cb read; 59 | mz_stream_write_cb write; 60 | mz_stream_tell_cb tell; 61 | mz_stream_seek_cb seek; 62 | mz_stream_close_cb close; 63 | mz_stream_error_cb error; 64 | mz_stream_create_cb create; 65 | mz_stream_destroy_cb destroy; 66 | 67 | mz_stream_get_prop_int64_cb get_prop_int64; 68 | mz_stream_set_prop_int64_cb set_prop_int64; 69 | } mz_stream_vtbl; 70 | 71 | typedef struct mz_stream_s { 72 | mz_stream_vtbl *vtbl; 73 | struct mz_stream_s *base; 74 | } mz_stream; 75 | 76 | /***************************************************************************/ 77 | 78 | int32_t mz_stream_open(void *stream, const char *path, int32_t mode); 79 | int32_t mz_stream_is_open(void *stream); 80 | int32_t mz_stream_read(void *stream, void *buf, int32_t size); 81 | int32_t mz_stream_read_uint8(void *stream, uint8_t *value); 82 | int32_t mz_stream_read_uint16(void *stream, uint16_t *value); 83 | int32_t mz_stream_read_uint32(void *stream, uint32_t *value); 84 | int32_t mz_stream_read_int64(void *stream, int64_t *value); 85 | int32_t mz_stream_read_uint64(void *stream, uint64_t *value); 86 | int32_t mz_stream_write(void *stream, const void *buf, int32_t size); 87 | int32_t mz_stream_write_uint8(void *stream, uint8_t value); 88 | int32_t mz_stream_write_uint16(void *stream, uint16_t value); 89 | int32_t mz_stream_write_uint32(void *stream, uint32_t value); 90 | int32_t mz_stream_write_int64(void *stream, int64_t value); 91 | int32_t mz_stream_write_uint64(void *stream, uint64_t value); 92 | int32_t mz_stream_copy(void *target, void *source, int32_t len); 93 | int32_t mz_stream_copy_to_end(void *target, void *source); 94 | int32_t mz_stream_copy_stream(void *target, mz_stream_write_cb write_cb, void *source, mz_stream_read_cb read_cb, int32_t len); 95 | int32_t mz_stream_copy_stream_to_end(void *target, mz_stream_write_cb write_cb, void *source, mz_stream_read_cb read_cb); 96 | int64_t mz_stream_tell(void *stream); 97 | int32_t mz_stream_seek(void *stream, int64_t offset, int32_t origin); 98 | int32_t mz_stream_find(void *stream, const void *find, int32_t find_size, int64_t max_seek, int64_t *position); 99 | int32_t mz_stream_find_reverse(void *stream, const void *find, int32_t find_size, int64_t max_seek, int64_t *position); 100 | int32_t mz_stream_close(void *stream); 101 | int32_t mz_stream_error(void *stream); 102 | 103 | int32_t mz_stream_set_base(void *stream, void *base); 104 | void* mz_stream_get_interface(void *stream); 105 | int32_t mz_stream_get_prop_int64(void *stream, int32_t prop, int64_t *value); 106 | int32_t mz_stream_set_prop_int64(void *stream, int32_t prop, int64_t value); 107 | 108 | void* mz_stream_create(void **stream, mz_stream_vtbl *vtbl); 109 | void mz_stream_delete(void **stream); 110 | 111 | /***************************************************************************/ 112 | 113 | int32_t mz_stream_raw_open(void *stream, const char *filename, int32_t mode); 114 | int32_t mz_stream_raw_is_open(void *stream); 115 | int32_t mz_stream_raw_read(void *stream, void *buf, int32_t size); 116 | int32_t mz_stream_raw_write(void *stream, const void *buf, int32_t size); 117 | int64_t mz_stream_raw_tell(void *stream); 118 | int32_t mz_stream_raw_seek(void *stream, int64_t offset, int32_t origin); 119 | int32_t mz_stream_raw_close(void *stream); 120 | int32_t mz_stream_raw_error(void *stream); 121 | 122 | int32_t mz_stream_raw_get_prop_int64(void *stream, int32_t prop, int64_t *value); 123 | int32_t mz_stream_raw_set_prop_int64(void *stream, int32_t prop, int64_t value); 124 | 125 | void* mz_stream_raw_create(void **stream); 126 | void mz_stream_raw_delete(void **stream); 127 | 128 | /***************************************************************************/ 129 | 130 | #ifdef __cplusplus 131 | } 132 | #endif 133 | 134 | #endif 135 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/mz_strm_buf.h: -------------------------------------------------------------------------------- 1 | /* mz_strm_buf.h -- Stream for buffering reads/writes 2 | Version 2.9.2, February 12, 2020 3 | part of the MiniZip project 4 | 5 | This version of ioapi is designed to buffer IO. 6 | 7 | Copyright (C) 2010-2020 Nathan Moinvaziri 8 | https://github.com/nmoinvaz/minizip 9 | 10 | This program is distributed under the terms of the same license as zlib. 11 | See the accompanying LICENSE file for the full text of the license. 12 | */ 13 | 14 | #ifndef MZ_STREAM_BUFFERED_H 15 | #define MZ_STREAM_BUFFERED_H 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /***************************************************************************/ 22 | 23 | int32_t mz_stream_buffered_open(void *stream, const char *path, int32_t mode); 24 | int32_t mz_stream_buffered_is_open(void *stream); 25 | int32_t mz_stream_buffered_read(void *stream, void *buf, int32_t size); 26 | int32_t mz_stream_buffered_write(void *stream, const void *buf, int32_t size); 27 | int64_t mz_stream_buffered_tell(void *stream); 28 | int32_t mz_stream_buffered_seek(void *stream, int64_t offset, int32_t origin); 29 | int32_t mz_stream_buffered_close(void *stream); 30 | int32_t mz_stream_buffered_error(void *stream); 31 | 32 | void* mz_stream_buffered_create(void **stream); 33 | void mz_stream_buffered_delete(void **stream); 34 | 35 | void* mz_stream_buffered_get_interface(void); 36 | 37 | /***************************************************************************/ 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/mz_strm_mem.h: -------------------------------------------------------------------------------- 1 | /* mz_strm_mem.h -- Stream for memory access 2 | Version 2.9.2, February 12, 2020 3 | part of MiniZip project 4 | 5 | Copyright (C) 2010-2020 Nathan Moinvaziri 6 | https://github.com/nmoinvaz/minizip 7 | 8 | This program is distributed under the terms of the same license as zlib. 9 | See the accompanying LICENSE file for the full text of the license. 10 | */ 11 | 12 | #ifndef MZ_STREAM_MEM_H 13 | #define MZ_STREAM_MEM_H 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /***************************************************************************/ 20 | 21 | int32_t mz_stream_mem_open(void *stream, const char *filename, int32_t mode); 22 | int32_t mz_stream_mem_is_open(void *stream); 23 | int32_t mz_stream_mem_read(void *stream, void *buf, int32_t size); 24 | int32_t mz_stream_mem_write(void *stream, const void *buf, int32_t size); 25 | int64_t mz_stream_mem_tell(void *stream); 26 | int32_t mz_stream_mem_seek(void *stream, int64_t offset, int32_t origin); 27 | int32_t mz_stream_mem_close(void *stream); 28 | int32_t mz_stream_mem_error(void *stream); 29 | 30 | void mz_stream_mem_set_buffer(void *stream, void *buf, int32_t size); 31 | int32_t mz_stream_mem_get_buffer(void *stream, const void **buf); 32 | int32_t mz_stream_mem_get_buffer_at(void *stream, int64_t position, const void **buf); 33 | int32_t mz_stream_mem_get_buffer_at_current(void *stream, const void **buf); 34 | void mz_stream_mem_get_buffer_length(void *stream, int32_t *length); 35 | void mz_stream_mem_set_buffer_limit(void *stream, int32_t limit); 36 | void mz_stream_mem_set_grow_size(void *stream, int32_t grow_size); 37 | 38 | void* mz_stream_mem_create(void **stream); 39 | void mz_stream_mem_delete(void **stream); 40 | 41 | void* mz_stream_mem_get_interface(void); 42 | 43 | /***************************************************************************/ 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/mz_strm_os.h: -------------------------------------------------------------------------------- 1 | /* mz_sstrm_os.h -- Stream for filesystem access 2 | Version 2.9.2, February 12, 2020 3 | part of the MiniZip project 4 | 5 | Copyright (C) 2010-2020 Nathan Moinvaziri 6 | https://github.com/nmoinvaz/minizip 7 | 8 | This program is distributed under the terms of the same license as zlib. 9 | See the accompanying LICENSE file for the full text of the license. 10 | */ 11 | 12 | #ifndef MZ_STREAM_OS_H 13 | #define MZ_STREAM_OS_H 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /***************************************************************************/ 20 | 21 | int32_t mz_stream_os_open(void *stream, const char *path, int32_t mode); 22 | int32_t mz_stream_os_is_open(void *stream); 23 | int32_t mz_stream_os_read(void *stream, void *buf, int32_t size); 24 | int32_t mz_stream_os_write(void *stream, const void *buf, int32_t size); 25 | int64_t mz_stream_os_tell(void *stream); 26 | int32_t mz_stream_os_seek(void *stream, int64_t offset, int32_t origin); 27 | int32_t mz_stream_os_close(void *stream); 28 | int32_t mz_stream_os_error(void *stream); 29 | 30 | void* mz_stream_os_create(void **stream); 31 | void mz_stream_os_delete(void **stream); 32 | 33 | void* mz_stream_os_get_interface(void); 34 | 35 | /***************************************************************************/ 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/mz_strm_os_posix.c: -------------------------------------------------------------------------------- 1 | /* mz_strm_posix.c -- Stream for filesystem access for posix/linux 2 | Version 2.9.2, February 12, 2020 3 | part of the MiniZip project 4 | 5 | Copyright (C) 2010-2020 Nathan Moinvaziri 6 | https://github.com/nmoinvaz/minizip 7 | Modifications for Zip64 support 8 | Copyright (C) 2009-2010 Mathias Svensson 9 | http://result42.com 10 | Copyright (C) 1998-2010 Gilles Vollant 11 | https://www.winimage.com/zLibDll/minizip.html 12 | 13 | This program is distributed under the terms of the same license as zlib. 14 | See the accompanying LICENSE file for the full text of the license. 15 | */ 16 | 17 | 18 | #include "mz.h" 19 | #include "mz_strm.h" 20 | #include "mz_strm_os.h" 21 | 22 | #include /* fopen, fread.. */ 23 | #include 24 | 25 | /***************************************************************************/ 26 | 27 | #define fopen64 fopen 28 | #ifndef MZ_FILE32_API 29 | # ifndef NO_FSEEKO 30 | # define ftello64 ftello 31 | # define fseeko64 fseeko 32 | # elif defined(_MSC_VER) && (_MSC_VER >= 1400) 33 | # define ftello64 _ftelli64 34 | # define fseeko64 _fseeki64 35 | # endif 36 | #endif 37 | #ifndef ftello64 38 | # define ftello64 ftell 39 | #endif 40 | #ifndef fseeko64 41 | # define fseeko64 fseek 42 | #endif 43 | 44 | /***************************************************************************/ 45 | 46 | static mz_stream_vtbl mz_stream_os_vtbl = { 47 | mz_stream_os_open, 48 | mz_stream_os_is_open, 49 | mz_stream_os_read, 50 | mz_stream_os_write, 51 | mz_stream_os_tell, 52 | mz_stream_os_seek, 53 | mz_stream_os_close, 54 | mz_stream_os_error, 55 | mz_stream_os_create, 56 | mz_stream_os_delete, 57 | NULL, 58 | NULL 59 | }; 60 | 61 | /***************************************************************************/ 62 | 63 | typedef struct mz_stream_posix_s 64 | { 65 | mz_stream stream; 66 | int32_t error; 67 | FILE *handle; 68 | } mz_stream_posix; 69 | 70 | /***************************************************************************/ 71 | 72 | int32_t mz_stream_os_open(void *stream, const char *path, int32_t mode) 73 | { 74 | mz_stream_posix *posix = (mz_stream_posix *)stream; 75 | const char *mode_fopen = NULL; 76 | 77 | if (path == NULL) 78 | return MZ_PARAM_ERROR; 79 | 80 | if ((mode & MZ_OPEN_MODE_READWRITE) == MZ_OPEN_MODE_READ) 81 | mode_fopen = "rb"; 82 | else if (mode & MZ_OPEN_MODE_APPEND) 83 | mode_fopen = "r+b"; 84 | else if (mode & MZ_OPEN_MODE_CREATE) 85 | mode_fopen = "wb"; 86 | else 87 | return MZ_OPEN_ERROR; 88 | 89 | posix->handle = fopen64(path, mode_fopen); 90 | if (posix->handle == NULL) 91 | { 92 | posix->error = errno; 93 | return MZ_OPEN_ERROR; 94 | } 95 | 96 | if (mode & MZ_OPEN_MODE_APPEND) 97 | return mz_stream_os_seek(stream, 0, MZ_SEEK_END); 98 | 99 | return MZ_OK; 100 | } 101 | 102 | int32_t mz_stream_os_is_open(void *stream) 103 | { 104 | mz_stream_posix *posix = (mz_stream_posix*)stream; 105 | if (posix->handle == NULL) 106 | return MZ_OPEN_ERROR; 107 | return MZ_OK; 108 | } 109 | 110 | int32_t mz_stream_os_read(void *stream, void *buf, int32_t size) 111 | { 112 | mz_stream_posix *posix = (mz_stream_posix*)stream; 113 | int32_t read = (int32_t)fread(buf, 1, (size_t)size, posix->handle); 114 | if (read < size && ferror(posix->handle)) 115 | { 116 | posix->error = errno; 117 | return MZ_READ_ERROR; 118 | } 119 | return read; 120 | } 121 | 122 | int32_t mz_stream_os_write(void *stream, const void *buf, int32_t size) 123 | { 124 | mz_stream_posix *posix = (mz_stream_posix*)stream; 125 | int32_t written = (int32_t)fwrite(buf, 1, (size_t)size, posix->handle); 126 | if (written < size && ferror(posix->handle)) 127 | { 128 | posix->error = errno; 129 | return MZ_WRITE_ERROR; 130 | } 131 | return written; 132 | } 133 | 134 | int64_t mz_stream_os_tell(void *stream) 135 | { 136 | mz_stream_posix *posix = (mz_stream_posix*)stream; 137 | int64_t position = ftello64(posix->handle); 138 | if (position == -1) 139 | { 140 | posix->error = errno; 141 | return MZ_TELL_ERROR; 142 | } 143 | return position; 144 | } 145 | 146 | int32_t mz_stream_os_seek(void *stream, int64_t offset, int32_t origin) 147 | { 148 | mz_stream_posix *posix = (mz_stream_posix*)stream; 149 | int32_t fseek_origin = 0; 150 | 151 | switch (origin) 152 | { 153 | case MZ_SEEK_CUR: 154 | fseek_origin = SEEK_CUR; 155 | break; 156 | case MZ_SEEK_END: 157 | fseek_origin = SEEK_END; 158 | break; 159 | case MZ_SEEK_SET: 160 | fseek_origin = SEEK_SET; 161 | break; 162 | default: 163 | return MZ_SEEK_ERROR; 164 | } 165 | 166 | if (fseeko64(posix->handle, offset, fseek_origin) != 0) 167 | { 168 | posix->error = errno; 169 | return MZ_SEEK_ERROR; 170 | } 171 | 172 | return MZ_OK; 173 | } 174 | 175 | int32_t mz_stream_os_close(void *stream) 176 | { 177 | mz_stream_posix *posix = (mz_stream_posix*)stream; 178 | int32_t closed = 0; 179 | if (posix->handle != NULL) 180 | { 181 | closed = fclose(posix->handle); 182 | posix->handle = NULL; 183 | } 184 | if (closed != 0) 185 | { 186 | posix->error = errno; 187 | return MZ_CLOSE_ERROR; 188 | } 189 | return MZ_OK; 190 | } 191 | 192 | int32_t mz_stream_os_error(void *stream) 193 | { 194 | mz_stream_posix *posix = (mz_stream_posix*)stream; 195 | return posix->error; 196 | } 197 | 198 | void *mz_stream_os_create(void **stream) 199 | { 200 | mz_stream_posix *posix = NULL; 201 | 202 | posix = (mz_stream_posix *)MZ_ALLOC(sizeof(mz_stream_posix)); 203 | if (posix != NULL) 204 | { 205 | memset(posix, 0, sizeof(mz_stream_posix)); 206 | posix->stream.vtbl = &mz_stream_os_vtbl; 207 | } 208 | if (stream != NULL) 209 | *stream = posix; 210 | 211 | return posix; 212 | } 213 | 214 | void mz_stream_os_delete(void **stream) 215 | { 216 | mz_stream_posix *posix = NULL; 217 | if (stream == NULL) 218 | return; 219 | posix = (mz_stream_posix *)*stream; 220 | if (posix != NULL) 221 | MZ_FREE(posix); 222 | *stream = NULL; 223 | } 224 | 225 | void *mz_stream_os_get_interface(void) 226 | { 227 | return (void *)&mz_stream_os_vtbl; 228 | } 229 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/mz_strm_pkcrypt.h: -------------------------------------------------------------------------------- 1 | /* mz_strm_pkcrypt.h -- Code for traditional PKWARE encryption 2 | Version 2.9.2, February 12, 2020 3 | part of the MiniZip project 4 | 5 | Copyright (C) 2010-2020 Nathan Moinvaziri 6 | https://github.com/nmoinvaz/minizip 7 | 8 | This program is distributed under the terms of the same license as zlib. 9 | See the accompanying LICENSE file for the full text of the license. 10 | */ 11 | 12 | #ifndef MZ_STREAM_PKCRYPT_H 13 | #define MZ_STREAM_PKCRYPT_H 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /***************************************************************************/ 20 | 21 | int32_t mz_stream_pkcrypt_open(void *stream, const char *filename, int32_t mode); 22 | int32_t mz_stream_pkcrypt_is_open(void *stream); 23 | int32_t mz_stream_pkcrypt_read(void *stream, void *buf, int32_t size); 24 | int32_t mz_stream_pkcrypt_write(void *stream, const void *buf, int32_t size); 25 | int64_t mz_stream_pkcrypt_tell(void *stream); 26 | int32_t mz_stream_pkcrypt_seek(void *stream, int64_t offset, int32_t origin); 27 | int32_t mz_stream_pkcrypt_close(void *stream); 28 | int32_t mz_stream_pkcrypt_error(void *stream); 29 | 30 | void mz_stream_pkcrypt_set_password(void *stream, const char *password); 31 | void mz_stream_pkcrypt_set_verify(void *stream, uint8_t verify1, uint8_t verify2); 32 | void mz_stream_pkcrypt_get_verify(void *stream, uint8_t *verify1, uint8_t *verify2); 33 | int32_t mz_stream_pkcrypt_get_prop_int64(void *stream, int32_t prop, int64_t *value); 34 | int32_t mz_stream_pkcrypt_set_prop_int64(void *stream, int32_t prop, int64_t value); 35 | 36 | void* mz_stream_pkcrypt_create(void **stream); 37 | void mz_stream_pkcrypt_delete(void **stream); 38 | 39 | void* mz_stream_pkcrypt_get_interface(void); 40 | 41 | /***************************************************************************/ 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/mz_strm_split.h: -------------------------------------------------------------------------------- 1 | /* mz_strm_split.h -- Stream for split files 2 | Version 2.9.2, February 12, 2020 3 | part of MiniZip project 4 | 5 | Copyright (C) 2010-2020 Nathan Moinvaziri 6 | https://github.com/nmoinvaz/minizip 7 | 8 | This program is distributed under the terms of the same license as zlib. 9 | See the accompanying LICENSE file for the full text of the license. 10 | */ 11 | 12 | #ifndef MZ_STREAM_SPLIT_H 13 | #define MZ_STREAM_SPLIT_H 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /***************************************************************************/ 20 | 21 | int32_t mz_stream_split_open(void *stream, const char *filename, int32_t mode); 22 | int32_t mz_stream_split_is_open(void *stream); 23 | int32_t mz_stream_split_read(void *stream, void *buf, int32_t size); 24 | int32_t mz_stream_split_write(void *stream, const void *buf, int32_t size); 25 | int64_t mz_stream_split_tell(void *stream); 26 | int32_t mz_stream_split_seek(void *stream, int64_t offset, int32_t origin); 27 | int32_t mz_stream_split_close(void *stream); 28 | int32_t mz_stream_split_error(void *stream); 29 | 30 | int32_t mz_stream_split_get_prop_int64(void *stream, int32_t prop, int64_t *value); 31 | int32_t mz_stream_split_set_prop_int64(void *stream, int32_t prop, int64_t value); 32 | 33 | void* mz_stream_split_create(void **stream); 34 | void mz_stream_split_delete(void **stream); 35 | 36 | void* mz_stream_split_get_interface(void); 37 | 38 | /***************************************************************************/ 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/mz_strm_wzaes.h: -------------------------------------------------------------------------------- 1 | /* mz_strm_wzaes.h -- Stream for WinZIP AES encryption 2 | Version 2.9.2, February 12, 2020 3 | part of the MiniZip project 4 | 5 | Copyright (C) 2010-2020 Nathan Moinvaziri 6 | https://github.com/nmoinvaz/minizip 7 | 8 | This program is distributed under the terms of the same license as zlib. 9 | See the accompanying LICENSE file for the full text of the license. 10 | */ 11 | 12 | #ifndef MZ_STREAM_WZAES_SHA1_H 13 | #define MZ_STREAM_WZAES_SHA1_H 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /***************************************************************************/ 20 | 21 | int32_t mz_stream_wzaes_open(void *stream, const char *filename, int32_t mode); 22 | int32_t mz_stream_wzaes_is_open(void *stream); 23 | int32_t mz_stream_wzaes_read(void *stream, void *buf, int32_t size); 24 | int32_t mz_stream_wzaes_write(void *stream, const void *buf, int32_t size); 25 | int64_t mz_stream_wzaes_tell(void *stream); 26 | int32_t mz_stream_wzaes_seek(void *stream, int64_t offset, int32_t origin); 27 | int32_t mz_stream_wzaes_close(void *stream); 28 | int32_t mz_stream_wzaes_error(void *stream); 29 | 30 | void mz_stream_wzaes_set_password(void *stream, const char *password); 31 | void mz_stream_wzaes_set_encryption_mode(void *stream, int16_t encryption_mode); 32 | 33 | int32_t mz_stream_wzaes_get_prop_int64(void *stream, int32_t prop, int64_t *value); 34 | int32_t mz_stream_wzaes_set_prop_int64(void *stream, int32_t prop, int64_t value); 35 | 36 | void* mz_stream_wzaes_create(void **stream); 37 | void mz_stream_wzaes_delete(void **stream); 38 | 39 | void* mz_stream_wzaes_get_interface(void); 40 | 41 | /***************************************************************************/ 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /Pods/SSZipArchive/SSZipArchive/minizip/mz_strm_zlib.h: -------------------------------------------------------------------------------- 1 | /* mz_strm_zlib.h -- Stream for zlib inflate/deflate 2 | Version 2.9.2, February 12, 2020 3 | part of the MiniZip project 4 | 5 | Copyright (C) 2010-2020 Nathan Moinvaziri 6 | https://github.com/nmoinvaz/minizip 7 | 8 | This program is distributed under the terms of the same license as zlib. 9 | See the accompanying LICENSE file for the full text of the license. 10 | */ 11 | 12 | #ifndef MZ_STREAM_ZLIB_H 13 | #define MZ_STREAM_ZLIB_H 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /***************************************************************************/ 20 | 21 | int32_t mz_stream_zlib_open(void *stream, const char *filename, int32_t mode); 22 | int32_t mz_stream_zlib_is_open(void *stream); 23 | int32_t mz_stream_zlib_read(void *stream, void *buf, int32_t size); 24 | int32_t mz_stream_zlib_write(void *stream, const void *buf, int32_t size); 25 | int64_t mz_stream_zlib_tell(void *stream); 26 | int32_t mz_stream_zlib_seek(void *stream, int64_t offset, int32_t origin); 27 | int32_t mz_stream_zlib_close(void *stream); 28 | int32_t mz_stream_zlib_error(void *stream); 29 | 30 | int32_t mz_stream_zlib_get_prop_int64(void *stream, int32_t prop, int64_t *value); 31 | int32_t mz_stream_zlib_set_prop_int64(void *stream, int32_t prop, int64_t value); 32 | 33 | void* mz_stream_zlib_create(void **stream); 34 | void mz_stream_zlib_delete(void **stream); 35 | 36 | void* mz_stream_zlib_get_interface(void); 37 | 38 | /***************************************************************************/ 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.7.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_AFNetworking : NSObject 3 | @end 4 | @implementation PodsDummy_AFNetworking 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #ifndef TARGET_OS_IOS 14 | #define TARGET_OS_IOS TARGET_OS_IPHONE 15 | #endif 16 | 17 | #ifndef TARGET_OS_WATCH 18 | #define TARGET_OS_WATCH 0 19 | #endif 20 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "AFNetworking.h" 14 | #import "AFURLConnectionOperation.h" 15 | #import "AFHTTPRequestOperation.h" 16 | #import "AFHTTPRequestOperationManager.h" 17 | #import "AFHTTPSessionManager.h" 18 | #import "AFURLSessionManager.h" 19 | #import "AFNetworkReachabilityManager.h" 20 | #import "AFSecurityPolicy.h" 21 | #import "AFURLRequestSerialization.h" 22 | #import "AFURLResponseSerialization.h" 23 | 24 | FOUNDATION_EXPORT double AFNetworkingVersionNumber; 25 | FOUNDATION_EXPORT const unsigned char AFNetworkingVersionString[]; 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking.debug.xcconfig: -------------------------------------------------------------------------------- 1 | BUILD_LIBRARY_FOR_DISTRIBUTION = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | CODE_SIGN_IDENTITY = 4 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking 5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 6 | OTHER_LDFLAGS = $(inherited) -framework "CoreServices" -framework "Security" -framework "SystemConfiguration" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking.modulemap: -------------------------------------------------------------------------------- 1 | framework module AFNetworking { 2 | umbrella header "AFNetworking-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/AFNetworking/AFNetworking.release.xcconfig: -------------------------------------------------------------------------------- 1 | BUILD_LIBRARY_FOR_DISTRIBUTION = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | CODE_SIGN_IDENTITY = 4 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking 5 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 6 | OTHER_LDFLAGS = $(inherited) -framework "CoreServices" -framework "Security" -framework "SystemConfiguration" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | SKIP_INSTALL = YES 14 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 15 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Ramiel/Pods-Ramiel-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Ramiel/Pods-Ramiel-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## AFNetworking 5 | 6 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | ## SSZipArchive 28 | 29 | Copyright (c) 2010-2015, Sam Soffes, https://soff.es 30 | 31 | Permission is hereby granted, free of charge, to any person obtaining 32 | a copy of this software and associated documentation files (the 33 | "Software"), to deal in the Software without restriction, including 34 | without limitation the rights to use, copy, modify, merge, publish, 35 | distribute, sublicense, and/or sell copies of the Software, and to 36 | permit persons to whom the Software is furnished to do so, subject to 37 | the following conditions: 38 | 39 | The above copyright notice and this permission notice shall be 40 | included in all copies or substantial portions of the Software. 41 | 42 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 43 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 44 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 45 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 46 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 47 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 48 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 49 | 50 | Generated by CocoaPods - https://cocoapods.org 51 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Ramiel/Pods-Ramiel-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2011–2015 Alamofire Software Foundation (http://alamofire.org/) 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | AFNetworking 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Copyright (c) 2010-2015, Sam Soffes, https://soff.es 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining 49 | a copy of this software and associated documentation files (the 50 | "Software"), to deal in the Software without restriction, including 51 | without limitation the rights to use, copy, modify, merge, publish, 52 | distribute, sublicense, and/or sell copies of the Software, and to 53 | permit persons to whom the Software is furnished to do so, subject to 54 | the following conditions: 55 | 56 | The above copyright notice and this permission notice shall be 57 | included in all copies or substantial portions of the Software. 58 | 59 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 60 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 61 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 62 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 63 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 64 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 65 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 66 | 67 | License 68 | MIT 69 | Title 70 | SSZipArchive 71 | Type 72 | PSGroupSpecifier 73 | 74 | 75 | FooterText 76 | Generated by CocoaPods - https://cocoapods.org 77 | Title 78 | 79 | Type 80 | PSGroupSpecifier 81 | 82 | 83 | StringsTable 84 | Acknowledgements 85 | Title 86 | Acknowledgements 87 | 88 | 89 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Ramiel/Pods-Ramiel-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Ramiel : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Ramiel 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Ramiel/Pods-Ramiel-frameworks-Debug-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-Ramiel/Pods-Ramiel-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework 3 | ${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Ramiel/Pods-Ramiel-frameworks-Debug-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework 2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Ramiel/Pods-Ramiel-frameworks-Release-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-Ramiel/Pods-Ramiel-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework 3 | ${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Ramiel/Pods-Ramiel-frameworks-Release-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework 2 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Ramiel/Pods-Ramiel-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_RamielVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_RamielVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Ramiel/Pods-Ramiel.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/SSZipArchive" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SSZipArchive/SSZipArchive.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -l"iconv" -l"z" -framework "AFNetworking" -framework "CoreServices" -framework "SSZipArchive" -framework "Security" -framework "SystemConfiguration" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Ramiel/Pods-Ramiel.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_Ramiel { 2 | umbrella header "Pods-Ramiel-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Ramiel/Pods-Ramiel.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/SSZipArchive" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking/AFNetworking.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/SSZipArchive/SSZipArchive.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -l"iconv" -l"z" -framework "AFNetworking" -framework "CoreServices" -framework "SSZipArchive" -framework "Security" -framework "SystemConfiguration" 7 | PODS_BUILD_DIR = ${BUILD_DIR} 8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SSZipArchive/SSZipArchive-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.2.3 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SSZipArchive/SSZipArchive-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SSZipArchive : NSObject 3 | @end 4 | @implementation PodsDummy_SSZipArchive 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SSZipArchive/SSZipArchive-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SSZipArchive/SSZipArchive-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "SSZipArchive.h" 14 | #import "SSZipCommon.h" 15 | #import "ZipArchive.h" 16 | 17 | FOUNDATION_EXPORT double SSZipArchiveVersionNumber; 18 | FOUNDATION_EXPORT const unsigned char SSZipArchiveVersionString[]; 19 | 20 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SSZipArchive/SSZipArchive.debug.xcconfig: -------------------------------------------------------------------------------- 1 | BUILD_LIBRARY_FOR_DISTRIBUTION = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | CODE_SIGN_IDENTITY = 4 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SSZipArchive 5 | DEFINES_MODULE = YES 6 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HAVE_INTTYPES_H HAVE_PKCRYPT HAVE_STDINT_H HAVE_WZAES HAVE_ZLIB 7 | OTHER_LDFLAGS = $(inherited) -l"iconv" -l"z" -framework "Security" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_ROOT = ${SRCROOT} 11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SSZipArchive 12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 13 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 14 | SKIP_INSTALL = YES 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SSZipArchive/SSZipArchive.modulemap: -------------------------------------------------------------------------------- 1 | framework module SSZipArchive { 2 | umbrella header "SSZipArchive-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SSZipArchive/SSZipArchive.release.xcconfig: -------------------------------------------------------------------------------- 1 | BUILD_LIBRARY_FOR_DISTRIBUTION = YES 2 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO 3 | CODE_SIGN_IDENTITY = 4 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SSZipArchive 5 | DEFINES_MODULE = YES 6 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HAVE_INTTYPES_H HAVE_PKCRYPT HAVE_STDINT_H HAVE_WZAES HAVE_ZLIB 7 | OTHER_LDFLAGS = $(inherited) -l"iconv" -l"z" -framework "Security" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_ROOT = ${SRCROOT} 11 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SSZipArchive 12 | PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates 13 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 14 | SKIP_INSTALL = YES 15 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ramiel 2 | An open-source, multipurpose macOS utility for checkm8-vulnerable iOS/iPadOS devices. 3 | 4 | Supported by macOS 10.13 -> 11.X. High Sierra has not been tested but should work fine. Anything lower is unsupported. 5 | 6 | Ramiel is currently broken on M1 macs. Most tools for putting devices into PWNDFU mode are broken on M1 macs, an update will be pushed when this is fixed. 7 | 8 | Ramiel will also not work on any pre-2012 macbooks/pros. As with M1 macs, most tools for putting devices into PWNDFU mode are broken for these old machines. 9 | 10 | 11 | # FAQs 12 | See [Ramiel.app](https://ramiel.app) for a list of FAQs. 13 | 14 | # Usage 15 | 1. Navigate to the [releases page](https://github.com/MatthewPierson/Ramiel/releases) and download the latest build of Ramiel 16 | 2. Open the .dmg and move Ramiel.app to `/Applications` 17 | 3. Open Ramiel.app 18 | 4. Follow the setup prompts and allow Ramiel to download some tools 19 | 5. Connect a checkm8-compatible device in DFU mode 20 | 6. Have fun! 21 | 22 | # Building 23 | 1. Install brew ```/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"``` 24 | 2. Install cocoapods ```brew install cocoapods``` 25 | 3. Install libirecovery ```brew install libirecovery``` 26 | 4. Install libusb ```brew install libusb``` 27 | 5. Install curl ```brew install curl``` 28 | 6. Install libpng ```brew install libpng``` 29 | 7. Install usbmuxd ```brew install usbmuxd``` 30 | 8. Install git ```brew install git``` 31 | 9. Clone the project ```git clone --recursive https://github.com/MatthewPierson/Ramiel``` 32 | 10. Change directory into Ramiel ```cd Ramiel``` 33 | 11. run ```pod install``` 34 | 12. Open a new Finder window and go to /usr/local/Cellar/ 35 | 13. Open Ramiel.xcworkspace and, in the top left corner, click Ramiel 36 | 14. Once in the new tab, select the Ramiel target 37 | 15. ![tab](images/Project.png?raw=true) 38 | 16. Go down to ```Frameworks, Libraries, and Embedded Content``` 39 | 17. ![libraries](images/dylibs.png?raw=true) 40 | 18. For any dylib that is greyed out, go back to that finder window and find the name of the tool, wheather that be libirecovery or curl 41 | 19. Select the dylib in xcode and hit the ```-``` button. 42 | 20. ![select](images/selection.png?raw=true) 43 | 21. In finder, go to, for example ```/usr/local/Cellar/libirecovery/VERSION/lib/libirecovery-VERSION.dylib```, and drag that into the ```Frameworks, Libraries, and Embedded Content``` section. 44 | 22. Repeat this for all the things grayed out. 45 | 23. Finally go to Signing & Capabilities and change the Development team to yours, and you should now be able to compile! 46 | 47 | 48 | # Issues 49 | If you run into any bugs or issues with Ramiel, please [open an issue](https://github.com/MatthewPierson/Ramiel/issues) using the included templates. Please check for any similar issues that have already been opened before creating a new issue. 50 | 51 | # Credits 52 | See [Ramiel.app](https://ramiel.app)'s credits section. 53 | -------------------------------------------------------------------------------- /Ramiel.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 13 | 15 | 16 | 18 | 19 | 20 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Ramiel.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Ramiel.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Ramiel.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Ramiel.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Ramiel.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Ramiel.xcworkspace/xcshareddata/xcschemes/Ramiel.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 46 | 49 | 50 | 51 | 52 | 54 | 60 | 61 | 62 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /Ramiel/APNonceSetterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // APNonceSetterViewController.h 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 4/03/21. 6 | // Copyright © 2021 moski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface APNonceSetterViewController : NSViewController 12 | 13 | @property (weak) IBOutlet NSButton *backButton; 14 | @property (weak) IBOutlet NSTextField *generatorEntry; 15 | @property (weak) IBOutlet NSButton *setNonceButton; 16 | @property (weak) IBOutlet NSTextField *label; 17 | @property (weak) IBOutlet NSProgressIndicator *prog; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Ramiel/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 9/08/20. 6 | // Copyright © 2020 moski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Ramiel/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 9/08/20. 6 | // Copyright © 2020 moski. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 18 | // Insert code here to initialize your application 19 | [[NSApplication sharedApplication] keyWindow].alphaValue = 0.99; 20 | } 21 | 22 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 23 | // Insert code here to tear down your application 24 | } 25 | 26 | - (BOOL)applicationShouldTerminateAfterLastWindowClosed: 27 | (NSApplication *)application { // Make app fully close when exit is pressed 28 | // Can also have a popup show here if I'd like :) Might come in handy sometime 29 | return YES; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Ramiel/Assets.xcassets/AppIcon.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/Assets.xcassets/AppIcon.appiconset/1024.png -------------------------------------------------------------------------------- /Ramiel/Assets.xcassets/AppIcon.appiconset/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/Assets.xcassets/AppIcon.appiconset/128.png -------------------------------------------------------------------------------- /Ramiel/Assets.xcassets/AppIcon.appiconset/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/Assets.xcassets/AppIcon.appiconset/16.png -------------------------------------------------------------------------------- /Ramiel/Assets.xcassets/AppIcon.appiconset/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/Assets.xcassets/AppIcon.appiconset/256.png -------------------------------------------------------------------------------- /Ramiel/Assets.xcassets/AppIcon.appiconset/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/Assets.xcassets/AppIcon.appiconset/32.png -------------------------------------------------------------------------------- /Ramiel/Assets.xcassets/AppIcon.appiconset/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/Assets.xcassets/AppIcon.appiconset/512.png -------------------------------------------------------------------------------- /Ramiel/Assets.xcassets/AppIcon.appiconset/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/Assets.xcassets/AppIcon.appiconset/64.png -------------------------------------------------------------------------------- /Ramiel/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "16.png", 5 | "idiom" : "mac", 6 | "scale" : "1x", 7 | "size" : "16x16" 8 | }, 9 | { 10 | "filename" : "32.png", 11 | "idiom" : "mac", 12 | "scale" : "2x", 13 | "size" : "16x16" 14 | }, 15 | { 16 | "filename" : "32.png", 17 | "idiom" : "mac", 18 | "scale" : "1x", 19 | "size" : "32x32" 20 | }, 21 | { 22 | "filename" : "64.png", 23 | "idiom" : "mac", 24 | "scale" : "2x", 25 | "size" : "32x32" 26 | }, 27 | { 28 | "filename" : "128.png", 29 | "idiom" : "mac", 30 | "scale" : "1x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "filename" : "256.png", 35 | "idiom" : "mac", 36 | "scale" : "2x", 37 | "size" : "128x128" 38 | }, 39 | { 40 | "filename" : "256.png", 41 | "idiom" : "mac", 42 | "scale" : "1x", 43 | "size" : "256x256" 44 | }, 45 | { 46 | "filename" : "512.png", 47 | "idiom" : "mac", 48 | "scale" : "2x", 49 | "size" : "256x256" 50 | }, 51 | { 52 | "filename" : "512.png", 53 | "idiom" : "mac", 54 | "scale" : "1x", 55 | "size" : "512x512" 56 | }, 57 | { 58 | "filename" : "1024.png", 59 | "idiom" : "mac", 60 | "scale" : "2x", 61 | "size" : "512x512" 62 | } 63 | ], 64 | "info" : { 65 | "author" : "xcode", 66 | "version" : 1 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Ramiel/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Ramiel/Assets.xcassets/image.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "image.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Ramiel/Assets.xcassets/image.imageset/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/Assets.xcassets/image.imageset/image.png -------------------------------------------------------------------------------- /Ramiel/CreditsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CreditsViewController.h 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 7/03/21. 6 | // Copyright © 2021 moski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CreditsViewController : NSViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Ramiel/CreditsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CreditsViewController.m 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 7/03/21. 6 | // Copyright © 2021 moski. All rights reserved. 7 | // 8 | 9 | #import "CreditsViewController.h" 10 | 11 | @implementation CreditsViewController 12 | 13 | - (void)viewDidLoad { 14 | [super viewDidLoad]; 15 | self.preferredContentSize = NSMakeSize(self.view.frame.size.width, self.view.frame.size.height); 16 | } 17 | - (IBAction)backButton:(id)sender { 18 | [self.view.window.contentViewController dismissViewController:self]; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Ramiel/DependenciesViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DependenciesViewController.h 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 12/03/21. 6 | // Copyright © 2021 moski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DependenciesViewController : NSViewController 12 | 13 | @property (weak) IBOutlet NSTextField *topLabel; 14 | @property (weak) IBOutlet NSTextField *neededToolsLabel; 15 | @property (weak) IBOutlet NSButton *goButton; 16 | @property (weak) IBOutlet NSProgressIndicator *spinner; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Ramiel/Device.h: -------------------------------------------------------------------------------- 1 | // 2 | // Device.h 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 9/02/21. 6 | // Copyright © 2021 moski. All rights reserved. 7 | // 8 | 9 | #include "libirecovery.h" 10 | #import 11 | 12 | @interface Device : NSObject 13 | // Device Object Properties 14 | @property (nonatomic, readwrite) irecv_client_t client; 15 | @property (assign, readwrite) irecv_device_t device; 16 | @property (assign, readwrite) struct irecv_device_info device_info; 17 | @property (assign, readwrite) irecv_error_t error; 18 | @property (nonatomic, readwrite) NSString *model; 19 | @property (nonatomic, readwrite) NSString *cpid; 20 | @property (nonatomic, readwrite) NSString *bdid; 21 | @property (nonatomic, readwrite) NSString *hardware_model; 22 | @property (nonatomic, readwrite) NSString *srtg; 23 | @property (nonatomic, readwrite) NSString *serial_string; 24 | @property (nonatomic, readwrite) uint64_t ecid; 25 | @property (nonatomic, readwrite) int closed; 26 | // Init // 27 | - (id)initDeviceID; 28 | // Getters // 29 | - (NSString *)getModel; 30 | - (NSString *)getCpid; 31 | - (NSString *)getBdid; 32 | - (NSString *)getHardware_model; 33 | - (NSString *)getSrtg; 34 | - (NSString *)getSerial_string; 35 | - (uint64_t)getEcid; 36 | - (int)getClosedState; 37 | - (irecv_client_t)getIRECVClient; 38 | - (irecv_error_t)getIRECVError; 39 | - (irecv_device_t)getIRECVDevice; 40 | - (struct irecv_device_info)getIRECVDeviceInfo; 41 | // Setters // 42 | - (void)setModel:(NSString *)modelString; 43 | - (void)setCpid:(NSString *)CPIDString; 44 | - (void)setBdid:(NSString *)BDIDString; 45 | - (void)setHardware_model:(NSString *)Hardware_ModelString; 46 | - (void)setSrtg:(NSString *)SRTGString; 47 | - (void)setSerial_string:(NSString *)Serial_string; 48 | - (void)setEcid:(uint64_t)ECIDValue; 49 | - (void)setClosedState:(int)closedState; 50 | - (void)setIRECVClient:(irecv_client_t)client; 51 | - (void)setIRECVError:(irecv_error_t)error; 52 | - (void)setIRECVDevice:(irecv_device_t)device; 53 | - (void)setIRECVDeviceInfo:(irecv_client_t)client; 54 | // Interactive Functions // 55 | - (irecv_error_t)sendImage:(NSString *)filePath; 56 | - (irecv_error_t)sendCMD:(NSString *)cmd; 57 | - (irecv_error_t)resetConnection; 58 | - (int)runCheckm8; 59 | // IRECV Related // 60 | - (void)reclaimDeviceClient; // Reclaim currently claimed device handle 61 | - (void)resetDeviceConnection; // Reset currently claimed device handle 62 | - (void)closeDeviceConnection; // Close currently claimed device handle 63 | // Teardown // 64 | - (void)teardown; 65 | // Instance // 66 | + (instancetype)initDevice; 67 | // End // 68 | @end 69 | -------------------------------------------------------------------------------- /Ramiel/Exploits/Fugu/.keep: -------------------------------------------------------------------------------- 1 | why are you poking around here? :) 2 | -------------------------------------------------------------------------------- /Ramiel/Exploits/eclipsa7000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/Exploits/eclipsa7000 -------------------------------------------------------------------------------- /Ramiel/Exploits/eclipsa7001: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/Exploits/eclipsa7001 -------------------------------------------------------------------------------- /Ramiel/Exploits/eclipsa8000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/Exploits/eclipsa8000 -------------------------------------------------------------------------------- /Ramiel/Exploits/eclipsa8003: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/Exploits/eclipsa8003 -------------------------------------------------------------------------------- /Ramiel/Exploits/iPwnder32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/Exploits/iPwnder32 -------------------------------------------------------------------------------- /Ramiel/FileMDHash.c: -------------------------------------------------------------------------------- 1 | // Standard library 2 | #include 3 | #include 4 | 5 | // Core Foundation 6 | #include 7 | 8 | // Cryptography 9 | #include 10 | 11 | // In bytes 12 | #define FileHashDefaultChunkSizeForReadingData 4096 13 | 14 | // Function 15 | CFStringRef FileMD5HashCreateWithPath(CFStringRef filePath, 16 | size_t chunkSizeForReadingData) { 17 | 18 | // Declare needed variables 19 | CFStringRef result = NULL; 20 | CFReadStreamRef readStream = NULL; 21 | 22 | // Get the file URL 23 | CFURLRef fileURL = 24 | CFURLCreateWithFileSystemPath(kCFAllocatorDefault, 25 | (CFStringRef)filePath, 26 | kCFURLPOSIXPathStyle, 27 | (Boolean)false); 28 | if (!fileURL) goto done; 29 | 30 | // Create and open the read stream 31 | readStream = CFReadStreamCreateWithFile(kCFAllocatorDefault, 32 | (CFURLRef)fileURL); 33 | if (!readStream) goto done; 34 | bool didSucceed = (bool)CFReadStreamOpen(readStream); 35 | if (!didSucceed) goto done; 36 | 37 | // Initialize the hash object 38 | CC_MD5_CTX hashObject; 39 | CC_MD5_Init(&hashObject); 40 | 41 | // Make sure chunkSizeForReadingData is valid 42 | if (!chunkSizeForReadingData) { 43 | chunkSizeForReadingData = FileHashDefaultChunkSizeForReadingData; 44 | } 45 | 46 | // Feed the data to the hash object 47 | bool hasMoreData = true; 48 | while (hasMoreData) { 49 | uint8_t buffer[chunkSizeForReadingData]; 50 | CFIndex readBytesCount = CFReadStreamRead(readStream, 51 | (UInt8 *)buffer, 52 | (CFIndex)sizeof(buffer)); 53 | if (readBytesCount == -1) break; 54 | if (readBytesCount == 0) { 55 | hasMoreData = false; 56 | continue; 57 | } 58 | CC_MD5_Update(&hashObject, 59 | (const void *)buffer, 60 | (CC_LONG)readBytesCount); 61 | } 62 | 63 | // Check if the read operation succeeded 64 | didSucceed = !hasMoreData; 65 | 66 | // Compute the hash digest 67 | unsigned char digest[CC_MD5_DIGEST_LENGTH]; 68 | CC_MD5_Final(digest, &hashObject); 69 | 70 | // Abort if the read operation failed 71 | if (!didSucceed) goto done; 72 | 73 | // Compute the string result 74 | char hash[2 * sizeof(digest) + 1]; 75 | for (size_t i = 0; i < sizeof(digest); ++i) { 76 | snprintf(hash + (2 * i), 3, "%02x", (int)(digest[i])); 77 | } 78 | result = CFStringCreateWithCString(kCFAllocatorDefault, 79 | (const char *)hash, 80 | kCFStringEncodingUTF8); 81 | 82 | done: 83 | 84 | if (readStream) { 85 | CFReadStreamClose(readStream); 86 | CFRelease(readStream); 87 | } 88 | if (fileURL) { 89 | CFRelease(fileURL); 90 | } 91 | return result; 92 | } 93 | -------------------------------------------------------------------------------- /Ramiel/FileMDHash.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FileMDHash_h 3 | #define FileMDHash_h 4 | 5 | #include 6 | 7 | CFStringRef FileMD5HashCreateWithPath(CFStringRef filePath, size_t chunkSizeForReadingData); 8 | 9 | #endif /* FileMDHash_h */ 10 | -------------------------------------------------------------------------------- /Ramiel/FirmwareKeys.h: -------------------------------------------------------------------------------- 1 | // 2 | // FirmwareKeys.h 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 28/03/21. 6 | // Copyright © 2021 moski. All rights reserved. 7 | // 8 | 9 | #import "Device.h" 10 | #import "IPSW.h" 11 | #import 12 | 13 | @interface FirmwareKeys : NSObject 14 | // FirmwareKeys Object Properties // 15 | @property (nonatomic, readwrite) NSString *ibssIV; 16 | @property (nonatomic, readwrite) NSString *ibssKEY; 17 | @property (nonatomic, readwrite) NSString *ibecIV; 18 | @property (nonatomic, readwrite) NSString *ibecKEY; 19 | @property (nonatomic, readwrite) NSString *kernelIV; 20 | @property (nonatomic, readwrite) NSString *kernelKEY; 21 | @property (nonatomic, readwrite) NSString *devicetreeIV; 22 | @property (nonatomic, readwrite) NSString *devicetreeKEY; 23 | @property (nonatomic, readwrite) NSString *restoreRamdiskIV; 24 | @property (nonatomic, readwrite) NSString *restoreRamdiskKEY; 25 | @property (nonatomic, readwrite) NSString *ibootIV; 26 | @property (nonatomic, readwrite) NSString *ibootKEY; 27 | @property (nonatomic, readwrite) Boolean isUsingLocalKeys; 28 | // Init // 29 | - (id)initFirmwareKeysID; 30 | // Getters // 31 | - (NSString *)getIbssIV; 32 | - (NSString *)getIbssKEY; 33 | - (NSString *)getIbecIV; 34 | - (NSString *)getIbecKEY; 35 | - (NSString *)getKernelIV; 36 | - (NSString *)getKernelKEY; 37 | - (NSString *)getDevicetreeIV; 38 | - (NSString *)getDevicetreeKEY; 39 | - (NSString *)getRestoreRamdiskIV; 40 | - (NSString *)getRestoreRamdiskKEY; 41 | - (NSString *)getIbootIV; 42 | - (NSString *)getIbootKEY; 43 | - (Boolean)getUsingLocalKeys; 44 | // Setters // 45 | - (void)setIbssIV:(NSString *)ibssIV; 46 | - (void)setIbssKEY:(NSString *)ibssKEY; 47 | - (void)setIbecIV:(NSString *)ibecIV; 48 | - (void)setIbecKEY:(NSString *)ibecKEY; 49 | - (void)setKernelIV:(NSString *)kernelIV; 50 | - (void)setKernelKEY:(NSString *)kernelKEY; 51 | - (void)setDevicetreeIV:(NSString *)devicetreeIV; 52 | - (void)setDevicetreeKEY:(NSString *)devicetreeKEY; 53 | - (void)setRestoreRamdiskIV:(NSString *)restoreRamdiskIV; 54 | - (void)setRestoreRamdiskKEY:(NSString *)restoreRamdiskKEY; 55 | - (void)setIbootIV:(NSString *)ibootIV; 56 | - (void)setIbootKEY:(NSString *)ibootKEY; 57 | - (void)setIsUsingLocalKeys:(Boolean)isUsingLocalKeys; 58 | // Other Methods // 59 | - (Boolean)checkLocalKeys:(Device *)device:(IPSW *)ipsw; 60 | - (Boolean)writeFirmwareKeysToFile:(Device *)device:(IPSW *)ipsw; 61 | - (Boolean)readFirmwareKeysFromFile:(Device *)device:(IPSW *)ipsw; 62 | - (void)backupAllKeysForModel:(Device *)device; 63 | - (Boolean)fetchKeysFromWiki:(Device *)device:(IPSW *)ipsw:(NSDictionary *)manifest; 64 | // Teardown // 65 | - (void)teardown; 66 | // Instance // 67 | + (instancetype)initFirmwareKeys; 68 | // End // 69 | @end 70 | -------------------------------------------------------------------------------- /Ramiel/IPSW.h: -------------------------------------------------------------------------------- 1 | // 2 | // IPSW.h 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 9/02/21. 6 | // Copyright © 2021 moski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IPSW : NSObject 12 | // IPSW Object Properties 13 | @property (nonatomic, readwrite) NSString *ipswPath; 14 | @property (nonatomic, readwrite) NSString *iosVersion; 15 | @property (nonatomic, readwrite) NSMutableArray *supportedModels; 16 | @property (nonatomic, readwrite) BOOL releaseBuild; 17 | @property (nonatomic, readwrite) BOOL bootRamdisk; 18 | @property (nonatomic, readwrite) NSString *ibssName; 19 | @property (nonatomic, readwrite) NSString *ibecName; 20 | @property (nonatomic, readwrite) NSString *ibootName; 21 | @property (nonatomic, readwrite) NSString *deviceTreeName; 22 | @property (nonatomic, readwrite) NSString *trustCacheName; 23 | @property (nonatomic, readwrite) NSString *kernelName; 24 | @property (nonatomic, readwrite) NSString *aopfwName; 25 | @property (nonatomic, readwrite) NSString *callanName; 26 | @property (nonatomic, readwrite) NSString *touchName; 27 | @property (nonatomic, readwrite) NSString *ispName; 28 | @property (nonatomic, readwrite) NSString *restoreRamdiskName; 29 | @property (nonatomic, readwrite) NSString *bootargs; 30 | @property (nonatomic, readwrite) NSString *customLogoPath; 31 | // Init // 32 | - (id)initIPSWID; 33 | // Getters // 34 | - (NSString *)getIpswPath; 35 | - (NSString *)getIosVersion; 36 | - (NSMutableArray *)getSupportedModels; 37 | - (BOOL)getReleaseBuild; 38 | - (BOOL)getBootRamdisk; 39 | - (NSString *)getIbssName; 40 | - (NSString *)getIbecName; 41 | - (NSString *)getIbootName; 42 | - (NSString *)getDeviceTreeName; 43 | - (NSString *)getTrustCacheName; 44 | - (NSString *)getKernelName; 45 | - (NSString *)getAopfwName; 46 | - (NSString *)getCallanName; 47 | - (NSString *)getTouchName; 48 | - (NSString *)getIspName; 49 | - (NSString *)getRestoreRamdiskName; 50 | - (NSString *)getBootargs; 51 | - (NSString *)getCustomLogoPath; 52 | // Setters // 53 | - (void)setIpswPath:(NSString *)ipswPath; 54 | - (void)setIosVersion:(NSString *)iosVersion; 55 | - (void)setSupportedModels:(NSMutableArray *)supportedModels; 56 | - (void)setReleaseBuild:(BOOL)releaseBuild; 57 | - (void)setBootRamdisk:(BOOL)bootRamdisk; 58 | - (void)setIbssName:(NSString *)ibssName; 59 | - (void)setIbecName:(NSString *)ibecName; 60 | - (void)setIbootName:(NSString *)ibootName; 61 | - (void)setDeviceTreeName:(NSString *)deviceTreeName; 62 | - (void)setTrustCacheName:(NSString *)trustCacheName; 63 | - (void)setKernelName:(NSString *)kernelName; 64 | - (void)setAopfwName:(NSString *)aopfwName; 65 | - (void)setCallanName:(NSString *)callanName; 66 | - (void)setTouchName:(NSString *)touchName; 67 | - (void)setIspName:(NSString *)ispName; 68 | - (void)setRestoreRamdiskName:(NSString *)restoreRamdiskName; 69 | - (void)setBootargs:(NSString *)bootargs; 70 | - (void)setCustomLogoPath:(NSString *)customLogoPath; 71 | // Teardown // 72 | - (void)teardown; 73 | // Instance // 74 | + (instancetype)initIPSW; 75 | // End // 76 | @end 77 | -------------------------------------------------------------------------------- /Ramiel/IPSW.m: -------------------------------------------------------------------------------- 1 | // 2 | // IPSW.m 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 9/02/21. 6 | // Copyright © 2021 moski. All rights reserved. 7 | // 8 | 9 | #import "IPSW.h" 10 | #import 11 | 12 | @implementation IPSW 13 | 14 | - (id)initIPSWID { 15 | self = [super self]; 16 | if (self) { 17 | return self; 18 | } 19 | return NULL; 20 | } 21 | - (NSString *)getIpswPath { 22 | return self.ipswPath; 23 | }; 24 | - (NSString *)getIosVersion { 25 | return self.iosVersion; 26 | }; 27 | - (NSMutableArray *)getSupportedModels { 28 | return self.supportedModels; 29 | }; 30 | - (BOOL)getReleaseBuild { 31 | return self.releaseBuild; 32 | }; 33 | - (BOOL)getBootRamdisk { 34 | return self.bootRamdisk; 35 | } 36 | - (NSString *)getIbssName { 37 | return self.ibssName; 38 | }; 39 | - (NSString *)getIbecName { 40 | return self.ibecName; 41 | }; 42 | - (NSString *)getIbootName { 43 | return self.ibootName; 44 | }; 45 | - (NSString *)getDeviceTreeName { 46 | return self.deviceTreeName; 47 | }; 48 | - (NSString *)getTrustCacheName { 49 | return self.trustCacheName; 50 | }; 51 | - (NSString *)getKernelName { 52 | return self.kernelName; 53 | }; 54 | - (NSString *)getAopfwName { 55 | return self.aopfwName; 56 | }; 57 | - (NSString *)getCallanName { 58 | return self.callanName; 59 | }; 60 | - (NSString *)getTouchName { 61 | return self.touchName; 62 | }; 63 | - (NSString *)getIspName { 64 | return self.ispName; 65 | }; 66 | - (NSString *)getRestoreRamdiskName { 67 | return self.restoreRamdiskName; 68 | }; 69 | - (NSString *)getBootargs { 70 | return self.bootargs; 71 | }; 72 | - (NSString *)getCustomLogoPath { 73 | return self.customLogoPath; 74 | }; 75 | - (void)teardown { 76 | [self setIpswPath:NULL]; 77 | [self setIosVersion:NULL]; 78 | [self setSupportedModels:NULL]; 79 | [self setReleaseBuild:(BOOL)NULL]; 80 | [self setIbssName:NULL]; 81 | [self setIbecName:NULL]; 82 | [self setIbootName:NULL]; 83 | [self setDeviceTreeName:NULL]; 84 | [self setTrustCacheName:NULL]; 85 | [self setKernelName:NULL]; 86 | [self setAopfwName:NULL]; 87 | [self setCallanName:NULL]; 88 | [self setTouchName:NULL]; 89 | [self setIspName:NULL]; 90 | [self setRestoreRamdiskName:NULL]; 91 | [self setBootargs:NULL]; 92 | [self setCustomLogoPath:NULL]; 93 | } 94 | + (instancetype)initIPSW { 95 | return [[IPSW alloc] initIPSWID]; 96 | } 97 | @end 98 | -------------------------------------------------------------------------------- /Ramiel/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | LSApplicationCategoryType 24 | public.app-category.utilities 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | cdn-apple.com 32 | 33 | NSIncludesSubdomains 34 | 35 | NSTemporaryExceptionAllowsInsecureHTTPLoads 36 | 37 | 38 | 39 | 40 | NSHumanReadableCopyright 41 | Copyright © 2020 moski. All rights reserved. 42 | NSMainStoryboardFile 43 | Main 44 | NSPrincipalClass 45 | NSApplication 46 | NSSupportsAutomaticTermination 47 | 48 | NSSupportsSuddenTermination 49 | 50 | UIUserInterfaceStyle 51 | Dark 52 | 53 | 54 | -------------------------------------------------------------------------------- /Ramiel/Ramiel.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.cs.disable-library-validation 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Ramiel/RamielRelease.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.cs.disable-library-validation 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Ramiel/RamielView.h: -------------------------------------------------------------------------------- 1 | // 2 | // RamielView.h 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 9/08/20. 6 | // Copyright © 2020 moski. All rights reserved. 7 | // 8 | 9 | #import "Device.h" 10 | #import "IPSW.h" 11 | #include "libirecovery.h" 12 | #import 13 | #define FileHashDefaultChunkSizeForReadingData 4096 14 | 15 | @interface RamielView : NSViewController 16 | 17 | @property (weak) IBOutlet NSTextField *infoLabel; 18 | @property (weak) IBOutlet NSTextField *modelLabel; 19 | @property (strong, nonatomic) NSString *deviceModel; 20 | @property (strong, nonatomic) NSString *deviceECID; 21 | @property (strong, nonatomic) NSString *deviceAPNONCE; 22 | @property (weak) IBOutlet NSTextField *titleLabel; 23 | @property (weak) IBOutlet NSProgressIndicator *bootProgBar; 24 | @property (weak) IBOutlet NSButton *bootButton; 25 | @property (weak) IBOutlet NSButton *settingsButton; 26 | @property (weak) IBOutlet NSTextField *downloadLabel; 27 | @property (weak) IBOutlet NSTextField *secretLabel; 28 | @property (weak) IBOutlet NSButton *selIPSWButton; 29 | @property (weak) IBOutlet NSButton *dlIPSWButton; 30 | @property (weak) IBOutlet NSComboBox *comboBoxList; 31 | @property (weak) IBOutlet NSButton *dlButton; 32 | 33 | + (NSString *)img4toolCMD:(NSString *)cmd; 34 | + (NSString *)otherCMD:(NSString *)cmd; 35 | + (irecv_client_t)getClientExternal; 36 | + (IPSW *)getIpswInfoExternal; 37 | + (Device *)getConnectedDeviceInfo; 38 | + (void)errorHandler:(NSString *)errorMessage:(NSString *)errorTitle:(NSString *)detailedMessage; 39 | + (int)downloadFileFromIPSW:(NSString *)url:(NSString *)path:(NSString *)outpath; 40 | + (int)debugCheck; 41 | + (void)stopBackground; 42 | + (void)startBackground; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Ramiel/SHSHDumperViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHSHDumperViewController.h 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 21/02/21. 6 | // Copyright © 2021 moski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SHSHDumperViewController : NSViewController 12 | 13 | @property (weak) IBOutlet NSTextField *label; 14 | @property (weak) IBOutlet NSProgressIndicator *prog; 15 | @property (weak) IBOutlet NSButton *dumpSHSHButton; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Ramiel/SHSHViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHSHViewController.h 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 2/01/21. 6 | // Copyright © 2021 moski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SHSHViewController : NSViewController 12 | 13 | @property (weak) IBOutlet NSTextField *label; 14 | @property (weak) IBOutlet NSProgressIndicator *prog; 15 | @property (weak) IBOutlet NSButton *conanButton; 16 | @property (weak) IBOutlet NSButton *shshHostButton; 17 | @property (weak) IBOutlet NSButton *download; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Ramiel/SettingsView.h: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsView.h 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 5/09/20. 6 | // Copyright © 2020 moski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SettingsView : NSViewController 12 | 13 | @property (weak) IBOutlet NSTextField *titleLabel; 14 | @property (weak) IBOutlet NSButton *bootargsCheck; 15 | @property (weak) IBOutlet NSButton *bootlogoCheck; 16 | @property (weak) IBOutlet NSButton *bootlogoButton; 17 | @property (weak) IBOutlet NSButton *bootargsButton; 18 | @property (weak) IBOutlet NSButton *dualbootCheck; 19 | @property (weak) IBOutlet NSButton *dualbootButton; 20 | @property (weak) IBOutlet NSButton *ignoreIPSWVerification; 21 | @property (weak) IBOutlet NSButton *apnonceButton; 22 | @property (weak) IBOutlet NSButton *toggleDebugMode; 23 | @property (weak) IBOutlet NSButton *amfiToggle; 24 | @property (weak) IBOutlet NSButton *amsdToggle; 25 | @property (weak) IBOutlet NSButton *dumpSHSH; 26 | @property (weak) IBOutlet NSButton *exitRecMode; 27 | @property (weak) IBOutlet NSButton *showSHSH; 28 | @property (weak) IBOutlet NSButton *localSHSHButton; 29 | @property (weak) IBOutlet NSButton *backupFirmwareKeysButton; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Ramiel/bootlogo.im4p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/bootlogo.im4p -------------------------------------------------------------------------------- /Ramiel/iPatcher: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/iPatcher -------------------------------------------------------------------------------- /Ramiel/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 9/08/20. 6 | // Copyright © 2020 moski. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char *argv[]) { 12 | 13 | @autoreleasepool { 14 | // Setup code that might create autoreleased objects goes here. 15 | } 16 | return NSApplicationMain(argc, argv); 17 | } 18 | -------------------------------------------------------------------------------- /Ramiel/partial.h: -------------------------------------------------------------------------------- 1 | /** 2 | * libpartialzip-1.0 - libpartialzip.h 3 | * Copyright (C) 2010 David Wang 4 | * 5 | * Modified by: 6 | * Copyright (C) 2010-2013 Joshua Hill 7 | * 8 | * This program is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | **/ 21 | 22 | #ifndef LIBPARTIAL_H 23 | #define LIBPARTIAL_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #ifdef _WIN32 34 | #ifndef _MSC_VER 35 | #define _MSC_VER 36 | #endif 37 | #define fseeko fseeko64 38 | #define ftello ftello64 39 | #define off_t off64_t 40 | #define mkdir(x, y) mkdir(x) 41 | #define PATH_SEPARATOR "\\" 42 | #define sleep(n) Sleep(1000 * n) 43 | #else 44 | #define PATH_SEPARATOR "/" 45 | #endif 46 | 47 | #ifdef _MSC_VER 48 | #define STATIC_INLINE static __inline 49 | #else 50 | #define STATIC_INLINE static inline 51 | #endif 52 | 53 | #define TRUE 1 54 | #define FALSE 0 55 | 56 | #define FLIPENDIAN(x) flipEndian((unsigned char *)(&(x)), sizeof(x)) 57 | #define FLIPENDIANLE(x) flipEndianLE((unsigned char *)(&(x)), sizeof(x)) 58 | 59 | #define IS_BIG_ENDIAN 0 60 | #define IS_LITTLE_ENDIAN 1 61 | 62 | #define TIME_OFFSET_FROM_UNIX 2082844800L 63 | #define APPLE_TO_UNIX_TIME(x) ((x)-TIME_OFFSET_FROM_UNIX) 64 | #define UNIX_TO_APPLE_TIME(x) ((x) + TIME_OFFSET_FROM_UNIX) 65 | 66 | #define ASSERT(x, m) \ 67 | if (!(x)) { \ 68 | fflush(stdout); \ 69 | fprintf(stderr, "error: %s\n", m); \ 70 | perror("error"); \ 71 | fflush(stderr); \ 72 | exit(1); \ 73 | } 74 | 75 | extern char endianness; 76 | 77 | STATIC_INLINE void flipEndian(unsigned char *x, int length) { 78 | int i; 79 | unsigned char tmp; 80 | 81 | if (endianness == IS_BIG_ENDIAN) { 82 | return; 83 | } else { 84 | for (i = 0; i < (length / 2); i++) { 85 | tmp = x[i]; 86 | x[i] = x[length - i - 1]; 87 | x[length - i - 1] = tmp; 88 | } 89 | } 90 | } 91 | 92 | STATIC_INLINE void flipEndianLE(unsigned char *x, int length) { 93 | int i; 94 | unsigned char tmp; 95 | 96 | if (endianness == IS_LITTLE_ENDIAN) { 97 | return; 98 | } else { 99 | for (i = 0; i < (length / 2); i++) { 100 | tmp = x[i]; 101 | x[i] = x[length - i - 1]; 102 | x[length - i - 1] = tmp; 103 | } 104 | } 105 | } 106 | 107 | STATIC_INLINE void hexToBytes(const char *hex, uint8_t **buffer, size_t *bytes) { 108 | size_t i; 109 | *bytes = strlen(hex) / 2; 110 | *buffer = (uint8_t *)malloc(*bytes); 111 | for (i = 0; i < *bytes; i++) { 112 | uint32_t byte; 113 | sscanf(hex, "%2x", &byte); 114 | (*buffer)[i] = byte; 115 | hex += 2; 116 | } 117 | } 118 | 119 | STATIC_INLINE void hexToInts(const char *hex, unsigned int **buffer, size_t *bytes) { 120 | size_t i; 121 | *bytes = strlen(hex) / 2; 122 | *buffer = (unsigned int *)malloc((*bytes) * sizeof(int)); 123 | for (i = 0; i < *bytes; i++) { 124 | sscanf(hex, "%2x", &((*buffer)[i])); 125 | hex += 2; 126 | } 127 | } 128 | 129 | struct io_func_struct; 130 | 131 | typedef int (*partial_zip_read)(struct io_func_struct *io, off_t location, size_t size, void *buffer); 132 | typedef int (*partial_zip_write)(struct io_func_struct *io, off_t location, size_t size, void *buffer); 133 | typedef void (*partial_zip_close)(struct io_func_struct *io); 134 | 135 | typedef struct { 136 | void *data; 137 | partial_zip_read read; 138 | partial_zip_write write; 139 | partial_zip_close close; 140 | } partialzip_io_funcs; 141 | 142 | #ifdef _MSC_VER 143 | #define ATTRIBUTE_PACKED 144 | #pragma pack(push) 145 | #pragma pack(1) 146 | #else 147 | #define ATTRIBUTE_PACKED __attribute__((packed)) 148 | #endif 149 | 150 | typedef struct { 151 | uint32_t signature; 152 | uint16_t diskNo; 153 | uint16_t CDDiskNo; 154 | uint16_t CDDiskEntries; 155 | uint16_t CDEntries; 156 | uint32_t CDSize; 157 | uint32_t CDOffset; 158 | uint16_t lenComment; 159 | } ATTRIBUTE_PACKED partialzip_end_of_cd_t; 160 | 161 | typedef struct { 162 | uint32_t signature; 163 | uint16_t version; 164 | uint16_t versionExtract; 165 | uint16_t flags; 166 | uint16_t method; 167 | uint16_t modTime; 168 | uint16_t modDate; 169 | uint32_t crc32; 170 | uint32_t compressedSize; 171 | uint32_t size; 172 | uint16_t lenFileName; 173 | uint16_t lenExtra; 174 | uint16_t lenComment; 175 | uint16_t diskStart; 176 | uint16_t internalAttr; 177 | uint32_t externalAttr; 178 | uint32_t offset; 179 | } ATTRIBUTE_PACKED partialzip_file_t; 180 | 181 | typedef struct { 182 | uint32_t signature; 183 | uint16_t versionExtract; 184 | uint16_t flags; 185 | uint16_t method; 186 | uint16_t modTime; 187 | uint16_t modDate; 188 | uint32_t crc32; 189 | uint32_t compressedSize; 190 | uint32_t size; 191 | uint16_t lenFileName; 192 | uint16_t lenExtra; 193 | } ATTRIBUTE_PACKED partialzip_local_file_t; 194 | 195 | #ifdef _MSC_VER 196 | #pragma pack(pop) 197 | #endif 198 | 199 | typedef struct partialzip_info partialzip_t; 200 | 201 | typedef void (*partialzip_progress_callback_t)(partialzip_t *info, partialzip_file_t *file, size_t progress); 202 | 203 | struct partialzip_info { 204 | char *url; 205 | uint64_t length; 206 | CURL *hIPSW; 207 | char *centralDirectory; 208 | size_t centralDirectoryRecvd; 209 | partialzip_end_of_cd_t *centralDirectoryDesc; 210 | char centralDirectoryEnd[0xffff + sizeof(partialzip_end_of_cd_t)]; 211 | size_t centralDirectoryEndRecvd; 212 | partialzip_progress_callback_t progressCallback; 213 | }; 214 | 215 | partialzip_t *partialzip_open(const char *url); 216 | partialzip_file_t *partialzip_find_file(partialzip_t *info, const char *fileName); 217 | partialzip_file_t *partialzip_list_files(partialzip_t *info); 218 | unsigned char *partialzip_get_file(partialzip_t *info, partialzip_file_t *file); 219 | void partialzip_close(partialzip_t *info); 220 | int partialzip_download_file(const char *url, const char *path, const char *output); 221 | void partialzip_set_progress_callback(partialzip_t *info, partialzip_progress_callback_t progressCallback); 222 | void partialzip_free_file(partialzip_file_t *file); 223 | 224 | #ifdef __cplusplus 225 | } 226 | #endif 227 | 228 | #endif 229 | -------------------------------------------------------------------------------- /Ramiel/ssh/Kernel64Patcher: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/ssh/Kernel64Patcher -------------------------------------------------------------------------------- /Ramiel/ssh/Kernel64PatcherA: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/ssh/Kernel64PatcherA -------------------------------------------------------------------------------- /Ramiel/ssh/Kernel64PatcherB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/ssh/Kernel64PatcherB -------------------------------------------------------------------------------- /Ramiel/ssh/compare.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020, @mcg29_ 2 | # Modified from https://github.com/dualbootfun/dualbootfun.github.io/blob/master/source/compareFiles.py 3 | 4 | #!/usr/local/bin/python3 5 | 6 | import os 7 | import sys 8 | import shutil 9 | 10 | if __name__ == "__main__": 11 | args = sys.argv 12 | if len(args) < 3: 13 | print("Usage: kcache.raw kcache.patched") 14 | sys.exit(0) 15 | patched = open(args[2], "rb").read() 16 | original = open(args[1], "rb").read() 17 | test1 = open(args[2], "rb").read(28) 18 | test2 = open(args[1], "rb").read(28) 19 | lenP = len(patched) 20 | lenO = len(original) 21 | if test1 != test2 or lenP != lenO: 22 | # A10 kernels seem to not fully work with Kernel64Patcher 23 | # The start of the file is stripped, can be grabbed from raw kernel and placed back in 24 | raw = open(args[1], "rb") 25 | # CAFEBABE 00000001 0100000C 00000000 00004000 02319678 0000000E 26 | fix = b"\xca\xfe\xba\xbe\x00\x00\x00\x01\x01\x00\x00\x0c\x00\x00\x00\x00\x00\x00\x40\x00\x02\x31\x96\x78\x00\x00\x00\x0e" 27 | testPatched = open(f"{args[2]}.new", "w+b") 28 | 29 | testPatched.write(test2 + patched) 30 | 31 | testPatched.close() 32 | 33 | os.remove(args[2]) 34 | shutil.move(f"{args[2]}.new", args[2]) 35 | 36 | patched = open(args[2], "rb").read() 37 | original = open(args[1], "rb").read() 38 | lenP = len(patched) 39 | lenO = len(original) 40 | if lenP != lenO: 41 | print("Starting") 42 | # CAFEBABE 00000001 0100000C 00000000 00004000 02319678 0000000E 43 | fix = b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 44 | testPatched = open(f"{args[2]}", "w+b") 45 | testPatched.seek(41020239) 46 | testPatched.write(fix) 47 | 48 | testPatched.close() 49 | 50 | #os.remove(args[2]) 51 | #shutil.move(f"{args[2]}", args[2]) 52 | print("done") 53 | 54 | diff = [] 55 | for i in range(lenO): 56 | originalByte = original[i] 57 | patchedByte = patched[i] 58 | if originalByte != patchedByte: 59 | diff.append([hex(i),hex(originalByte), hex(patchedByte)]) 60 | diffFile = open('/tmp/kc.bpatch', 'w+') 61 | diffFile.write('#AMFI\n\n') 62 | for d in diff: 63 | data = str(d[0]) + " " + (str(d[1])) + " " + (str(d[2])) 64 | diffFile.write(data+ '\n') 65 | print(data) 66 | -------------------------------------------------------------------------------- /Ramiel/ssh/dd_ent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | platform-application 5 | 6 | com.apple.private.security.container-required 7 | 8 | com.apple.private.skip-library-validation 9 | 10 | com.apple.private.security.disk-device-access 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Ramiel/ssh/dump.py: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/python3 2 | 3 | import paramiko 4 | 5 | client = paramiko.SSHClient() 6 | client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) 7 | 8 | client.connect(hostname="localhost", password="alpine", username="root", port=2222) 9 | command = "dd if=/dev/disk1 bs=256 count=$((0x4000))" 10 | stdin, stdout, stderr = client.exec_command(command) 11 | result = stdout.read() 12 | 13 | f = open("/tmp/dump.raw", "wb") 14 | f.write(result) 15 | f.close() 16 | -------------------------------------------------------------------------------- /Ramiel/ssh/ent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.private.apfs.xart 6 | 7 | com.apple.private.security.disk-device-access 8 | 9 | com.apple.security.iokit-user-client-class 10 | 11 | AppleAPFSUserClient 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Ramiel/ssh/gtar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/ssh/gtar -------------------------------------------------------------------------------- /Ramiel/ssh/iproxy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/ssh/iproxy -------------------------------------------------------------------------------- /Ramiel/ssh/kc.bpatch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/ssh/kc.bpatch -------------------------------------------------------------------------------- /Ramiel/ssh/ldid2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/ssh/ldid2 -------------------------------------------------------------------------------- /Ramiel/ssh/sshLogo.im4p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/Ramiel/ssh/sshLogo.im4p -------------------------------------------------------------------------------- /formatCode.sh: -------------------------------------------------------------------------------- 1 | ls ./Ramiel/*.[hm] | xargs clang-format -i -style=file 2 | -------------------------------------------------------------------------------- /ibootim/ibootim.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright 2015 Pupyshev Nikita 3 | * All rights reserved 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted providing that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 18 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 22 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 23 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef __ibootim_h__ 28 | #define __ibootim_h__ 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | typedef struct ibootim ibootim; 35 | 36 | typedef enum { 37 | ibootim_color_space_grayscale = 0x67726579, // 'grey' 38 | ibootim_color_space_argb = 0x61726762 // 'argb' 39 | } ibootim_color_space_t; 40 | 41 | typedef enum { 42 | ibootim_compression_type_lzss = 0x6C7A7373, // 'lzss' 43 | } ibootim_compression_type_t; 44 | 45 | extern const char *ibootim_signature; 46 | 47 | /*! 48 | @function file_is_ibootim 49 | @abstract Checks if file is an iBoot Embedded Image file. 50 | @param path Path to the file. 51 | @result 0 if file is not an iBoot Embedded Image and 1 if it is. 52 | */ 53 | 54 | extern bool file_is_ibootim(const char *path); 55 | 56 | /*! 57 | @function ibootim_load 58 | @abstract Loads an iBoot Embedded Image file. 59 | @discussion Loads and uncompresses LZSS compressed iBoot Embedded Image file located at path 'path' and returns an ibootim image handle that represents an iBoot Embedded Image and must be closed with ibootim_close() function. This is equivalent to ibootim_load_at_index(path, handle, 0). 60 | @param path Path to the iBoot Embedded Image file. 61 | @param handle A pointer where the handle is written on success. 62 | @result UNIX error code or 0 on success. 63 | */ 64 | 65 | extern int ibootim_load(const char *path, ibootim **handle); 66 | 67 | /*! 68 | @function ibootim_load_at_index 69 | @abstract Loads an iBoot Embedded Image file at given index. 70 | @discussion Loads and uncompresses LZSS compressed iBoot Embedded Image file located at path 'path' and returns an ibootim image handle that represents an iBoot Embedded Image and must be closed with ibootim_close() function. This is used for concatenated images. 71 | @param path Path to the iBoot Embedded Image file. 72 | @param handle A pointer where the handle is written on success. 73 | @param index Index of the image in the file. 74 | @result UNIX error code or 0 on success. 75 | */ 76 | 77 | extern int ibootim_load_at_index(const char *path, ibootim **handle, unsigned int index); 78 | 79 | /*! 80 | @function ibootim_load 81 | @abstract Loads a PNG file and converts it into iBoot Embedded Image. 82 | @discussion Loads a PNG file located at path 'path', converts it into an iBoot Embedded Image and returns an ibootim image handle that represents an iBoot Embedded Image and must be closed with ibootim_close() function. 83 | @param path Path to the PNG file. 84 | @param handle A pointer where the handle is written on success. 85 | @result UNIX error code or 0 on success. 86 | */ 87 | 88 | extern int ibootim_load_png(const char *path, ibootim **handle); 89 | 90 | /*! 91 | @function ibootim_get_pixel_size 92 | @abstract Returns the size of one pixel of the image in bytes. 93 | @param image The image. 94 | @result Size of one pixel of the image. 95 | */ 96 | 97 | extern unsigned int ibootim_get_pixel_size(ibootim *image); 98 | 99 | /*! 100 | @function ibootim_write 101 | @abstract Converts the iBoot Embedded Image to a PNG image. 102 | @discussion Converts the iBoot Embedded Image to a PNG image and writes the PNG image to the specified path 103 | @param image The image. 104 | @param path The path where the PNG image will be written. 105 | @result 0 on success or an error code on error. 106 | */ 107 | 108 | extern int ibootim_write(ibootim *image, const char *path); 109 | 110 | /*! 111 | @function ibootim_write_png 112 | @abstract Writes iBoot Embedded Image to a file. 113 | @discussion Compresses and writes iBoot Embedded Image 'image' to a file at path 'path'. 114 | @param image The image. 115 | @param path The path where to write the image. 116 | @result 0 on success or -1 on error. 117 | */ 118 | 119 | extern int ibootim_write_png(ibootim *image, const char *path); 120 | 121 | /*! 122 | @function ibootim_get_expected_size 123 | @abstract Calculates expected raw content length for the image. 124 | @param image The image handle. 125 | @param path Where to write PNG file. 126 | @result Expected content length. 127 | */ 128 | 129 | extern unsigned int ibootim_get_expected_content_size(ibootim *image); 130 | 131 | /*! 132 | @function ibootim_close 133 | @abstract Destroys ibootim image handle. 134 | @param image The image handle. 135 | */ 136 | 137 | extern void ibootim_close(ibootim *image); 138 | 139 | /* Properties */ 140 | 141 | extern uint16_t ibootim_get_width(ibootim *image); 142 | extern uint16_t ibootim_get_height(ibootim *image); 143 | extern int16_t ibootim_get_x_offset(ibootim *image); 144 | extern void ibootim_set_x_offset(ibootim *image, int16_t offset); 145 | extern int16_t ibootim_get_y_offset(ibootim *image); 146 | extern void ibootim_set_y_offset(ibootim *image, int16_t offset); 147 | extern ibootim_color_space_t ibootim_get_color_space(ibootim *image); 148 | extern ibootim_compression_type_t ibootim_get_compression_type(ibootim *image); 149 | 150 | extern int ibootim_convert_to_colorspace(ibootim *image, ibootim_color_space_t targetColorSpace); 151 | extern int ibootim_count_images_in_file(const char *path, int *error); 152 | 153 | #endif /* defined(__ibootim__ibootim__) */ 154 | -------------------------------------------------------------------------------- /ibootim/ibootimMain.h: -------------------------------------------------------------------------------- 1 | // 2 | // ibootimMain.h 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 6/03/21. 6 | // Copyright © 2021 moski. All rights reserved. 7 | // 8 | 9 | #ifndef ibootimMain_h 10 | #define ibootimMain_h 11 | 12 | int ibootimMain(const char *inFile, const char *outFile); 13 | 14 | #endif /* ibootimMain_h */ 15 | -------------------------------------------------------------------------------- /ibootim/ibootim_LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015 Pupyshev Nikita 2 | All rights reserved 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted providing that the following conditions 6 | are met: 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 14 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 17 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 21 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 22 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /ibootim/lzss.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright 2015 Pupyshev Nikita 3 | * All rights reserved 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted providing that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 18 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 22 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 23 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | * POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef __ibootim__lzss__ 28 | #define __ibootim__lzss__ 29 | 30 | #include 31 | #include 32 | 33 | typedef enum { 34 | LZSS_OK, 35 | LZSS_NOMEM, 36 | LZSS_NODATA, 37 | LZSS_INVARG 38 | } lzss_error_t; 39 | 40 | /*! 41 | @function lzss_compress 42 | @abstract Compresses data using LZSS compression algorithm 43 | @param src Data to compress 44 | @param dst Buffer for the compressed data 45 | @param srclen Length of data to compress 46 | @param dstlen Length of the destination buffer 47 | @result Size of compressed data or -1 on failure. 48 | */ 49 | 50 | extern ssize_t lzss_compress(uint8_t *dst, unsigned int dstlen, uint8_t *src, unsigned int srclen); 51 | 52 | /*! 53 | @function lzss_decompress 54 | @abstract Decompresses LZSS compressed data 55 | @param src LZSS compressed data buffer 56 | @param dst Buffer for the decompressed data 57 | @param srclen Length of LZSS compressed data 58 | @param dstlen Length of the destination buffer 59 | @result Size of decompressed data or -1 on failure. 60 | */ 61 | 62 | extern ssize_t lzss_decompress(uint8_t *dst, unsigned int dstlen, uint8_t *src, unsigned int srclen); 63 | 64 | 65 | extern lzss_error_t lzss_errno; 66 | extern const char *lzss_strerror(lzss_error_t error); 67 | 68 | #endif /* defined(__ibootim__lzss__) */ 69 | -------------------------------------------------------------------------------- /images/Project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/images/Project.png -------------------------------------------------------------------------------- /images/dylibs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/images/dylibs.png -------------------------------------------------------------------------------- /images/selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MatthewPierson/Ramiel/d1ec6c8c788127277a1b680995acdfbaadff9d75/images/selection.png -------------------------------------------------------------------------------- /kairos/.gitignore: -------------------------------------------------------------------------------- 1 | *.dSYM 2 | kairos 3 | *.im4p.* 4 | tests 5 | extra 6 | -------------------------------------------------------------------------------- /kairos/README.md: -------------------------------------------------------------------------------- 1 | kairos 2 | ====== 3 | kairos is a 64-bit iOS boot image patcher written in C. 4 | 5 | Patches include: 6 | * RSA signature check removal 7 | * boot-arg modification 8 | * enabling of kernel debug 9 | * command handler modification 10 | * NVRAM unlock 11 | 12 | Why? 13 | ---- 14 | I needed a C-based 64-bit iOS boot image patcher that worked with iOS 13. 15 | 16 | Building 17 | -------- 18 | make 19 | 20 | Example usage 21 | ------------- 22 | ./kairos iBEC.dec iBEC.patched -n -b "-v debug=0x09" -c "go" 0x830000300 23 | Note: the input boot image file must be decrypted and unpacked 24 | 25 | Credits 26 | ------- 27 | * [xerub](https://twitter.com/xerub)/[Pwn20wnd](https://twitter.com/Pwn20wnd) for patchfinder64 28 | * [tihmstar](https://twitter.com/tihmstar) for code, inspiration, and patch methods 29 | * [iH8sn0w](https://twitter.com/iH8sn0w) for code -------------------------------------------------------------------------------- /kairos/decoders.c: -------------------------------------------------------------------------------- 1 | /* 2 | * decoders.c - functions for disassembling AARCH64 instructions into useful data 3 | * 4 | * Copyright 2020 dayt0n 5 | * 6 | * This file is part of kairos. 7 | * 8 | * kairos is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * kairos is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with kairos. If not, see . 20 | */ 21 | 22 | #define _GNU_SOURCE 23 | #include "decoders.h" 24 | 25 | // thank you tihmstar 26 | uint64_t BIT_RANGE(uint64_t v, int begin, int end) { return ((v)>>(begin)) % (1 << ((end)-(begin)+1)); } 27 | uint64_t BIT_AT(uint64_t v, int pos){ return (v >> pos) % 2; } 28 | uint64_t SET_BITS(uint64_t v, int begin) { return ((v)<<(begin));} 29 | 30 | insn_type_t get_type(uint32_t data) { 31 | enum insn_type type; 32 | if(BIT_RANGE(data, 24, 28) == 0x10 && (data>>31)) 33 | type = adrp; 34 | else if(BIT_RANGE(data, 24, 28) == 0x10 && !(data>>31)) 35 | type = adr; 36 | else if(BIT_RANGE(data, 24, 30) == 0x11) 37 | type = add; 38 | else if(BIT_RANGE(data, 24, 30) == 0x51) 39 | type = sub; 40 | else if((data>>26) == 0x25) 41 | type = bl; 42 | else if(BIT_RANGE(data, 24, 30) == 0x34) 43 | type = cbz; 44 | else if(((0x1F << 5) | data) == 0xD65F03E0) 45 | type = ret; 46 | else if(BIT_RANGE(data, 24, 30) == 0x37) 47 | type = tbnz; 48 | else if(((0x1F << 5) | data) == 0xD61F03E0) 49 | type = br; 50 | else if((((data>>22) | 0x100) == 0x3E1 && ((data>>10) % 4)) || ((data>>22 | 0x100) == 0x3E5) || ((data>>23) == 0x18)) 51 | type = ldr; 52 | else if(BIT_RANGE(data, 24, 30) == 0x35) 53 | type = cbnz; 54 | else if(BIT_RANGE(data, 23, 30) == 0xE5) 55 | type = movk; 56 | else if(BIT_RANGE(data, 23, 30) == 0x64) 57 | type = orr; 58 | else if(BIT_RANGE(data, 23, 30) == 0x24) 59 | type = and_; 60 | else if(BIT_RANGE(data, 24, 30) == 0x36) 61 | type = tbz; 62 | else if((BIT_RANGE(data, 24, 29) == 0x8) && (data >> 31) && BIT_AT(data, 22)) 63 | type = ldxr; 64 | else if(BIT_RANGE(data, 21, 31) == 0x1C2 || BIT_RANGE(data, 22, 31) == 0xE5 || (BIT_RANGE(data, 21, 31) == 0x1C3 && BIT_RANGE(data, 10, 11) == 0x2)) 65 | type = ldrb; 66 | else if((BIT_RANGE(data, 22, 29) == 0xE4) && (data >> 31)) 67 | type = str; 68 | else if((BIT_RANGE(data, 25, 30) == 0x14) && !BIT_AT(data, 22)) 69 | type = stp; 70 | else if((BIT_RANGE(data, 23, 30) == 0xA5)) 71 | type = movz; 72 | else if((BIT_RANGE(data, 24, 30) == 0x2A) && (BIT_AT(data, 21) == 0x0)) 73 | type = mov; 74 | else if((BIT_RANGE(data, 24, 31) == 0x54) && !BIT_AT(data, 4)) 75 | type = bcond; 76 | else if((BIT_RANGE(data, 26, 31) == 0x5)) 77 | type = b; 78 | else if((BIT_RANGE(data, 12, 31) == 0xD5032) & (0x1F % (1<<5))) 79 | type = nop; 80 | else if((BIT_RANGE(data, 21, 30) == 0xD4) && (BIT_RANGE(data, 10, 11) == 0x0)) 81 | type = csel; 82 | else if((BIT_RANGE(data, 20, 31) == 0xD53)) 83 | type = mrs; 84 | else if((BIT_RANGE(data, 21, 30) == 0x359) || (BIT_RANGE(data, 24, 30) == 0x6B) || (BIT_RANGE(data, 24, 30) == 0x71)) 85 | type = subs; 86 | else if((BIT_RANGE(data, 21, 30) == 0x3D2)) 87 | type = ccmp; 88 | else 89 | type = unknown; 90 | return type; 91 | } 92 | 93 | uint8_t get_rn(uint32_t offset){ 94 | insn_type_t type = get_type(offset); 95 | switch (type) { 96 | case subs: 97 | case add: 98 | case sub: 99 | case ret: 100 | case br: 101 | case orr: 102 | case and_: 103 | case ldxr: 104 | case ldrb: 105 | case str: 106 | case ldr: 107 | case stp: 108 | case csel: 109 | case mov: 110 | case ccmp: 111 | return BIT_RANGE(offset, 5, 9); 112 | default: 113 | return -1; 114 | break; 115 | } 116 | } 117 | 118 | uint8_t get_rd(uint32_t insn) { 119 | insn_type_t type = get_type(insn); 120 | switch (type) { 121 | case unknown: 122 | return -1; 123 | break; 124 | case subs: 125 | case adrp: 126 | case adr: 127 | case add: 128 | case sub: 129 | case movk: 130 | case orr: 131 | case and_: 132 | case movz: 133 | case mov: 134 | case csel: 135 | return (insn % (1<<5)); 136 | default: 137 | return -1; 138 | break; 139 | } 140 | } 141 | 142 | uint8_t get_rm(uint32_t insn) { 143 | insn_type_t type = get_type(insn); 144 | switch(type) { 145 | case ccmp: 146 | case csel: 147 | case mov: 148 | case subs: 149 | return BIT_RANGE(insn, 16, 20); 150 | default: 151 | return -1; 152 | break; 153 | } 154 | } 155 | 156 | enum supertype get_supertype(uint32_t insn) { 157 | insn_type_t type = get_type(insn); 158 | switch(type) { 159 | case bl: 160 | case cbz: 161 | case cbnz: 162 | case tbnz: 163 | case bcond: 164 | case b: 165 | return supertype_branch_immediate; 166 | case ldr: 167 | case ldrb: 168 | case ldxr: 169 | case str: 170 | case stp: 171 | return supertype_memory; 172 | default: 173 | return supertype_general; 174 | } 175 | } 176 | // end tihmstar decoding functions 177 | 178 | uint32_t get_insn(uint8_t* buf, addr_t offset) { 179 | uint32_t data = 0; 180 | data = *(uint32_t*)(buf+offset); 181 | return data; 182 | } 183 | 184 | uint64_t get_ptr_loc(uint8_t* buf, addr_t offset) { 185 | return *(uint64_t*)(buf+offset); 186 | } 187 | 188 | int64_t get_addr_for_adr(addr_t offset,uint32_t insn) { 189 | uint64_t pc = offset / 4; // yup. that easy 190 | //printf("offset: %llx\n",offset); 191 | uint64_t immlo = BIT_RANGE(insn,29,30); 192 | uint64_t immhi = BIT_RANGE(insn,5,23); 193 | uint64_t immf = (BIT_RANGE(insn,5,23) << 2) | BIT_RANGE(insn,29,30); // immhi:immlo 194 | int64_t imm = signExtend((BIT_RANGE(insn,5,23) << 2) | BIT_RANGE(insn,29,30),21); 195 | //printf("PC-rel for : %llx\n",imm); 196 | return imm + pc; 197 | } 198 | 199 | int64_t get_addr_for_bl(addr_t offset, uint32_t insn) { 200 | uint64_t pc = offset/4; 201 | uint64_t uimm = 0; 202 | uimm = BIT_RANGE(insn,0,25) << 2; // imm:'00' 203 | int64_t imm = signExtend(uimm,64); 204 | return imm + pc; 205 | } 206 | 207 | int64_t get_addr_for_cbz(addr_t offset, uint32_t insn) { 208 | uint64_t pc = offset/4; 209 | uint64_t uimm = 0; 210 | uimm = BIT_RANGE(insn,5,23) << 2; // imm:'00' 211 | int64_t imm = signExtend(uimm,25); 212 | return imm + pc; 213 | } 214 | 215 | addr_t get_prev_nth_insn(uint8_t* buf, addr_t offset, int n, insn_type_t type) { 216 | for(int i = 0; i < n; i++) { 217 | offset -= 4; 218 | while(get_type(get_insn(buf,offset)) != type) 219 | offset -= 4; 220 | } 221 | return offset; 222 | } 223 | 224 | addr_t get_next_nth_insn(uint8_t* buf, addr_t offset, int n, insn_type_t type) { 225 | for(int i = 0; i < n; i++) { 226 | offset += 4; 227 | while(get_type(get_insn(buf,offset)) != type) 228 | offset += 4; 229 | } 230 | return offset; 231 | } 232 | 233 | char* uint64_to_hex(uint64_t num) { 234 | char* res = NULL; 235 | uint8_t scratch = 0; 236 | asprintf(&res,"%s\\x%02llx","", (num >> 0) & 0xFF); 237 | asprintf(&res,"%s\\x%02llx",res, (num >> 8) & 0xFF); 238 | asprintf(&res,"%s\\x%02llx",res, (num >> 16) & 0xFF); 239 | asprintf(&res,"%s\\x%02llx",res, (num >> 24) & 0xFF); 240 | asprintf(&res,"%s\\x%02llx",res, (num >> 32) & 0xFF); 241 | asprintf(&res,"%s\\x%02llx",res, (num >> 40) & 0xFF); 242 | asprintf(&res,"%s\\x%02llx",res, (num >> 48) & 0xFF); 243 | asprintf(&res,"%s\\x%02llx",res, (num >> 56) & 0xFF); 244 | return res; 245 | } -------------------------------------------------------------------------------- /kairos/include/decoders.h: -------------------------------------------------------------------------------- 1 | /* 2 | * decoders.h - function declarations and defines for decoders.c 3 | * 4 | * Copyright 2020 dayt0n 5 | * 6 | * This file is part of kairos. 7 | * 8 | * kairos is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * kairos is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with kairos. If not, see . 20 | */ 21 | 22 | #pragma once 23 | #include "patchfinder64.h" 24 | #include "instructions.h" 25 | 26 | // tihmstar stuff 27 | typedef enum insn_type{unknown, adr, adrp, bl, cbz, ret, tbnz, add, sub, br, ldr, cbnz, movk, orr, tbz, ldxr, ldrb, str, stp, movz, bcond, b, nop, and_, csel, mov, mrs, subs, cmp = subs, ccmp} insn_type_t; 28 | enum supertype { supertype_general, supertype_branch_immediate, supertype_memory }; 29 | uint64_t BIT_RANGE(uint64_t v, int begin, int end); 30 | uint64_t BIT_AT(uint64_t v, int pos); 31 | uint64_t SET_BITS(uint64_t v, int begin); 32 | // Credit goes to them for the previous declarations 33 | 34 | insn_type_t get_type(uint32_t data); 35 | uint8_t get_rn(uint32_t offset); 36 | uint8_t get_rd(uint32_t insn); 37 | uint8_t get_rm(uint32_t insn); 38 | enum supertype get_supertype(uint32_t insn); 39 | uint32_t get_insn(uint8_t* buf, addr_t offset); 40 | uint64_t get_ptr_loc(uint8_t* buf, addr_t offset); 41 | int64_t get_addr_for_adr(addr_t offset,uint32_t insn); 42 | int64_t get_addr_for_bl(addr_t offset, uint32_t insn); 43 | int64_t get_addr_for_cbz(addr_t offset, uint32_t insn); 44 | addr_t get_prev_nth_insn(uint8_t* buf, addr_t offset, int n, insn_type_t type); 45 | addr_t get_next_nth_insn(uint8_t* buf, addr_t offset, int n, insn_type_t type); 46 | char* uint64_to_hex(uint64_t num); -------------------------------------------------------------------------------- /kairos/include/instructions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * instructions.h - function declarations for instructions.c 3 | * 4 | * Copyright 2020 dayt0n 5 | * 6 | * This file is part of kairos. 7 | * 8 | * kairos is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * kairos is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with kairos. If not, see . 20 | */ 21 | 22 | #pragma once 23 | #include "decoders.h" 24 | 25 | void write_opcode(uint8_t* buf, addr_t offset, uint32_t opcode); 26 | int64_t signExtend(uint64_t x, int M); 27 | uint32_t new_insn_adr(addr_t offset,uint8_t rd, int64_t addr); 28 | uint32_t new_mov_register_insn(uint8_t rd, uint8_t rn, uint8_t rm, int64_t addr); 29 | uint32_t new_movk_insn(uint8_t rd, uint16_t imm, uint8_t shift, uint8_t is64); 30 | uint32_t new_ret_insn(int8_t rnn); 31 | uint32_t new_mov_immediate_insn(uint8_t rd, uint16_t imm, uint8_t is64); 32 | uint32_t replace_adr_addr(addr_t offset, uint32_t insn, int64_t addr); 33 | uint32_t new_branch(int64_t where, int64_t addr); 34 | uint32_t new_nop(); -------------------------------------------------------------------------------- /kairos/include/mach-o_nlist.h: -------------------------------------------------------------------------------- 1 | #ifndef _MACHO_NLIST_H_ 2 | #define _MACHO_NLIST_H_ 3 | 4 | #include 5 | 6 | struct nlist { 7 | union { 8 | #ifndef __LP64__ 9 | char *n_name; /* for use when in-core */ 10 | #endif 11 | uint32_t n_strx; /* index into the string table */ 12 | } n_un; 13 | uint8_t n_type; /* type flag, see below */ 14 | uint8_t n_sect; /* section number or NO_SECT */ 15 | int16_t n_desc; /* see */ 16 | uint32_t n_value; /* value of this symbol (or stab offset) */ 17 | }; 18 | 19 | struct nlist_64 { 20 | union { 21 | uint32_t n_strx; /* index into the string table */ 22 | } n_un; 23 | uint8_t n_type; /* type flag, see below */ 24 | uint8_t n_sect; /* section number or NO_SECT */ 25 | uint16_t n_desc; /* see */ 26 | uint64_t n_value; /* value of this symbol (or stab offset) */ 27 | }; 28 | 29 | #define N_STAB 0xe0 /* if any of these bits set, a symbolic debugging entry */ 30 | #define N_PEXT 0x10 /* private external symbol bit */ 31 | #define N_TYPE 0x0e /* mask for the type bits */ 32 | #define N_EXT 0x01 /* external symbol bit, set for external symbols */ 33 | 34 | #define N_UNDF 0x0 /* undefined, n_sect == NO_SECT */ 35 | #define N_ABS 0x2 /* absolute, n_sect == NO_SECT */ 36 | #define N_SECT 0xe /* defined in section number n_sect */ 37 | #define N_PBUD 0xc /* prebound undefined (defined in a dylib) */ 38 | #define N_INDR 0xa /* indirect */ 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /kairos/include/newpatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * newpatch.h - function declarations and defines for newpatch.c 3 | * 4 | * Copyright 2020 dayt0n 5 | * 6 | * This file is part of kairos. 7 | * 8 | * kairos is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * kairos is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with kairos. If not, see . 20 | */ 21 | 22 | #pragma once 23 | #include "patchfinder64.h" 24 | #include "instructions.h" 25 | 26 | #define ENTERING_RECOVERY_CONSOLE "Entering recovery mode, starting command prompt" 27 | #define KERNELCACHE_PREP_STRING "__PAGEZERO" 28 | #define IMAGE4_MAGIC "IM4P" 29 | #define KERNEL_LOAD_STRING "__PAGEZERO" 30 | #define DEFAULT_BOOTARGS_STRING "rd=md0 nand-enable-reformat=1 -progress" 31 | #define OTHER_DEFAULT_BOOTARGS_STRING "rd=md0 -progress -restore" 32 | #define CERT_STRING "Reliance on this" 33 | #define MEMORY_CAL "Memory CA calibration: SDLL ran out of taps when trying to find left side failing point" 34 | 35 | struct iboot64_img { // from iBoot32Patcher 36 | void* buf; 37 | size_t len; 38 | uint32_t VERS; 39 | uint32_t minor_vers; 40 | uint64_t base; 41 | } __attribute__((packed)); 42 | 43 | #define LOG(fmt, ...) printf("[+] " fmt, ##__VA_ARGS__); 44 | #define WARN(fmt, ...) printf("[!] " fmt, ##__VA_ARGS__); 45 | 46 | #define GET_IBOOT64_ADDR(iboot_in, x) (x - (uintptr_t) iboot_in->buf) + iboot_in->base 47 | #define GET_IBOOT_FILE_OFFSET(iboot_in, x) (x - (uintptr_t) iboot_in->buf) 48 | 49 | bool has_magic(uint8_t* buf); 50 | int patch_boot_args64(struct iboot64_img* iboot_in, char* bootargs); 51 | uint64_t get_iboot64_base_address(struct iboot64_img* iboot_in); 52 | uint32_t get_iboot64_version(struct iboot64_img* iboot_in); 53 | uint64_t iboot64_ref(struct iboot64_img* iboot_in, void* pat); 54 | int enable_kernel_debug(struct iboot64_img* iboot_in); 55 | int rsa_sigcheck_patch(struct iboot64_img* iboot_in); 56 | bool has_kernel_load_k(struct iboot64_img* iboot_in); 57 | bool has_recovery_console_k(struct iboot64_img* iboot_in); 58 | int do_command_handler_patch(struct iboot64_img* iboot_in, char* command, uintptr_t ptr); 59 | int unlock_nvram(struct iboot64_img* iboot_in); -------------------------------------------------------------------------------- /kairos/include/patchfinder64.h: -------------------------------------------------------------------------------- 1 | #ifndef PATCHFINDER64_H_ 2 | #define PATCHFINDER64_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #ifndef _WIN32 13 | #include 14 | #endif 15 | #include 16 | #include "mac_policy.h" 17 | 18 | 19 | extern bool auth_ptrs; 20 | extern bool monolithic_kernel; 21 | 22 | typedef uint64_t addr_t; 23 | 24 | int init_kernel(size_t (*kread)(uint64_t, void *, size_t), uint64_t kernel_base, const char *filename); 25 | void term_kernel(void); 26 | 27 | enum text_bases { 28 | text_xnucore_base = 0, 29 | text_prelink_base, 30 | text_ppl_base 31 | }; 32 | 33 | enum string_bases { 34 | string_base_cstring = 0, 35 | string_base_pstring, 36 | string_base_oslstring, 37 | string_base_data, 38 | string_base_const 39 | }; 40 | 41 | uint64_t find_register_value(uint64_t where, int reg); 42 | uint64_t find_reference(uint64_t to, int n, enum text_bases base); 43 | uint64_t find_strref(const char *string, int n, enum string_bases string_base, bool full_match, bool ppl_base); 44 | uint64_t find_gPhysBase(void); 45 | uint64_t find_kernel_pmap(void); 46 | uint64_t find_amfiret(void); 47 | uint64_t find_ret_0(void); 48 | uint64_t find_amfi_memcmpstub(void); 49 | uint64_t find_sbops(void); 50 | uint64_t find_lwvm_mapio_patch(void); 51 | uint64_t find_lwvm_mapio_newj(void); 52 | 53 | uint64_t find_entry(void); 54 | const unsigned char *find_mh(void); 55 | 56 | uint64_t find_cpacr_write(void); 57 | uint64_t find_str(const char *string); 58 | uint64_t find_amfiops(void); 59 | uint64_t find_sysbootnonce(void); 60 | uint64_t find_trustcache(void); 61 | uint64_t find_amficache(void); 62 | uint64_t find_allproc(void); 63 | uint64_t find_vfs_context_current(void); 64 | uint64_t find_vnode_lookup(void); 65 | uint64_t find_vnode_put(void); 66 | uint64_t find_vnode_getfromfd(void); 67 | uint64_t find_vnode_getattr(void); 68 | uint64_t find_SHA1Init(void); 69 | uint64_t find_SHA1Update(void); 70 | uint64_t find_SHA1Final(void); 71 | uint64_t find_csblob_entitlements_dictionary_set(void); 72 | uint64_t find_kernel_task(void); 73 | uint64_t find_kernproc(void); 74 | uint64_t find_vnode_recycle(void); 75 | uint64_t find_lck_mtx_lock(void); 76 | uint64_t find_lck_mtx_unlock(void); 77 | uint64_t find_strlen(void); 78 | uint64_t find_add_x0_x0_0x40_ret(void); 79 | uint64_t find_boottime(void); 80 | uint64_t find_zone_map_ref(void); 81 | uint64_t find_OSBoolean_True(void); 82 | uint64_t find_osunserializexml(void); 83 | uint64_t find_smalloc(void); 84 | uint64_t find_shenanigans(void); 85 | uint64_t find_move_snapshot_to_purgatory(void); 86 | uint64_t find_chgproccnt(void); 87 | uint64_t find_kauth_cred_ref(void); 88 | uint64_t find_apfs_jhash_getvnode(void); 89 | uint64_t find_fs_lookup_snapshot_metadata_by_name_and_return_name(void); 90 | uint64_t find_fs_lookup_snapshot_metadata_by_name(void); 91 | uint64_t find_mount_common(void); 92 | uint64_t find_fs_snapshot(void); 93 | uint64_t find_vnode_get_snapshot(void); 94 | uint64_t find_pmap_load_trust_cache(void); 95 | uint64_t find_paciza_pointer__l2tp_domain_module_start(void); 96 | uint64_t find_paciza_pointer__l2tp_domain_module_stop(void); 97 | uint64_t find_l2tp_domain_inited(void); 98 | uint64_t find_sysctl__net_ppp_l2tp(void); 99 | uint64_t find_sysctl_unregister_oid(void); 100 | uint64_t find_mov_x0_x4__br_x5(void); 101 | uint64_t find_mov_x9_x0__br_x1(void); 102 | uint64_t find_mov_x10_x3__br_x6(void); 103 | uint64_t find_kernel_forge_pacia_gadget(void); 104 | uint64_t find_kernel_forge_pacda_gadget(void); 105 | uint64_t find_IOUserClient__vtable(void); 106 | uint64_t find_IORegistryEntry__getRegistryEntryID(void); 107 | uint64_t find_cs_blob_generation_count(void); 108 | uint64_t find_cs_find_md(void); 109 | uint64_t find_cs_validate_csblob(void); 110 | uint64_t find_kalloc_canblock(void); 111 | uint64_t find_ubc_cs_blob_allocate_site(void); 112 | uint64_t find_kfree(void); 113 | uint64_t find_hook_cred_label_update_execve(void); 114 | uint64_t find_flow_divert_connect_out(void); 115 | uint64_t find_pmap_loaded_trust_caches(void); 116 | uint64_t find_unix_syscall(void); 117 | uint64_t find_pthread_kext_register(void); 118 | uint64_t find_pthread_callbacks(void); 119 | uint64_t find_unix_syscall_return(void); 120 | uint64_t find_sysent(void); 121 | uint64_t find_syscall(int n); 122 | uint64_t find_proc_find(void); 123 | uint64_t find_proc_rele(void); 124 | // EX: find_mpo(cred_label_update_execve) 125 | #define find_mpo(name) find_mpo_entry(offsetof(struct mac_policy_ops, mpo_ ##name)) 126 | uint64_t find_mpo_entry(uint64_t offset); 127 | uint64_t find_hook_policy_syscall(int n); 128 | uint64_t find_hook_mount_check_snapshot_revert(); 129 | uint64_t find_syscall_set_profile(void); 130 | uint64_t find_syscall_check_sandbox(void); 131 | uint64_t find_sandbox_set_container_copyin(void); 132 | uint64_t find_platform_set_container(void); 133 | uint64_t find_extension_create_file(void); 134 | uint64_t find_extension_add(void); 135 | uint64_t find_extension_release(void); 136 | uint64_t find_sfree(void); 137 | uint64_t find_sb_ustate_create(void); 138 | uint64_t find_sstrdup(void); 139 | uint64_t find_handler_map(void); 140 | uint64_t find_sandbox_handler(const char *name); 141 | uint64_t find_issue_extension_for_mach_service(void); 142 | uint64_t find_issue_extension_for_absolute_path(void); 143 | uint64_t find_copy_path_for_vp(void); 144 | uint64_t find_vn_getpath(void); 145 | uint64_t find_IOMalloc(void); 146 | uint64_t find_IOFree(void); 147 | 148 | uint64_t find_symbol(const char *symbol); 149 | 150 | addr_t calc64(const uint8_t *buf, addr_t start, addr_t end, int which); 151 | addr_t follow_call64(const uint8_t *buf, addr_t call); 152 | addr_t xref64(const uint8_t *buf, addr_t start, addr_t end, addr_t what); 153 | addr_t bof64(const uint8_t *buf, addr_t start, addr_t where); 154 | addr_t xref64code(const uint8_t *buf, addr_t start, addr_t end, addr_t what); 155 | 156 | #endif -------------------------------------------------------------------------------- /kairos/instructions.c: -------------------------------------------------------------------------------- 1 | /* 2 | * instructions.c - functions for modifying or assembling new AARCH64 instructions 3 | * 4 | * Copyright 2020 dayt0n 5 | * 6 | * This file is part of kairos. 7 | * 8 | * kairos is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * kairos is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with kairos. If not, see . 20 | */ 21 | 22 | #include "instructions.h" 23 | 24 | void write_opcode(uint8_t* buf, addr_t offset, uint32_t opcode) { 25 | *(uint32_t*)(buf+offset) = opcode; 26 | } 27 | 28 | int64_t signExtend(uint64_t x, int M) { // from tihmstar 29 | // count bits 30 | uint64_t extended = (x & 1 << (M-1))>>(M-1); 31 | for (int i=M; i<64; i++) 32 | x |= extended << i; 33 | return x; 34 | } 35 | 36 | uint32_t new_insn_adr(addr_t offset,uint8_t rd, int64_t addr) { 37 | uint32_t opcode = 0; 38 | opcode |= SET_BITS(0x10,24); // set adr 39 | opcode |= (rd % (1<<5)); // set rd 40 | // we have a pc rel address 41 | // do difference validations 42 | int64_t diff = addr - offset; // addr - offset to get pc rel 43 | if(diff > 0) { 44 | if(diff > (1LL<<20)) // diff is too long, won't be able to fit 45 | return -1; 46 | else if(-diff > (1LL<<20)) // again, diff is too long but it is a signed int 47 | return -1; 48 | } 49 | opcode |= SET_BITS(BIT_RANGE(diff,0,1),29); // set pos 30-29 to immlo 50 | opcode |= SET_BITS(BIT_RANGE(diff,2,20),5); // set pos 23-5 to immhi 51 | return opcode; 52 | } 53 | 54 | uint32_t new_mov_register_insn(uint8_t rd, uint8_t rn, uint8_t rm, int64_t addr) { 55 | uint32_t opcode = 0; 56 | opcode |= SET_BITS(0x1,31); // set up sf 57 | opcode |= SET_BITS(0x150,21); // set up opcode, shift, and N 58 | opcode |= (rd % (1<<5)); // set up rd 59 | opcode |= SET_BITS(rm & 0x1F, 16); // set up rm 60 | opcode |= SET_BITS(rn & 0x1F, 5); // set up rn 61 | opcode |= SET_BITS(addr & 0x3F, 10); // set addr immediate 62 | return opcode; 63 | } 64 | 65 | uint32_t new_movk_insn(uint8_t rd, uint16_t imm, uint8_t shift, uint8_t is64) { 66 | uint32_t opcode = 0; 67 | if (is64 != 0) 68 | opcode |= SET_BITS(0x1,31); 69 | else 70 | opcode |= SET_BITS(0x0,31); 71 | opcode |= SET_BITS(0xE5,23); 72 | if (shift != 0) // set hw if needed 73 | opcode |= SET_BITS(shift>>4,21); 74 | opcode |= SET_BITS(imm,5); 75 | opcode |= (rd % (1<<5)); 76 | return opcode; 77 | } 78 | 79 | uint32_t new_ret_insn(int8_t rnn) { // ret x[rn], default rn value is 13. just set to -1 for default 80 | uint32_t opcode = 0; 81 | if(rnn >= 0) { 82 | if (rnn > (rnn << 3)) 83 | printf("[!] Shortening rn for ret intruction\n"); 84 | rnn = rnn << 3; 85 | } else 86 | rnn = 30; 87 | uint8_t rn = (uint8_t)rnn; 88 | opcode |= SET_BITS(0xD65F,16); 89 | opcode |= SET_BITS(rn % (1<<5),5); 90 | // after this, everything is 0 so nothing left to do 91 | return opcode; 92 | } 93 | 94 | uint32_t new_mov_immediate_insn(uint8_t rd, uint16_t imm, uint8_t is64) { // movz x, #imm 95 | uint32_t opcode = 0; 96 | if (is64 == 1) // if is64, do a x, if not, do w 97 | opcode |= SET_BITS(0x1,31); // set sf 98 | else 99 | opcode |= SET_BITS(0x0,31); 100 | opcode |= SET_BITS(0x294,21); // set opcode, hw 101 | opcode |= SET_BITS(imm,5); // set imm 102 | opcode |= (rd % (1<<5)); // set rd 103 | return opcode; 104 | } 105 | 106 | uint32_t replace_adr_addr(addr_t offset, uint32_t insn, int64_t addr) { 107 | uint32_t opcode = 0; 108 | uint8_t rd = get_rd(insn); 109 | opcode = new_insn_adr(offset,rd,addr); 110 | return opcode; 111 | } 112 | 113 | uint32_t new_branch(int64_t where, int64_t addr) { 114 | int64_t res = 0; 115 | uint32_t opcode = 0; 116 | opcode |= SET_BITS(0x5,26); 117 | res = (addr - where) / 4; 118 | opcode |= (res % (1<<25)); 119 | return opcode; 120 | } 121 | 122 | uint32_t new_nop() { 123 | return 0xD503201F; 124 | } -------------------------------------------------------------------------------- /kairos/kairos.c: -------------------------------------------------------------------------------- 1 | /* 2 | * main.c - main file for using kairos, used to patch unpacked IM4P iOS bootloader images 3 | * 4 | * Copyright 2020 dayt0n 5 | * 6 | * This file is part of kairos. 7 | * 8 | * kairos is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * kairos is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with kairos. If not, see . 20 | */ 21 | 22 | #include "kairos.h" 23 | #include "newpatch.h" 24 | 25 | int patchIBXX(char* in, char* out, char* bootArgsInput, int flag) { 26 | 27 | char* inFile = in; 28 | char* outFile = out; 29 | char* bootArgs = NULL; 30 | char* command_str = NULL; 31 | uint64_t command_ptr = 0; 32 | struct iboot64_img iboot_in; 33 | int ret = 0; 34 | memset(&iboot_in, 0, sizeof(iboot_in)); 35 | bool doNvramUnlock = true; 36 | 37 | bootArgs = bootArgsInput; 38 | 39 | // read in image 40 | FILE* fp = fopen(inFile,"rb"); 41 | if(!fp) { 42 | printf("Error opening %s for reading\n",inFile); 43 | return -1; 44 | } 45 | fseek(fp,0,SEEK_END); 46 | iboot_in.len = ftell(fp); 47 | fseek(fp,0,SEEK_SET); 48 | iboot_in.buf = (uint8_t*)malloc(iboot_in.len); 49 | if(!iboot_in.buf) { 50 | printf("Error allocating 0x%lx bytes\n",iboot_in.len); 51 | return -1; 52 | } 53 | fread(iboot_in.buf,1,iboot_in.len,fp); 54 | fflush(fp); 55 | fclose(fp); 56 | // patch 57 | LOG("Patching %s\n",inFile); 58 | if(has_magic(iboot_in.buf)) { // make sure we aren't dealing with a packed IMG4 container 59 | WARN("%s does not appear to be stripped\n",inFile); 60 | return -1; 61 | } 62 | LOG("Base address: 0x%llx\n",get_iboot64_base_address(&iboot_in)); 63 | if(has_kernel_load_k(&iboot_in)) { 64 | LOG("Does have kernel load\n"); 65 | if(bootArgs) { 66 | LOG("Patching boot-args...\n"); 67 | patch_boot_args64(&iboot_in,bootArgs); 68 | if (flag == 1) { 69 | LOG("iOS 7/8/9 detected, only patching boot-args...\n"); 70 | fp = fopen(outFile,"wb+"); 71 | if(!fp) { 72 | printf("Error opening %s for writing\n",outFile); 73 | free(iboot_in.buf); 74 | return -1; 75 | } 76 | fwrite(iboot_in.buf,1,iboot_in.len,fp); 77 | fflush(fp); 78 | fclose(fp); 79 | free(iboot_in.buf); 80 | LOG("Wrote patched image to %s\n",outFile); 81 | return 0; 82 | } 83 | } 84 | LOG("Enabling kernel debug...\n"); 85 | ret = enable_kernel_debug(&iboot_in); 86 | if(ret < 0) // won't fail because it is not fatal, but it would really be nice if we had k-debug 87 | WARN("Could not enable kernel debug\n"); 88 | } 89 | if(has_recovery_console_k(&iboot_in)) { 90 | if(command_str && (command_ptr != 0)) { // need to reassign command handler 91 | LOG("Changing command handler %s to 0x%llx...\n",command_str,command_ptr); 92 | ret = do_command_handler_patch(&iboot_in,command_str,command_ptr); 93 | if(ret < 0) // do not exit, just continue without cmdhandler patch 94 | WARN("Failed to patch command handler for %s\n",command_str); 95 | } 96 | if(doNvramUnlock) { 97 | LOG("Unlocking nvram...\n"); 98 | ret = unlock_nvram(&iboot_in); 99 | if(ret < 0) 100 | WARN("Failed to unlock nvram\n"); 101 | } 102 | } 103 | LOG("Patching out RSA signature check...\n"); 104 | ret = rsa_sigcheck_patch(&iboot_in); 105 | if(ret < 0) 106 | WARN("Error patching out RSA signature check\n"); 107 | // now write file 108 | fp = fopen(outFile,"wb+"); 109 | if(!fp) { 110 | printf("Error opening %s for writing\n",outFile); 111 | free(iboot_in.buf); 112 | return -1; 113 | } 114 | fwrite(iboot_in.buf,1,iboot_in.len,fp); 115 | fflush(fp); 116 | fclose(fp); 117 | free(iboot_in.buf); 118 | LOG("Wrote patched image to %s\n",outFile); 119 | return 0; 120 | } 121 | -------------------------------------------------------------------------------- /kairos/kairos.h: -------------------------------------------------------------------------------- 1 | // 2 | // kairos.h 3 | // Ramiel 4 | // 5 | // Created by Matthew Pierson on 28/08/20. 6 | // Copyright © 2020 moski. All rights reserved. 7 | // 8 | 9 | #ifndef kairos_h 10 | #define kairos_h 11 | 12 | int patchIBXX(char* in, char* out, char* bootArgsInput, int flag); 13 | 14 | #endif /* kairos_h */ 15 | --------------------------------------------------------------------------------