Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: Analyze crash minidumps by aveyo v1.0b
- :: You need to install Standalone Debugging Tools for Windows (WinDbg) before using this script!
- :: http://msdn.microsoft.com/library/windows/hardware/ff551063%28v=vs.85%29.aspx
- :: In the installation wizard, select Debugging Tools for Windows, and clear all other components
- :: and override the default install path to C:\ instead (it will use C:\Debuggers)
- :: No more wasting internet bandwidth with 30MB+ dumps (like in dota2). Send just the text summary
- @ECHO off
- CALL :CHECK_OS
- :: Check for Debugging Tools for Windows installation
- :: If script can't find them it means MS changed paths again
- SET "TOOLS_FOUND="
- SET "DEBUG_TOOLS=%PFVAR%\Debugging Tools for Windows (x86)"
- IF EXIST "%DEBUG_TOOLS%\kd.exe" SET /A TOOLS_FOUND=1
- IF NOT DEFINED TOOLS_FOUND SET "DEBUG_TOOLS=C:\Program Files\Debugging Tools for Windows (x64)"
- IF EXIST "%DEBUG_TOOLS%\kd.exe" SET /A TOOLS_FOUND=1
- SET "DEBUG_TOOLS=%PFVAR%\Windows Kits\8.1\Debuggers\x86"
- IF EXIST "%DEBUG_TOOLS%\kd.exe" SET /A TOOLS_FOUND=1
- SET "DEBUG_TOOLS=%PFVAR%\Windows Kits\8.1\Debuggers\x64"
- IF EXIST "%DEBUG_TOOLS%\kd.exe" SET /A TOOLS_FOUND=1
- SET "DEBUG_TOOLS=C:\Debuggers\x86"
- IF EXIST "%DEBUG_TOOLS%\kd.exe" SET /A TOOLS_FOUND=1
- SET "DEBUG_TOOLS=C:\Debuggers\x64"
- IF EXIST "%DEBUG_TOOLS%\kd.exe" SET /A TOOLS_FOUND=1
- IF NOT DEFINED TOOLS_FOUND CALL :ERR You need to install Standalone Debugging Tools for Windows (WinDbg) before using this script!
- IF NOT DEFINED TOOLS_FOUND CALL :ERR http://msdn.microsoft.com/library/windows/hardware/ff551063%28v=vs.85%29.aspx
- IF NOT DEFINED TOOLS_FOUND CALL :ERR In the installation wizard, select Debugging Tools for Windows, and clear all other components
- IF NOT DEFINED TOOLS_FOUND CALL :ERR and override the default install path to C:\ instead (it will use C:\Debuggers)
- rem CALL :XECHO Debugging Tools for Windows="%DEBUG_TOOLS%"
- :: Choose minidump file by filepicker window
- CALL :XECHO Choose the .dmp/.mdmp file you want to analyze:
- IF NOT EXIST "%~1" CALL :VBCHOOSEFILE
- :: Choose minidump file by 1st parameter, skipping filepicker
- IF EXIST "%~1" SET "ChosenFile=%~1"
- IF EXIST "%~1" CALL :__VBCHOOSEFILE_VERIFY
- FOR /F "tokens=*" %%I IN ("%ChosenFile%") DO ( SET "DUMPDIR=%%~dpI" &SET "DUMPFILE=%%~nI%%~xI")
- CALL :XECHO Dump file = %ChosenFile%
- PUSHD "%DUMPDIR%"
- "%DEBUG_TOOLS%\kd.exe" -y "srv*c:\symbols*http://msdl.microsoft.com/download/symbols" -logo "%ChosenFile%.txt" -c ".reload;!analyze -v;r;kv;lmnt;.logclose;q" -z "%ChosenFile%"
- START " " /WAIT dxdiag /dontskip /whql:on /t dxdiag.txt
- COPY /Y "%ChosenFile%.txt" + "%DUMPDIR%\dxdiag.txt" "%ChosenFile%.txt" >nul 2>&1
- START " " notepad "%ChosenFile%.txt"
- POPD
- ECHO DONE! &PING localhost >nul 2>&1 &EXIT /B
- GOTO :eof
- :CHECK_OS
- :: This must run first
- :: Usage: CALL :CHECK_OS
- IF "%PROCESSOR_ARCHITECTURE%"=="x86" (
- SET "MACHINE="
- IF DEFINED PROCESSOR_ARCHITEW6432 SET "MACHINE=_x64"
- ) ELSE (
- SET "MACHINE=_x64"
- )
- SET "REGNODE="
- FOR %%I IN ("%PROGRAMFILES%") DO SET "PFVAR=%%~sI"
- FOR %%I IN ("%WINDIR%\SYSTEM32") DO SET "SSVAR=%%~sI"
- :: MS put ZERO thinking in naming x64 Program Files - brackets are deadly in batch files
- IF "%MACHINE%"=="_64" (
- FOR %%I IN ("%PROGRAMFILES(X86)%") DO SET "PFVAR=%%~sI"
- FOR %%I IN ("%WINDIR%\SysWOW64") DO SET "SSVAR=%%~sI"
- SET "REGNODE=Wow6432Node\"
- IF DEFINED PROCESSOR_ARCHITEW6432 FOR %%I IN ("%WINDIR%\Sysnative") DO SET "SSVAR=%%~sI"
- )
- SET _MYVER=%~n0 by a^v^ey^o^ v1.0 &TITLE %_MYVER%
- rem FOR /F "tokens=4-5 delims=. " %%i IN ('ver') DO SET WINVERSION=%%i%%j
- rem IF %WINVERSION% LEQ 60 CALL :ERR ONLY FOR WINDOWS 7 OR ABOVE
- rem CALL :XECHO PROGRAMFILES=%PFVAR% SYSTEM=%SSVAR%
- GOTO :eof
- ::END.CHECK_OS
- :ERR
- :: Usage: Call :ERR string
- echo/
- echo #ERROR! %*
- PAUSE &EXIT
- GOTO :eof
- ::END.ERR
- :XECHO
- :: Extended echo
- :: Usage: Call :XECHO string/var
- :: Output: onscreen
- rem CLS
- echo/
- IF NOT "%1_"=="_" echo #INFO: %*
- IF DEFINED _TRACE echo/ & PAUSE
- GOTO :eof
- ::END.XECHO
- :VBCHOOSEFILE
- :: Show a vbs prompt to pick a file
- :: Usage: CALL :VBCHOOSEFILE
- :: Output: %SOURCEDIR% %SOURCEFILE%
- FINDSTR "'~1337v%skip%bc%skip%f" "%~f0">"%temp%\~1337cf.vbs"
- CSCRIPT //nologo "%temp%\~1337cf.vbs" >"%temp%\~1337cf.cmd"
- CALL "%temp%\~1337cf.cmd"
- CALL :__VBCHOOSEFILE_VERIFY
- GOTO :eof
- :__VBCHOOSEFILE_VERIFY
- :: file type filtering
- DEL /F /Q "%temp%\~1337cf.vbs" >NUL 2>&1
- DEL /F /Q "%temp%\~1337cf.cmd" >NUL 2>&1
- IF [%ChosenFile%]==[] CALL :ERR No file was chosen, please select a .dmp/.mdmp file next run
- IF /I NOT [%ChosenFile:~-3%]==[dmp] CALL :ERR Please select a .dmp/.mdmp file next run
- IF NOT EXIST "%ChosenFile%" CALL :ERR File cannot be accessed, try moving it to the current dir
- GOTO :eof
- ::END.VBCHOOSEFILE
- GOTO :eof
- Set wShell=CreateObject("WScript.Shell") '~1337vbcf
- Set oExec=wShell.Exec("mshta.exe ""about:<input type=file id=FILE><script>FILE.click();new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);close();resizeTo(0,0);</script>""") '~1337vbcf
- WScript.echo "set ChosenFile=" & oExec.StdOut.ReadLine '~1337vbcf
Add Comment
Please, Sign In to add comment