Advertisement
aveyo

DmpChk

Jun 21st, 2017
1,712
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 6.43 KB | None | 0 0
  1. goto="init" /* " DmpChk by AveYo v1.1b "                                                          
  2. ::  Ultra-fast, tiny .dmp .mdmp file checker - great to quickly preview game crash dumps without symbols that are slow with WinDBG
  3. ::  Simplifies usage after first run: right-click a dump file -> Send to -> DmpChk -> result saved to file and opened with notepad
  4. :"init"  
  5. @echo off &setlocal &mode 80,8 &color 70 &title DmpChk by AveYo v1.1b  
  6. if not exist "%APPDATA%\AveYo\DmpChk.dll" call :install &if not exist "%APPDATA%\Microsoft\Windows\SendTo\%~nx0" call :install
  7. if exist "%~1" (if "%~x1"==".dmp" (set "dmp=%~1") else if "%~x1"==".mdmp" (set "dmp=%~1"))
  8. :: powershell openfiledialog snippet                                                             changes: ps dialog instead of mshta
  9. set "o=$directory='%USERPROFILE%\Desktop'; $filter='(*.dmp, *.mdmp)|*.dmp;*.mdmp';"
  10. set "f=[void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms"); $ofd=New-Object System.Windows.Forms"  
  11. set "d=.OpenFileDialog; $ofd.filter=$filter; $ofd.initialDirectory=$directory; [void]$ofd.ShowDialog(); $ofd.filename"
  12. set "ps_openfiledialog=%o:"=\"%%f:"=\"%%d:"=\"%"
  13. if not defined dmp for /f %%a in ('powershell -c "%ps_openfiledialog%"') do set "dmp=%%a"                                                                                                                                                                                                                              
  14. if not exist "%dmp%" goto :eof
  15. :: load dump file                                                                            changes: notepad fixed size font toggle
  16. if /i "%processor_architecture%%processor_architew6432%"=="x86" (set "W=") else set "W=%%windir%%\SysWoW64\"
  17. call "%W%cmd.exe" /c rundll32.exe "%APPDATA%\AveYo\DmpChk.dll",GetFile %dmp%|more>"%dmp%.txt"
  18. call :reg_query HKCU\Software\Microsoft\Notepad lfFaceName notepadfont
  19. if exist "%dmp%.txt" ( reg add HKCU\Software\Microsoft\Notepad /v lfFaceName /t REG_SZ /d "FixedSys" /f 1>nul 2>nul
  20. start "" notepad "%dmp%.txt" & timeout /t 3 >nul 2>nul
  21. reg add HKCU\Software\Microsoft\Notepad /v lfFaceName /t REG_SZ /d "%notepadfont%" /f 1>nul 2>nul )
  22. endlocal & goto :eof
  23. :reg_query %1:KeyName %2:ValueName %3:OutputVariable
  24. setlocal &for /f "skip=2 delims=" %%s in ('reg query "%~1" /v "%~2" /z 2^>nul') do set "rq=%%s" &call set "rv=%%rq:*)    =%%"
  25. endlocal &call set "%~3=%rv%" & goto :eof
  26. :install
  27. set "res=DmpChk.dl_" &set "DmpChk=%APPDATA%\AveYo\DmpChk.dll" &md "%APPDATA%\AveYo\" >nul 2>nul &pushd "%APPDATA%\AveYo\"
  28. copy /y "%~f0" "%APPDATA%\AveYo\" >nul 2>nul &copy /y "%~f0" "%APPDATA%\Microsoft\Windows\SendTo\" >nul 2>nul
  29. if not exist "%DmpChk%" cscript.exe //nologo //e:JScript "%~f0" &expand -R "%res%" >nul 2>nul &del /f /q "%res%"
  30. if not exist "%DmpChk%" color cf &echo ERROR! DmpChk not installed &timeout /t 10 &color &endlocal &exit
  31. goto :eof
  32. :: batch binary resource attached with RES2BATCH v2.0b - compact, highlight friendly, optimized ascii encoder
  33. :res85_decoder */
  34. var fn="DmpChk.dl_", res="\
  35. ::O}bZg000008wdaZ00000EC2ui000000!5a50RR9100000M=si{0RRC201^NI00000006#D+xIDAL~U)GXlpKHY{!7+|`=^)2LKX7OYIk1P.f3vth9izCA*ABb#ITJS\
  36. ::PCvN3evLJ}75g.FeG3D?ooN;AkbQm2uTquid#l=[V]g.jP113rZbsLJg_bjGHuCBK8TZGnKX4gV$uV%N-V5z%.^SigPX^]*ncHap1ZrUNpK_jX?`v,opaCo|}h=~,8\
  37. ::PJMW1s~98bOi_ra*^]%`A)|LP6(20_c!}qIsHXxoGYThK5Y(L*bc{4Vngg_P-IC%4B4gGHMD;O!G3D_%qZc|YE|f7Bxm$tnklI795z.?i?Y{OgG`v{YYY^W?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V^d?v]HUxmJuzZo73t[Qb[niJ{)p]Eq45Fj~g76f2$q5fB9IE8M.`*PpfDdI2]n}q\
  54. ::ga+ba#lYg#-7+E$?oUcpH=Ne7^d-~yFBLBp7qSlAfA]LZ6mPbB4Mc(ye.`^_a]YTz8kJ![Nh[_-PYyZf8+n4Ujb%5=99WOin[hbRSX8=v(u*6}StKY8vpt%9P.x{.`\
  55. ::xK3^l=T+68D3!0,xfFMpJI]kro.I~OPIG6tbKFJl5%g;K[G,c{aCtQaH6]CVA5=XX4)k;C$`TJ\
  56. ".replace(/[\\:\s]/gm,""); r85='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz?.,;-_+=|{}[]()*^%$#!`~'.split('');
  57. d85={}; for(var i=85;i--;) d85[r85[i]]=i; p85=[]; for(var i=5;i--;) p85[i]=Math.pow(85,i);
  58. z='00000000'; pad=(res.length%5)||5; res+='~~~~~'.slice(pad); pad=10-2*pad; a=res.match(/.{1,5}/g);
  59. for(var l=a.length;l--;){n=0;for(j=5;j--;)n+=d85[a[l].charAt(j)]*p85[4-j];a[l]=z.slice(n.toString(16).length)+n.toString(16)};
  60. res85dec=(pad>0)?a.join('').slice(0,-pad):a.join('');WScript.echo(' RES2BATCH: extracting '+fn);
  61. xe=new ActiveXObject('Microsoft.XMLDOM').createElement('bh');as=new ActiveXObject('ADODB.Stream');as.Mode=3;as.Type=1;as.Open();
  62. xe.dataType='bin.hex';xe.text=res85dec;as.Write(xe.nodeTypedValue);as.SaveToFile(fn,2);as.Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement