手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

Chrome提示:请停用以开发者模式运行的扩展程序

时间:2024-10-15 04:32:08

1、在桌面新建txt文本文档,并复制以下代码到文档保存之后关闭。

2、<#:@echooffcopy/b"%~f0""%temp%\%~n0.ps1">nulpowershell-Version2-ExecutionPolicybypass-noprofile"%temp%\%~n0.ps1""%cd%""%~1"del"%temp%\%~n0.ps1"pauseexit/b#>param([string]$cwd='.',[string]$dll)functionmain{"Chrome'developermodeextensions'warningdisablerv1.0.10.20170114`n"$pathsDone=@{}if($dll-and(gi-literal$dll)){doPatch"DRAG'n'DROPPED"((gi-literal$dll).directoryName+'\')exit}doPatchCURRENT((gi-literal$cwd).fullName+'\')('HKLM','HKCU')|%{$hive=$_('','\Wow6432Node')|%{$key="${hive}:\SOFTWARE$_\Google\Update\Clients"gci-easilentlycontinue$key-r|gp|?{$_.CommandLine}|%{$path=$_.CommandLine-replace'"(.+?\\\d+\.\d+\.\d+\.\d+\\).+','$1'doPatchREGISTRY$path}}}}functiondoPatch([string]$pathLabel,[string]$path){if($pathsDone[$path.toLower()]){return}$dll=$path+"chrome.dll"if(!(test-path-literal$dll)){return}"=======================""$pathLabelPATH$((gi-literal$dll).DirectoryName)""`tREADINGChrome.dll..."$bytes=[IO.File]::ReadAllBytes($dll)#processPEheaders$BC=[BitConverter]$coff=$BC::ToUInt32($bytes,0x3C)+4$is64=$BC::ToUInt16($bytes,$coff)-eq0x8664$opthdr=$coff+20$codesize=$BC::ToUInt32($bytes,$opthdr+4)$imagebase32=$BC::ToUInt32($bytes,$opthdr+28)#patchtheflagindatasection$data=$BC::ToString($bytes,$codesize)$flag="ExtensionDeveloperModeWarning"$stroffs=$data.IndexOf($BC::ToString($flag[1..99]))/3-1if($stroffs-lt0){write-host-fred"`t$flagnotfound"return}$stroffs+=$codesizeif($bytes[$stroffs]-eq0){write-host-fdarkgreen"`tALREADYPATCHED"return}$exe=join-path(split-path$path)chrome.exe$EA=$ErrorActionPreference$ErrorActionPreference='silentlyContinue'while((get-processchrome-module|?{$_.FileName-eq$exe})){forEach($timeoutin15..0){write-host-n-byellow-fblack`"`rChromeisrunningandwillbeterminatedin$timeoutsec."write-host-n-byellow-fdarkyellow"PressENTERtodoitnow."if([console]::KeyAvailable){$key=$Host.UI.RawUI.ReadKey("AllowCtrlC,IncludeKeyDown,NoEcho")if($key.virtualKeyCode-eq13){break}if($key.virtualKeyCode-eq27){write-host;exit}}sleep1}write-hostget-processchrome|?{$_.MainWindowHandle.toInt64()-and($_|gps-file).FileName-eq$exe}|%{"`tTryingtoexitgracefully..."if($_.CloseMainWindow()){sleep1}}$killLabelShown=0get-processchrome|?{($_|gps-file|select-expandFileName)-eq$exe}|%{if(!$killLabelShown++){"`tTerminatingbackgroundchromeprocesses..."}stop-process$_-force}sleep-milliseconds200}$ErrorActionPreference=$EA$bytes[$stroffs]=0"`tPATCHED$flagflag"#patchthechannelrestrictioncodeforstable/beta$code=$BC::ToString($bytes,0,$codesize)$rxChannel='83-F8-(?:03-7D|02-7F)'#oldcode:cmpeax,3;jge...#newcode:cmpeax,2;jg...$chanpos=0try{if($is64){$pos=0$rx=[regex]"$rxChannel-.{1,100}-48-8D"do{$m=$rx.match($code,$pos)if(!$m.success){break}$chanpos=$m.index/3+2$pos=$m.index+$m.length+1$offs=$BC::ToUInt32($bytes,$pos/3+1)$diff=$pos/3+5+$offs-$stroffs}until($diff-ge0-and$diff-le4096-and$diff%256-eq0)if(!$m.success){$rx=[regex]"84-C0.{18,48}($rxChannel)-.{30,60}84-C0"$m=$rx.matches($code)if($m.count-ne1){throw}$chanpos=$m[0].groups[1].index/3+2}}else{$flagOffs=[uint32]$stroffs+[uint32]$imagebase32$flagOffsStr=$BC::ToString($BC::GetBytes($flagOffs))$variants="(?<channel>$rxChannel-.{1,100})-68-(?<flag>`$1-.{6}`$2)","68-(?<flag>`$1-.{6}`$2).{300,500}E8.{12,32}(?<channel>$rxChannel)","E8.{12,32}(?<channel>$rxChannel).{300,500}68-(?<flag>`$1-.{6}`$2)"forEach($variantin$variants){$pattern=$flagOffsStr-replace'^(..)-.{6}(..)',$variant"`tLookingfor$($pattern-replace'\?<.+?>','')..."$minDiff=65536foreach($min[regex]::matches($code,$pattern)){$maybeFlagOffs=$BC::toUInt32($bytes,$m.groups['flag'].index/3)$diff=[Math]::abs($maybeFlagOffs-$flagOffs)if($diff%256-eq0-and$diff-lt$minDiff){$minDiff=$diff$chanpos=$m.groups['channel'].index/3+2}}}if(!$chanpos){throw}}}catch{write-host-fred"`tUnabletofindthechannelcode,tryupdatingme"write-host-fred"`thttp://stackoverflow.com/a/30361260"return}$bytes[$chanpos]=9"`tPATCHEDChromereleasechannelrestriction""`tWritingtoatemporarydll..."[IO.File]::WriteAllBytes("$dll.new",$bytes)"`tBackinguptheoriginaldll..."move-literal$dll"$dll.bak"-force"`tRenamingthetemporarydllastheoriginaldll..."move-literal"$dll.new"$dll-force$pathsDone[$path.toLower()]=$truewrite-host-fgreen"`tDONE.`n"[GC]::Collect()}main

3、随便打开一个文件夹依次点击,工具→文件夹选项→查看→找到隐藏已知文件类型的扩展名→取消勾选点击应用确定。

4、然后回到桌面把刚才的txt文本文档重命名为DevWarningPatch.bat,(这里要注意,重命名要包括后面的.txt),提示如果要改变文件扩展名,可能会导致文件不可用,点击确定,然后右键以管理员身份运行,运行完成就OK了,再打开谷歌浏览器看看?

© 手抄报圈