对于有强迫症的程序员真是难受,不仅是中国,国外的码农呼声更高。

脚本来源https://sourceforge.net/projects/devwarningpatchgen-bat/

直接浏览代码https://sourceforge.net/p/devwarningpatchgen-bat/code/ci/master/tree/DevWarningPatchGen.bat

这个脚本是一个国外大神写的。亲测78.0.3904.97(正式版本) (64 位)版本,试了有用,以前都是用反汇编找字符串,没想到这个更简单,神奇。

有同学反映80版本不行,我建议是降版本。这个批处理也好久没更新了。

把以下代码新建文本保存为 bat脚本,管理员运行就OK了。

已更新至2020-3-2版本

<# :
@echo off
copy/b "%~f0" "%temp%\%~n0.ps1" >nul
powershell -v 2 -ep bypass -noprofile "%temp%\%~n0.ps1" "'%cd% '" "'%~1'"
del "%temp%\%~n0.ps1"
echo: & pause
exit /b
#>
param([string]$cwd='.', [string]$dll)function main {write-host -f white -b black `"Chrome 'developer mode extensions' warning disabler 2019.08.05"$pathsDone = @{}if ($dll -and (gi -literal $dll)) {doPatch "DRAG'n'DROPPED" $dllexit}doPatch 'CURRENT DIRECTORY' ((gi -literal $cwd).fullName + '\')('HKLM', 'HKCU') | %{ $hive = $_('', '\Wow6432Node') | %{$key = "${hive}:\SOFTWARE$_\Google\Update\Clients"gci -ea silentlycontinue $key -r | gp | ?{ $_.CommandLine } | %{$path = $_.CommandLine -replace '"(.+?\\\d+\.\d+\.\d+\.\d+\\).+', '$1'if (!$pathsDone[$path.toLower()]) {doPatch REGISTRY $path$pathsDone[$path.toLower()] = $true}}}}
}function doPatch([string]$pathLabel, [string]$path) {if ((gi -literal $path).PSIsContainer){ $dll = Join-Path $path chrome.dll }else{ $dll = $path }if (!(Test-Path -literal $dll)) {return}''$localAppData = [Environment]::GetFolderPath('LocalApplicationData')"$pathLabel $((split-path $dll).Replace($localAppData, '%LocalAppData%'))""`tREADING $((gi $dll).name)..."$bin = [IO.BinaryReader][IO.File]::OpenRead($dll)$bytes = $bin.ReadBytes(1MB)# process PE headers$BC = [BitConverter]$coff = $BC::ToUInt32($bytes,0x3C) + 4$is64 = $BC::ToUInt16($bytes,$coff) -eq 0x8664$opthdr = $coff+20$codesize = $BC::ToUInt32($bytes,$opthdr+4)$imagebase32 = $BC::ToUInt32($bytes,$opthdr+28)# patch the flag in data section$bin.BaseStream.Position = $codesize$data = $BC::ToString($bin.ReadBytes($bin.BaseStream.Length - $codesize))$bin.Close()$flag = 'enable-automation'$stroffs = $data.IndexOf($BC::ToString($flag[1..99]))if ($stroffs -lt 0) {write-host -f red "`t$flag not found"return}if ($data.substring($stroffs-3, 2) -eq '00') {write-host -f darkgreen "`tALREADY PATCHED"return}$stroffs = $stroffs/3 - 1 + $codesize$centbrowser = $data.indexOf($BC::ToString('CentBrowser'[0..99])) -gt 0$EA = $ErrorActionPreference$ErrorActionPreference = 'silentlyContinue'$exe = join-path (split-path $path) chrome.exewhile ((get-process chrome -module | ?{ $_.FileName -eq $exe })) {forEach ($timeout in 15..0) {write-host -n -b yellow -f black `"`rChrome is running and will be terminated in $timeout sec. "write-host -n -b yellow -f darkyellow "Press ENTER to do it now. "if ([console]::KeyAvailable) {$key = $Host.UI.RawUI.ReadKey("AllowCtrlC,IncludeKeyDown,NoEcho")if ($key.virtualKeyCode -eq 13) { break }if ($key.virtualKeyCode -eq 27) { write-host; exit }}sleep 1}write-hostget-process chrome | ?{$_.MainWindowHandle.toInt64() -and ($_ | gps -file).FileName -eq $exe} | %{"`tTrying to exit gracefully..."if ($_.CloseMainWindow()) {sleep 1}}$killLabelShown = 0get-process chrome | ?{($_ | gps -file | select -expand FileName) -eq $exe} | %{if (!$killLabelShown++) {"`tTerminating background chrome processes..."}stop-process $_ -force}sleep -milliseconds 200}$ErrorActionPreference = $EA$bytes = [IO.File]::ReadAllBytes($dll)$bytes[$stroffs] = 0"`tPATCHED $flag flag"# patch the channel restriction code for stable/beta$rxChannel = '(?!<41-)83-F8-(?:03-7D|02-7F|02-0F-8F)'# old code: cmp eax,3; jge ...# new code: cmp eax,2; jg ... (jg can be 2-byte)function patch64 {$patterns = @("(?<ch>$rxChannel)-.{1,100}-(?<flag>48-8D-)"# 48-8D-15-F3-78-87-00 first flag ref# 48-8D-15-A4-78-87-00 second flag ref"(?<flag>4[8C]-8D-(?=15)).{20,100}(?<ch>$rxChannel)")forEach ($pattern in $patterns) {$pos = 0$rx = [regex]$pattern$patternDisplay = $pattern -replace '^(.{40}).+', '$1'write-host -n -f darkgray "`tLooking for $patternDisplay"do {$m = $rx.match($code, $pos)write-host -n -f darkgray .if (!$m.success) { break }$chanpos = $searchBase + $m.groups['ch'].index/3 + 2$pos = $m.groups['flag'].index + $m.groups['flag'].length$offs = $BC::ToUInt32($bytes, $searchBase + $pos/3+1)$diff = $searchBase + $pos/3+5+$offs - $stroffs#write-host ("`n{0,16:x}`t{1}" -f ($offs, $diff))} until ($diff -ge 0 -and $diff -le 6000 -and $diff % 256 -eq 0)write-host#write-host ("{0,16:x}" -f ($searchBase + $pos/3))if ($m.success) { break }$chanpos = 0}$chanpos}function patch86 {$flagOffs = [uint32]$stroffs + [uint32]$imagebase32$flagOffsStr = $BC::ToString($BC::GetBytes($flagOffs))#write-host $flagOffsStr$variants = "(?<ch>$rxChannel-.{1,300})-(68-(?<flag>`$1-.{6}`$2.{100,200})){2}","68-(?<flag>`$1-.{6}`$2).{10,150}E8.{12,32}(?<ch>$rxChannel)","E8.{12,32}(?<ch>$rxChannel).{300,500}68-(?<flag>`$1-.{6}`$2)"forEach ($variant in $variants) {$pattern = $flagOffsStr -replace '^(..)-.{6}(..)', $variant$patternDisplay = $pattern -replace '^(.{40}).+', '$1'write-host -f darkgray "`tLooking for $patternDisplay..."$minDiff = 65536foreach ($m in [regex]::matches($code, $pattern)) {$maybeFlagOffs = $BC::toUInt32($bytes, $searchBase + $m.groups['flag'].index/3)$diff = [Math]::abs($maybeFlagOffs - $flagOffs)#write-host ("`n{0,16:x}`t{1}" -f ($maybeFlagOffs, $diff))if ($diff % 256 -eq 0 -and $diff -lt $minDiff) {$minDiff = $diff$chanpos = $searchBase + $m.groups['ch'].index/3 + 2}}}$chanpos}$passes = 3foreach ($pass in $passes..1) {if ($centbrowser) { break }$searchBase = [int]($codesize/$passes * ($pass-1))$code = $BC::ToString($bytes, $searchBase, [int]($codesize/$passes) + 2000)$chanpos = if ($is64) { patch64 } else { patch86 }if ($chanpos) { break }$searchBase = 0}if ($chanpos) {#write-host ('{0:x}' -f $chanpos)$bytes[$chanpos] = 9"`tPATCHED Chrome release channel restriction"} elseif (!$centbrowser) {write-host -f red "`tUnable to find the channel code, try updating me"write-host -f red "`thttp://stackoverflow.com/a/30361260"return}"`tWriting to a temporary dll..."[IO.File]::WriteAllBytes("$dll.new",$bytes)"`tBacking up the original dll..."move -literal $dll "$dll.bak" -force"`tRenaming the temporary dll as the original dll..."move -literal "$dll.new" $dll -forcewrite-host -f green "`tDONE.`n"[GC]::Collect()
}main

