Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
989 B

  1. echo off
  2. if NOT "%_echo%" == "" echo on
  3. if "%1" == "" goto Usage
  4. if "%2" == "" goto Usage
  5. setlocal
  6. set PdbToClean=%1
  7. set SymbolsToRemove=%2
  8. set __tmp1=%temp%\RSS_%RANDOM%
  9. set __tmp2=%temp%\RSS_%RANDOM%
  10. set __tmp3=%temp%\RSS_%RANDOM%
  11. del %__tmp1% >nul 2>&1
  12. del %__tmp2% >nul 2>&1
  13. del %__tmp3% >nul 2>&1
  14. REM Dump all the publics
  15. %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\cvdump.exe -p %PdbToClean% > %__tmp1%
  16. REM Filter out the ones we really want
  17. for /f %%i in (%SymbolsToRemove%) do @findstr %%i %__tmp1% >> %__tmp2%
  18. REM Put them in a palatable format
  19. for /f "tokens=5" %%i in (%__tmp2%) do @echo %%i>>%__tmp3%
  20. REM Remove them from the pdb.
  21. %RazzleToolPath%\%PROCESSOR_ARCHITECTURE%\removesym.exe -d:%RazzleToolPath%\%PROCESSOR_ARCHITECTURE% -p:%PdbToClean% -f:%__tmp3%
  22. REM Finally cleanup
  23. del %__tmp1% >nul 2>&1
  24. del %__tmp2% >nul 2>&1
  25. del %__tmp3% >nul 2>&1
  26. endlocal
  27. goto :eof
  28. :Usage
  29. echo RemoveSecretSymbols <PdbToRemoveFrom (public version)> <File containing symbol names>