diff --git a/packages/tweak/NetflixEntityAuth/.theos/_/DEBIAN/control b/packages/tweak/NetflixEntityAuth/.theos/_/DEBIAN/control index 28180e2..d23aee8 100644 --- a/packages/tweak/NetflixEntityAuth/.theos/_/DEBIAN/control +++ b/packages/tweak/NetflixEntityAuth/.theos/_/DEBIAN/control @@ -6,5 +6,5 @@ Author: tkgstrator Section: Tweaks Depends: mobilesubstrate, dev.theos.orion14 (>= 1.0.1) Architecture: iphoneos-arm64 -Version: 1.0.0-11+debug +Version: 1.0.0-12+debug Installed-Size: 140 diff --git a/packages/tweak/NetflixEntityAuth/.theos/_/var/jb/Library/MobileSubstrate/DynamicLibraries/NetflixEntityAuth.dylib b/packages/tweak/NetflixEntityAuth/.theos/_/var/jb/Library/MobileSubstrate/DynamicLibraries/NetflixEntityAuth.dylib index 14abf4c..c25cdc7 100755 Binary files a/packages/tweak/NetflixEntityAuth/.theos/_/var/jb/Library/MobileSubstrate/DynamicLibraries/NetflixEntityAuth.dylib and b/packages/tweak/NetflixEntityAuth/.theos/_/var/jb/Library/MobileSubstrate/DynamicLibraries/NetflixEntityAuth.dylib differ diff --git a/packages/tweak/NetflixEntityAuth/.theos/last_package b/packages/tweak/NetflixEntityAuth/.theos/last_package index 2f03885..3a28d75 100644 --- a/packages/tweak/NetflixEntityAuth/.theos/last_package +++ b/packages/tweak/NetflixEntityAuth/.theos/last_package @@ -1 +1 @@ -./packages/work.tkgstrator.netflixentityauth_1.0.0-11+debug_iphoneos-arm64.deb +./packages/work.tkgstrator.netflixentityauth_1.0.0-12+debug_iphoneos-arm64.deb diff --git a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/NetflixEntityAuth.dylib b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/NetflixEntityAuth.dylib index 14abf4c..c25cdc7 100755 Binary files a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/NetflixEntityAuth.dylib and b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/NetflixEntityAuth.dylib differ diff --git a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/NetflixEntityAuth.dylib b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/NetflixEntityAuth.dylib index feb6c48..e1b2a5b 100755 Binary files a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/NetflixEntityAuth.dylib and b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/NetflixEntityAuth.dylib differ diff --git a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/NetflixEntityAuth.dylib.dSYM/Contents/Resources/DWARF/NetflixEntityAuth.dylib b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/NetflixEntityAuth.dylib.dSYM/Contents/Resources/DWARF/NetflixEntityAuth.dylib index e0f95fd..f775c22 100644 Binary files a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/NetflixEntityAuth.dylib.dSYM/Contents/Resources/DWARF/NetflixEntityAuth.dylib and b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/NetflixEntityAuth.dylib.dSYM/Contents/Resources/DWARF/NetflixEntityAuth.dylib differ diff --git a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/NetflixEntityAuth.swiftsourceinfo b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/NetflixEntityAuth.swiftsourceinfo index 7c31b99..cddc429 100644 Binary files a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/NetflixEntityAuth.swiftsourceinfo and b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/NetflixEntityAuth.swiftsourceinfo differ diff --git a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/Sources/NetflixEntityAuthC/Tweak.m.276b477d.o b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/Sources/NetflixEntityAuthC/Tweak.m.276b477d.o index bac4bb0..6b31614 100644 Binary files a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/Sources/NetflixEntityAuthC/Tweak.m.276b477d.o and b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/Sources/NetflixEntityAuthC/Tweak.m.276b477d.o differ diff --git a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/home/vscode/app/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/generated/NetflixEntityAuth.xc.swift.276b477d.swiftdeps b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/home/vscode/app/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/generated/NetflixEntityAuth.xc.swift.276b477d.swiftdeps index 30e42e9..997180b 100644 Binary files a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/home/vscode/app/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/generated/NetflixEntityAuth.xc.swift.276b477d.swiftdeps and b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/home/vscode/app/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/generated/NetflixEntityAuth.xc.swift.276b477d.swiftdeps differ diff --git a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/master.276b477d.priors b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/master.276b477d.priors index 0d3434a..a3525aa 100644 Binary files a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/master.276b477d.priors and b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/master.276b477d.priors differ diff --git a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/master.276b477d.swiftdeps b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/master.276b477d.swiftdeps index 6107f71..a61b376 100644 --- a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/master.276b477d.swiftdeps +++ b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/master.276b477d.swiftdeps @@ -1,7 +1,7 @@ version: "Swift version 5.8 (swift-5.8-RELEASE)" options: "46ac4fc8a6fab716165f87c6eadba55bec7c9ab0850730661a3e566653e8c94c" -build_start_time: [1775738684, 133009000] -build_end_time: [1775738684, 285013000] +build_start_time: [1775760330, 923387000] +build_end_time: [1775760331, 228423000] inputs: - "/home/vscode/app/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/generated/NetflixEntityAuth.xc.swift": [1775738683, 0] + "/home/vscode/app/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/generated/NetflixEntityAuth.xc.swift": [1775760330, 0] "Sources/NetflixEntityAuth/Tweak.x.swift": [1775724899, 0] diff --git a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/output-file-map.276b477d.json b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/output-file-map.276b477d.json index b29665e..a71c824 100644 --- a/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/output-file-map.276b477d.json +++ b/packages/tweak/NetflixEntityAuth/.theos/obj/debug/arm64/output-file-map.276b477d.json @@ -1 +1 @@ -{"":{"dependencies":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/master.276b477d.Td","swift-dependencies":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/master.276b477d.swiftdeps"},"Sources\/NetflixEntityAuth\/Tweak.x.swift":{"swift-dependencies":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/Sources\/NetflixEntityAuth\/Tweak.x.swift.276b477d.swiftdeps","dependencies":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/Sources\/NetflixEntityAuth\/Tweak.x.swift.276b477d.Td","object":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/Sources\/NetflixEntityAuth\/Tweak.x.swift.276b477d.o"},"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/generated\/NetflixEntityAuth.xc.swift":{"dependencies":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/generated\/NetflixEntityAuth.xc.swift.276b477d.Td","object":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/generated\/NetflixEntityAuth.xc.swift.276b477d.o","swift-dependencies":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/generated\/NetflixEntityAuth.xc.swift.276b477d.swiftdeps"}} +{"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/generated\/NetflixEntityAuth.xc.swift":{"swift-dependencies":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/generated\/NetflixEntityAuth.xc.swift.276b477d.swiftdeps","object":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/generated\/NetflixEntityAuth.xc.swift.276b477d.o","dependencies":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/generated\/NetflixEntityAuth.xc.swift.276b477d.Td"},"Sources\/NetflixEntityAuth\/Tweak.x.swift":{"object":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/Sources\/NetflixEntityAuth\/Tweak.x.swift.276b477d.o","swift-dependencies":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/Sources\/NetflixEntityAuth\/Tweak.x.swift.276b477d.swiftdeps","dependencies":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/Sources\/NetflixEntityAuth\/Tweak.x.swift.276b477d.Td"},"":{"dependencies":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/master.276b477d.Td","swift-dependencies":"\/home\/vscode\/app\/packages\/tweak\/NetflixEntityAuth\/.theos\/obj\/debug\/arm64\/master.276b477d.swiftdeps"}} diff --git a/packages/tweak/NetflixEntityAuth/.theos/packages/work.tkgstrator.netflixentityauth-1.0.0 b/packages/tweak/NetflixEntityAuth/.theos/packages/work.tkgstrator.netflixentityauth-1.0.0 index 9d60796..3cacc0b 100644 --- a/packages/tweak/NetflixEntityAuth/.theos/packages/work.tkgstrator.netflixentityauth-1.0.0 +++ b/packages/tweak/NetflixEntityAuth/.theos/packages/work.tkgstrator.netflixentityauth-1.0.0 @@ -1 +1 @@ -11 \ No newline at end of file +12 \ No newline at end of file diff --git a/packages/tweak/NetflixEntityAuth/Sources/NetflixEntityAuthC/Tweak.m b/packages/tweak/NetflixEntityAuth/Sources/NetflixEntityAuthC/Tweak.m index d403f5c..563d3e3 100644 --- a/packages/tweak/NetflixEntityAuth/Sources/NetflixEntityAuthC/Tweak.m +++ b/packages/tweak/NetflixEntityAuth/Sources/NetflixEntityAuthC/Tweak.m @@ -222,7 +222,9 @@ static unsigned char *hook_HMAC(const EVP_MD *evp_md, unsigned char *md, unsigned int *md_len) { unsigned char *ret = orig_HMAC(evp_md, key, key_len, d, n, md, md_len); - if (!g_inHook && ret) { + // NOTE: g_inHook check disabled to capture apphmac HMAC (computed inside getAuthData + // on a potentially different thread where g_inHook may be set by another hook) + if (ret) { unsigned int outLen = (md_len && *md_len > 0) ? *md_len : 0; // Determine actual output length: if md_len not set, check EVP_MD output size @@ -1041,6 +1043,46 @@ static void installMslClientHooks(void) { (void **)&orig_FpsMgkAppIdAuthData_ctor); file_log(g_log_general, @"[NFXEntityAuth] FpsMgkAppIdAuthData ctor hooked"); + // Hook getAuthData at offset 0x284bc — dumps CBOR output to capture apphmac (32B) + // getAuthData(shared_ptr, MslEncoderFormat const&) const + // Returns shared_ptr via sret (x8). + // We hook it to capture the raw CBOR bytes AFTER the original runs. + // + // Simpler approach: hook the hmac vtable call inside getAuthData. + // NFWebCrypto::hmac at vtable[0x58] = NFWebCrypto offset 0xdf78. + // This function calls OpenSSL HMAC internally but for apphmac specifically. + // Instead, let's hook NFWebCrypto::hmacSign at 0xe640 which is the inner HMAC. + // + // Actually: hook AppleWebCrypto::hmac(uint, Variant, DataBuffer, DataBuffer&) at 0xdf78 + // and capture inputs/outputs directly. + { + uint32_t nfwcImgCount = _dyld_image_count(); + uintptr_t nfwcBase2 = 0; + for (uint32_t i = 0; i < nfwcImgCount; i++) { + const char *name = _dyld_get_image_name(i); + if (name && strstr(name, "NFWebCrypto.framework/NFWebCrypto")) { + nfwcBase2 = (uintptr_t)_dyld_get_image_header(i); + break; + } + } + if (nfwcBase2) { + // Hook hmacSign at 0xe640 — this is called internally by hmac(0xdf78) + // Signature: void hmacSign(const void *key, int key_len, + // const unsigned char *data, size_t data_len, + // unsigned char *out, unsigned int *out_len) + // Actually at 0xe640 the RE identified it as AppleWebCrypto::hmacSign + // Let's hook it to catch ALL HMAC calls including the internal apphmac one. + // + // Better: just save the full entity_auth_data CBOR from the appboot blob. + // The blob_000_data.bin already contains the appboot request body. + // We can parse it to extract the CBOR entity_auth_data. + file_log(g_log_general, + [NSString stringWithFormat: + @"[NFXEntityAuth] NFWebCrypto::hmac at 0x%lx (not hooked — use blob capture instead)", + (unsigned long)(nfwcBase2 + 0xdf78)]); + } + } + g_mslHooked = YES; }