去掉chrome开发者提示相关推荐

  1. Selenium启动Chrome浏览器提示“请停用以开发者模式运行的扩展程序”的解决办法

    安装了selenium,python运行下面代码: from selenium import webdriverbrowser = webdriver.Chrome() browser.get('ht ...

  2. Chrome开发者工具关于网络请求的一个隐藏技能

    这个隐藏技能的背景是,最近出于学习目的,我写了一个百度贴吧的网络爬虫,专门爬取一些指定主题的贴吧帖子. 抓取帖子用的JavaScript函数如下: function getPostByAJAX(req ...

  3. 在 Chrome 开发者工具中调试 node.js

    命令行工具 devtool ,它可以在 Chrome 的开发者工具中运行 Node.js 程序. 下面的记录显示了在一个 HTTP 服务器中设置断点的情况. 该工具基于 Electron 将 Node ...

  4. 请参阅:Chrome开发者工具中的悬停状态

    我希望看到:hover我在Chrome中徘徊的锚点的:hover样式. 在Firebug中,有一个样式下拉列表,允许我为元素选择不同的状态. 我似乎无法在Chrome中找到类似内容. 我错过了什么吗? ...

  5. 如何使用 Chrome 开发者工具 Performance tab 分析 JavaScript 的执行瓶颈

    将下面这段代码插入 SAP Spartacus payment types Component 的 next 方法: console.time('Jerry');const N = 100000;le ...

  6. 使用 Chrome 开发者工具的 lighthouse 功能分析 web 应用的性能问题

    Optimize website speed 每当您着手提高站点的负载性能时,请始终从 audit 开始. 审计有两个重要功能: 它为您创建了一个基线来衡量后续更改. 它为您提供有关哪些更改将产生最大 ...

  7. Chrome 开发者工具无法显示服务器正常返回的 HTTP 请求 - Failed to load response data

    今天做开发时遇到一个问题,Chrome 开发者工具 network 标签里,虽然一个 HTTP 请求已经成功从服务器端返回,但是 Chrome 开发者工具里,仍然显示 Failed to load r ...

  8. Chrome开发者工具关于网络请求的一个隐藏技能 1

    这个隐藏技能的背景是,最近出于学习目的,我写了一个百度贴吧的网络爬虫,专门爬取一些指定主题的贴吧帖子. 抓取帖子用的JavaScript函数如下: function getPostByAJAX(req ...

  9. Chrome开发者工具使用小技巧

    正所谓不用Chrome的开发者不合格,不晓得Chrome开发者工具进行web调试也不是合格的web开发者.所以本文总结了Chrome开发者工具使用的一些小技巧. 一:首先来说下如何打开开发者工具吧: ...

最新文章

  1. Windows窗体的所有菜单
  2. 案例开发分析 || ​​​​​​​Scheduler组件
  3. 什么是循环神经网络——学习笔记
  4. 基于知识图谱的问答系统入门—NLPCC2016KBQA数据集
  5. 修改shell提示符的显示格式
  6. c++ 结构体遍历_PBRT-E4.3-层次包围体(BVH)(一)
  7. android gridview行分割线,Android中控件GridView实现设置行列分割线的方法示例
  8. linux3.3内核去哪下载,Linux Kernel下载|Linux Kernel v3.18.3 稳定版 - 121下载站
  9. 【BZOJ1001】狼抓兔子,平面图转对偶图(从最小割到最短路)
  10. [USACO14JAN]Recording the Moolympics
  11. 区块链 POW功能结构讲解 通用极小代码结构 区块链所必须的组件模块
  12. Unity VideoPlayer视频播放器
  13. 如何利用Python对服务器的接口进行压力测试
  14. iperf3 for android8,iperf-3.0.7_android.zip
  15. 电脑用户计算机名文件夹,电脑用户名文件夹名称更改
  16. Python_封装案例(士兵突击)
  17. 【转】卡马克快速平方根——平方根倒数算法
  18. 下拉框反选的几种方式
  19. Agora Flat 开源教室一周年总结
  20. docker-comose搭建openldap + jenkins

热门文章

  1. 白帽子讲Web安全——客户端安全
  2. goland的激活码
  3. 宽容与忍耐 (转摘)
  4. surface pro java_我为何独爱微软的Surface Pro?
  5. #UNTF致敬我的第一篇wp——(爷的历险记Misc)
  6. 「推荐」Linux远程连接工具之ssh客户端工具
  7. 邮箱哪个好?手机邮箱下载渠道
  8. Docker构建jdk8镜像出现ADD failed: file not found in build context or excluded by .dockerignore..解决方案
  9. 二本计算机考北邮难度,考北邮研究生难度大吗?
  10. 【Java反射机制详解】—— 每天一点小知识