科技颠覆者 发表于 2024-7-23 17:56:59

原神获取抽卡链接 powershell实验下令的下令( iex(irm ‘https://img.lelae

什么是powershell?

PowerShell是一种由Microsoft开发的跨平台的下令行界面和脚本语言。它最初是为Windows操作体系计划的,但现在已经支持Linux和macOS等其他操作体系。PowerShell可以实验各种任务,包括文件和文件夹管理、体系设置和管理、网络管理、安全和身份验证等。它使用.NET框架和下令行Shell语法,可以与其他Microsoft技术(如Active Directory和Exchange Server)以及第三方工具和库集成。 PowerShell还提供了一些高级功能,如对象管道、脚本调试和可扩展性,使得它成为体系管理员和开发人员的告急工具之一。
iex 是 Invoke-Expression 下令缩写
​https://img-blog.csdnimg.cn/05f3f40cb79443e8846794e85a76aaa2.jpeg#pic_center
irm 是 Invoke-RestMethod 下令缩写
​https://img-blog.csdnimg.cn/a6f68149e88d491f989748c34a20f149.jpeg#pic_center
gf.ps1代码如下:直接访问上方网址链接即可下载
# script version 0.9
# author: jogerj

function processWishUrl($wishUrl) {
    # check validity
    if ($wishUrl -match "https:\/\/webstatic") {
      if ($wishUrl -match "hk4e_global") {
            $checkUrl = $wishUrl -replace "https:\/\/webstatic.+html\?", "https://hk4e-api-os.mihoyo.com/event/gacha_info/api/getGachaLog?"
      } else {
            $checkUrl = $wishUrl -replace "https:\/\/webstatic.+html\?", "https://hk4e-api.mihoyo.com/event/gacha_info/api/getGachaLog?"
      }
      $urlResponseMessage = Invoke-RestMethod -URI $checkUrl | % {$_.message}
    } else {
      $urlResponseMessage = Invoke-RestMethod -URI $wishUrl | % {$_.message}
    }
    if ($urlResponseMessage -ne "OK") {
      Write-Host "$(0x627e)$(0x5230)$(0x7684)$(0x94fe)$(0x63a5)$(0x5df2)$(0x7ecf)$(0x8fc7)$(0x671f)$(0x6216)$(0x8005)$(0x635f)$(0x574f)$(0x002c)$(0x8bf7)$(0x91cd)$(0x65b0)$(0x6253)$(0x5f00)$(0x7948)$(0x613f)$(0x5386)$(0x53f2)$(0x6765)$(0x83b7)$(0x53d6)$(0x65b0)$(0x94fe)$(0x63a5)$(0xff01)" -ForegroundColor Yellow
      return $False
    }
    # OK
    Write-Host $wishURL
    Set-Clipboard -Value $wishURL
    Write-Host "$(0x62bd)$(0x5361)$(0x5206)$(0x6790)$(0x5730)$(0x5740)$(0x83b7)$(0x53d6)$(0x6210)$(0x529f)$(0xff0c)$(0x8bf7)$(0x590d)$(0x5236)$(0x5230)$(0x201c)$(0x63d0)$(0x74e6)$(0x7279)$(0x5c0f)$(0x52a9)$(0x624b)$(0x201d)$(0x4f7f)$(0x7528)" -ForegroundColor Green
    Write-Host "$(0x63d0)$(0x74e6)$(0x7279)$(0x5c0f)$(0x52a9)$(0x624b)$(0x795d)$(0x60a8)$(0x6c14)$(0x6ee1)$(0x6ee1)$(0xff0c)$(0x5341)$(0x8fde)$(0x51fa)$(0x91d1)$(0xff0c)$(0x5c0f)$(0x4fdd)$(0x5e95)$(0x5fc5)$(0x4e2d)$(0xff01)" -ForegroundColor Yellow
    return $True
}

$reg = "china"
$logPath = ::ExpandEnvironmentVariables("%userprofile%\AppData\LocalLow\miHoYo\Genshin Impact\output_log.txt");
if (!(Test-Path $logPath) -or $reg -eq "china") {
    $logPath = ::ExpandEnvironmentVariables("%userprofile%\AppData\LocalLow\miHoYo\$(0x539f)$(0x795e)\output_log.txt");
    if (!(Test-Path $logPath)) {
      Write-Host "$(0xe689)" -ForegroundColor Red
      if (-NOT (::GetCurrent()).IsInRole( "Administrator")) {
            Write-Host "$(0x662f)$(0x5426)$(0x4ee5)$(0x7ba1)$(0x7406)$(0x5458)$(0x8eab)$(0x4efd)$(0x6765)$(0x8fd0)$(0x884c)$(0x811a)$(0x672c)$(0x003f)$(0x6309)$(0x0045)$(0x006e)$(0x0074)$(0x0065)$(0x0072)$(0x952e)$(0x6765)$(0x7ee7)$(0x7eed)$(0x6216)$(0x6309)$(0x5176)$(0x4ed6)$(0x952e)$(0x6765)$(0x53d6)$(0x6d88)"
            $keyInput = ::ReadKey($true).Key
            if ($keyInput -ne "13") {
                return
            }
            $arguments = "& '" +$myinvocation.mycommand.definition + "'"
            Start-Process powershell -Verb runAs -ArgumentList "-noexit $arguments $reg"
            break
      }
      return
    }
}

$logs = Get-Content -Path $logPath
$regexPattern = "(?m).:/.+(GenshinImpact_Data|YuanShen_Data)"
$logMatch = $logs -match $regexPattern

if (-Not $logMatch) {
    Write-Host "$(0x627e)$(0x4e0d)$(0x5230)$(0x539f)$(0x795e)$(0x65e5)$(0x5fd7)$(0x6587)$(0x4ef6)$(0x8bf7)$(0x81f3)$(0x5c11)$(0x6253)$(0x5f00)$(0x7948)$(0x613f)$(0x5386)$(0x53f2)$(0x754c)$(0x9762)$(0x4e00)$(0x6b21)" -ForegroundColor Red
    pause
    return
}

$gameDataPath = ($logMatch | Select -Last 1) -match $regexPattern
$gameDataPathFetchSuccess = $True
try {
    $gameDataPath = Resolve-Path $Matches -ErrorAction Stop
} catch {
    Write-Host "$(0x68c0)$(0x6d4b)$(0x5230)$(0x4e2d)$(0x6587)$(0x8def)$(0x5f84)$(0xff0c)$(0x4f7f)$(0x7528)$(0x5907)$(0x7528)$(0x65b9)$(0x6cd5)$(0x002e)$(0x002e)$(0x002e)" -ForegroundColor Red
    $gameDataPathFetchSuccess = $False
}
if($gameDataPathFetchSuccess){
    # Method 1
    $cachePath = "$gameDataPath\\webCaches\\Cache\\Cache_Data\\data_2"
    if (Test-Path $cachePath) {
      $tmpFile = "$env:TEMP/ch_data_2"
      Copy-Item $cachePath -Destination $tmpFile
      $content = Get-Content -Encoding UTF8 -Raw $tmpfile
      $splitted = $content -split "1/0/" | Select -Last 1
      $found = $splitted -match "https.+?game_biz=hk4e_(global|cn)"
      Remove-Item $tmpFile
      if ($found) {
            $wishUrl = $Matches
            if (processWishUrl $wishUrl) {
                return
            }
      }
      Write-Host "$(0x4f7f)$(0x7528)$(0x5907)$(0x7528)$(0x65b9)$(0x6cd5)$(0x91cd)$(0x8bd5)$(0x4e2d)..." -ForegroundColor Red
    }

    # Method 2 (Credits to PrimeCicada for finding this path)
    $cachePath = "$gameDataPath\\webCaches\\Service Worker\\CacheStorage\\f944a42103e2b9f8d6ee266c44da97452cde8a7c"
    if (Test-Path $cachePath) {
      Write-Host "$(0x4f7f)$(0x7528)$(0x5907)$(0x7528)$(0x65b9)$(0x6cd5)$(0x0020)$(0x0028)$(0x0053)$(0x0057)$(0x0029)" -ForegroundColor Yellow
      $cacheFolder = Get-ChildItem $cachePath | sort -Property LastWriteTime -Descending | select -First 1
      $content = Get-Content "$($cacheFolder.FullName)\\00d9a0f4d2a83ce0_0" | Select-String -Pattern "https.*#/log"
      $logEntry = $content.ToString()
      $wishUrl = $logEntry -match "https.*#/log"
      if ($wishUrl) {
            $wishUrl = $Matches
            if (processWishUrl $wishUrl) {
                return
            }

      }
      Write-Host "$(0x5907)$(0x7528)$(0x65b9)$(0x6cd5)$(0x0028)$(0x0053)$(0x0057)$(0x0029)$(0x5931)$(0x8d25)$(0x002c)$(0x4f7f)$(0x7528)$(0x5907)$(0x7528)$(0x65b9)$(0x6cd5)$(0x5c1d)$(0x8bd5)$(0x4e2d)$(0x002e)$(0x002e)$(0x002e)" -ForegroundColor Red
    }

    # Method 3
    Write-Host "$(0x4f7f)$(0x7528)$(0x5907)$(0x7528)$(0x65b9)$(0x6cd5)$(0x0020)$(0x0028)$(0x0043)$(0x0043)$(0x0056)$(0x0029)" -ForegroundColor Yellow
    $cachePath = "$gameDataPath\\webCaches\\Cache\\Cache_Data"
    $tempPath = mkdir "$env:TEMP\\feixiaoqiu" -Force
    # downloads ChromeCacheView
    Invoke-WebRequest -Uri "https://www.nirsoft.net/utils/chromecacheview.zip" -OutFile "$tempPath\\chromecacheview.zip"
    Expand-Archive "$tempPath\\chromecacheview.zip" -DestinationPath "$tempPath\\chromecacheviewer" -Force
    & "$tempPath\chromecacheviewer\\ChromeCacheView.exe" -folder $cachePath /scomma "$tempPath\\cache_data.csv"
    # processing cache takes a while
    while (!(Test-Path "$tempPath\\cache_data.csv")) { Start-Sleep 1 }
    $wishLog = Import-Csv "$tempPath\\cache_data.csv" | select"Last Accessed", "URL" | ? URL -like "*event/gacha_info/api/getGachaLog*" | Sort-Object -Descending { $_."Last Accessed" -as } | select -first 1
    $wishUrl = $wishLog | % {$_.URL.Substring(4)}
    # clean up
    Remove-Item -Recurse -Force $tempPath
    if ($wishUrl) {
      if (processWishUrl $wishUrl) {
            return
      }
    }

    Write-Host "$(0x94fe)$(0x63a5)$(0x5df2)$(0x590d)$(0x5236)$(0x5230)$(0x526a)$(0x8d34)$(0x677f)$(0x002c)$(0x8bf7)$(0x7c98)$(0x8d34)$(0x5230)$(0x0066)$(0x0065)$(0x0069)$(0x0078)$(0x0069)$(0x0061)$(0x006f)$(0x0071)$(0x0069)$(0x0075)$(0x002e)$(0x0063)$(0x006f)$(0x006d)" -ForegroundColor Red
    pause
} else {
    Write-Host "$(0x8bf7)$(0x8fd4)$(0x56de)$(0x5386)$(0x53f2)$(0x8bb0)$(0x5f55)$(0x9875)$(0x9762)$(0x5e76)$(0x5168)$(0x9009)$(0x0028)$(0x0043)$(0x0074)$(0x0072)$(0x006c)$(0x0020)$(0x0041)$(0x0029)$(0x590d)$(0x5236)$(0x5168)$(0x90e8)$(0x0028)$(0x0043)$(0x0074)$(0x0072)$(0x006c)$(0x0020)$(0x0043)$(0x0029)$(0x7136)$(0x540e)$(0x8fd4)$(0x56de)$(0x8fd9)$(0x91cc)$(0x7c98)$(0x8d34)$(0x0028)$(0x0043)$(0x0074)$(0x0072)$(0x006c)$(0x0020)$(0x0056)$(0x0029)" -ForegroundColor Green
    pause
    $m=(((Get-Clipboard -TextFormatType Html) | sls "(https:/.+log)").Matches.Value)
    $m
    Set-Clipboard -Value $m
    Write-Host "$(0x62bd)$(0x5361)$(0x5206)$(0x6790)$(0x5730)$(0x5740)$(0x83b7)$(0x53d6)$(0x6210)$(0x529f)$(0xff0c)$(0x8bf7)$(0x590d)$(0x5236)$(0x5230)$(0x201c)$(0x63d0)$(0x74e6)$(0x7279)$(0x5c0f)$(0x52a9)$(0x624b)$(0x201d)$(0x4f7f)$(0x7528)" -ForegroundColor Green
    Write-Host "$(0x63d0)$(0x74e6)$(0x7279)$(0x5c0f)$(0x52a9)$(0x624b)$(0x795d)$(0x60a8)$(0x6c14)$(0x6ee1)$(0x6ee1)$(0xff0c)$(0x5341)$(0x8fde)$(0x51fa)$(0x91d1)$(0xff0c)$(0x5c0f)$(0x4fdd)$(0x5e95)$(0x5fc5)$(0x4e2d)$(0xff01)" -ForegroundColor Yellow
}
这段代码的主要作用是分析由米游社提供的祈愿记载网址,并在分析成功后将其复制到剪贴板中,以便于后续操作。从代码中看,该脚本不包含任何明显的恶意行为,它只会实验一些根本的字符串匹配、API调用、输出信息和操作剪贴板等常见操作,因此从代码本身的角度来说,它并不对计算机有害。
但是,使用该脚本时应注意以下几点:
该脚本必要在 PowerShell 情况下运行,假如你不熟悉 PowerShell 的使用,那么在操作过程中大概会出现一些不必要的问题,因此发起在使用前先了解一些根本的 PowerShell 使用方法。
该脚本必要从米游社提供的祈愿记载网址中分析出相关信息,假如该网址被窜改或存在安全问题,那么该脚本大概会受到影响或者实验错误的操作。
该脚本通过访问米游社的 API 来获取祈愿记载信息,假如该 API 出现故障或者网络不稳定,那么该脚本大概会实验失败或者产生不正确的效果。
总之,假如你使用该脚本时保持警惕并注意上述问题,那么该脚本不应该对计算机造成任何实质性的危害。

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 原神获取抽卡链接 powershell实验下令的下令( iex(irm ‘https://img.lelae