From 752638a617c33947ecce4ff3eac9a6fcd4c2d196 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 4 Apr 2023 10:57:15 +0200 Subject: [PATCH] * Split lines for readability * Use local file * Specific deletion of archive * Caps * Alias for directory --- hazedumper/generate.bat | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/hazedumper/generate.bat b/hazedumper/generate.bat index eb2b041..68046fc 100644 --- a/hazedumper/generate.bat +++ b/hazedumper/generate.bat @@ -1,32 +1,39 @@ @ECHO off -IF NOT EXIST hazedumper.exe ( +IF NOT EXIST .\hazedumper.exe ( ECHO Download latest release of hazedumper + SET "dir=Windows" + :: Download latest release - FOR /f "tokens=1,* delims=:" %%A IN ('curl -ks https://api.github.com/repos/frk1/hazedumper-rs/releases/latest ^| find "browser_download_url"') do ( + FOR /f "tokens=1,* delims=:" %%A IN ('curl -ks ^ + https://api.github.com/repos/frk1/hazedumper-rs/releases/latest ^| ^ + find "browser_download_url"') DO ( curl -kOL %%B ) :: Unzip the file - PowerShell -nologo -noprofile -command "& { $shell = New-Object -COM Shell.Application; $target = $shell.NameSpace('%CD%'); $zip = $shell.NameSpace('%CD%\Windows.zip'); $target.CopyHere($zip.Items(), 16); }" + PowerShell -NoLogo -NoProfile -Command "& { $shell = New-Object -COM" ^ + "Shell.Application; $target = $shell.NameSpace('%CD%'); $zip =" ^ + "$shell.NameSpace('%CD%\%dir%.zip'); $target.CopyHere($zip.Items(), 16); }" ^ + "%dir%" :: Move the binary to the current directory - MOVE .\Windows\*.exe .\ + MOVE .\%dir%\*.exe .\ :: Delete unnecessary file and directory - DEL Windows* - RMDIR Windows\ + DEL %dir%.zip + RMDIR %dir%\ ) -IF NOT EXIST config.json ( +IF NOT EXIST .\config.json ( ECHO Download latest config file for CS:GO :: Download curl -kOL https://raw.githubusercontent.com/frk1/hazedumper/master/config.json ) -ECHO Generate offsets using hazedumper (be sure CS:GO is open and at least on menu screen) +ECHO Generate offsets using hazedumper :: Generate files .\hazedumper.exe