4 ms·
Took a quick look, and this appears to be enabled if [NSLocale.currentLocale.countryCode isEqualToString:@"CN"]: char ____ZN7Backend6Google12SSBUtilities24sh
by saagarjha 7y ago
Took a quick look, and this appears to be enabled if [NSLocale.currentLocale.countryCode isEqualToString:@"CN"]:
char ____ZN7Backend6Google12SSBUtilities24shouldConsultWithTencentEv_block_invoke_2(void * _block) {
rax = [NSLocale currentLocale];
rax = [rax retain];
r14 = [[rax countryCode] retain];
[rax release];
rbx = [r14 isEqualToString:@"CN"] != 0x0 ? 0x1 : 0x0;
[r14 release];
rax = rbx;
return rax;
}
Update: the code for Tencent Safe Browsing seems to be very similar to that which talks to Google, down to it being under a "Google" namespace, the API endpoints being named the same, and performing hashing which seems to match the "Update API" here: https://developers.google.com/safe-browsing/v4/update-api https://developers.google.com/safe-browsing/v4/update-api. I think this is just "whatever Google could see before, Tencent can see now, if you're in China". I'm no expert, so I have no idea if that's k-anonymous or whatever if Tencent/Google decide they want to track you, but in either case it's just shifting who's getting your hashes.
- deleted 7y ago[deleted]
- rocqua 7y agoWhat kind of code am I looking at, it seems pretty cool. I this some automatically 'reverse compiled' assembly? In any case, I'd love to know how you generated this. Would be very cool to get something similar out of an executable.
- saagarjha 7y agoIt's "decompilation" of a block invoke for Backend::Google::SSBUtilities::shouldConsultWithTencent() taken by opening /System/Library/PrivateFrameworks/SafariSafeBrowsing.framework/SafariSafeBrowsing in Hopper Disassembler.
- elwell 7y ago> ____ZN7Backend6Google12SSBUtilities24shouldConsultWithTencentEv_block_invoke_2 I'm glad I don't use Objective-C... That's some Java level function naming there. Edit: may have spoke too soon, appears to be possible reverse engineered / decompiled?
- saagarjha 7y agoThis is a block invoke for a mangled C++ function. You'd know it as a lambda inside of Backend::Google::SSBUtilities::shouldConsultWithTencent().
- deleted 7y ago[deleted]
- jimktrains2 7y agoIt appears to be the symbol in the binary. C++ also does similar things. It's called mangling. https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling It's also the reason you sometimes need to extern c or otherwise mark symbols being exported via a c-abi in c++ so that they don't get mangled.
- lelf 7y agobash$ c++filt <<< ____ZN7Backend6Google12SSBUtilities24shouldConsultWithTencentEv_block_invoke_2 invocation function for block in Backend::Google::SSBUtilities::shouldConsultWithTencent() Edit: what are downvotes for? That is the standard way to decipher C++ mangling, using built-in (binutils) tools.
- msbarnett 7y agoYou’re looking at the method name after the compiler got done mangling type information into it for the linker. The human-readable name that (what appears to be an anonymous block) likely appears within in the source code appears to be “shouldConsultWithTencent” in a namespace (class?) “Backend::Google::SSBUtilities”. The other line noise encodes return and argument types via the process of Name Mangling: https://en.wikipedia.org/wiki/Name_mangling https://en.wikipedia.org/wiki/Name_mangling
- eastendguy 7y ago> if [NSLocale.currentLocale.countryCode isEqualToString:@"CN"]: So even for US and EU based users the data is send to Tencent just because they enabled Chinese language support? Who programmed that?
- toxik 7y agoI wonder if there are similar oversights with the US locale, seeing as a lot of developers prefer English interfaces to the somewhat craptastic localizations.
- solidangle 7y agoNot just EU and US based users, but also Hong Kong and Taiwan based users.
- yorwba 7y agoHong Kong, Macao and Taiwan all have their own ISO 3166 codes and users there are unlikely to accidentally set the region to CN, since the difference between simplified and traditional characters is quite obvious.
- Gaelan 7y agoiOS has separate region and language settings. Quick look at Apple docs suggests that this is the former.
- gowld 7y agoNo, it's the latter. In NSLocale, "region" is a subtype of language, as in a regional dialect, not an independent dimension. https://developer.apple.com/documentation/foundation/nslocale/1643060-countrycode?language=objc https://developer.apple.com/documentation/foundation/nslocal... https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html#//apple_ref/doc/uid/10000171i-CH15-SW9 https://developer.apple.com/library/archive/documentation/Ma...
- carol0987 7y agoSafariSafeBrowsing.framework