婆罗门
精华
|
战斗力 鹅
|
回帖 0
注册时间 2015-1-15
|
楼主 |
发表于 2024-2-22 11:37
|
显示全部楼层
本帖最后由 Sza 于 2024-2-22 11:39 编辑
我不懂代码。为了回你这个问题特地按知乎Henryzhao的回答https://www.zhihu.com/question/642107690/answer/3402581666 提供的工具看了下explorer.exe的代码。简而言之,我按函数名猜可能是看“设置-时间和语言-区域-国家或地区“”的。
我贴下反编译后的代码:
下面这段是ShellFeedsDMAHelpers::IsDeviceInDmaRegion(uchar *)的
- __int64 __fastcall ShellFeedsDMAHelpers::IsDeviceInDmaRegion(
- ShellFeedsDMAHelpers *this,
- unsigned __int8 *a2,
- unsigned int *a3)
- {
- unsigned __int8 *v4; // rdx
- int ShellFeedsRegKey; // ebx
- unsigned int v6; // r8d
- unsigned int v7; // r9d
- int v9; // [rsp+20h] [rbp-8h]
- wil::details::in1diag3 *retaddr; // [rsp+28h] [rbp+0h]
- unsigned __int8 v11; // [rsp+38h] [rbp+10h] BYREF
- int Data; // [rsp+40h] [rbp+18h] BYREF
- Data = 0;
- ShellFeedsRegKey = ShellFeedsRegistryHelper::GetShellFeedsRegKey(L"IsDeviceInDmaRegion", (LPBYTE)&Data, a3);
- if ( ShellFeedsRegKey == -2147024894 )
- {
- v11 = 0;
- ShellFeedsRegKey = ShellFeedsDMAHelpers::GetDeviceDMAStatusInternal((ShellFeedsDMAHelpers *)&v11, v4);
- if ( ShellFeedsRegKey < 0 )
- {
- LABEL_5:
- wil::details::in1diag3::Return_Hr(
- retaddr,
- (void *)0x3E,
- (unsigned int)"internal\\shellcommonshell\\inc\\ShellFeeds\\ShellFeedsDMAHelpers.h",
- (const char *)(unsigned int)ShellFeedsRegKey,
- v9);
- return (unsigned int)ShellFeedsRegKey;
- }
- Data = v11;
- ShellFeedsRegistryHelper::SetShellFeedsRegKey(L"IsDeviceInDmaRegion", (const unsigned __int16 *)v11, v6, v7);
- }
- if ( ShellFeedsRegKey < 0 )
- goto LABEL_5;
- *(_BYTE *)this = Data;
- return 0LL;
- }
复制代码
下面这段是ShellFeedsDMAHelpers::GetDeviceDMAStatusInternal(uchar *)的
- __int64 __fastcall ShellFeedsDMAHelpers::GetDeviceDMAStatusInternal(ShellFeedsDMAHelpers *this, unsigned __int8 *a2)
- {
- unsigned int v3; // ebx
- __int64 v4; // rcx
- int v5; // eax
- int *v7; // [rsp+20h] [rbp-20h] BYREF
- int v8[4]; // [rsp+28h] [rbp-18h] BYREF
- v3 = 0;
- if ( (unsigned __int8)wil::details::FeatureImpl<__WilFeatureTraits_Feature_IntegratedServicesPolicyControl>::__private_IsEnabled(
- &`wil::Feature<__WilFeatureTraits_Feature_IntegratedServicesPolicyControl>::GetImpl'::`2'::impl,
- a2) )
- {
- v8[0] = 996156123;
- v7 = v8;
- v8[1] = 1263197949;
- v8[2] = 73453494;
- v8[3] = 1014982109;
- v5 = winrt::impl::factory_cache_entry<winrt::Windows::Internal::System::Profile::RegionPolicyEvaluator,winrt::Windows::Internal::System::Profile::IRegionPolicyEvaluatorStatics>::call<_lambda_6a0f056e3d320019bdc01414d2a02aac_ &>(
- v4,
- &v7);
- if ( v5 < 0 )
- return (unsigned int)-2147418113;
- if ( v5 <= 1 )
- {
- *(_BYTE *)this = 0;
- return v3;
- }
- if ( v5 != 2 )
- return (unsigned int)-2147418113;
- *(_BYTE *)this = 1;
- }
- return v3;
- }
复制代码
|
|