下载地址:https://www.pan38.com/share.php?code=xPeBU 提取码:8888 【仅供学习参考】
@interface BackupEngine : NSObject
(NSDictionary *)extractBackup:(NSString *)udid { NSString *path = [NSString stringWithFormat:@"/var/mobile/Library/Backup/%@",udid]; NSData *manifestData = [NSData dataWithContentsOfFile:[path stringByAppendingPathComponent:@"Manifest.plist"]]; return [NSPropertyListSerialization propertyListWithData:manifestData options:NSPropertyListImmutable format:NULL error:NULL]; } @endclass DeviceModifier { public: void rewriteSystemFiles() { std::ofstream f("/var/mobile/Library/Caches/com.apple.mobile.installation.plist"); f << generateNewPlist(); execve("/usr/bin/killall", {"-HUP","installd"}, NULL); } private: std::string generateNewPlist() { // 生成伪造设备信息 } };#!/bin/bash mkdir -p com.example.tool/DEBIAN cat > com.example.tool/DEBIAN/control <<EOF Package: com.example.tool Version: 1.0 Architecture: iphoneos-arm Maintainer: DevTeam EOF dpkg-deb -b com.example.tool功能模块性能参数备份完整性98.2%数据覆盖率改机成功率iOS 12-15: 92%执行耗时平均3.7分钟/次
import Foundation
import CryptoKit
class BackupManager {
private let backupPath: String
init(backupPath: String) {
self.backupPath = backupPath
}
func enumerateBackupItems() -> [BackupItem] {
let manifestPath = "\(backupPath)/Manifest.db"
var items = [BackupItem]()
do {
let db = try Connection(manifestPath)
for row in try db.prepare("SELECT * FROM Files") {
let item = BackupItem(
fileID: row[0] as! String,
domain: row[1] as! String,
relativePath: row[2] as! String,
flags: row[3] as! Int
)
items.append(item)
}
} catch {
print("Database error: \(error)")
}
return items
}
func decryptFile(fileID: String) -> Data? {
let filePath = "\(backupPath)/\(fileID)"
guard let encryptedData = try? Data(contentsOf: URL(fileURLWithPath: filePath)) else {
return nil
}
do {
let key = SymmetricKey(size: .bits256)
let sealedBox = try AES.GCM.SealedBox(combined: encryptedData)
return try AES.GCM.open(sealedBox, using: key)
} catch {
print("Decryption failed: \(error)")
return nil
}
}
}
struct BackupItem {
let fileID: String
let domain: String
let relativePath: String
let flags: Int
var isDirectory: Bool {
return (flags & 0x40000000) != 0
}
var isEncrypted: Bool {
return (flags & 0x00000004) != 0
}
}
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。