Leaked source code of windows server 2003
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.

43 lines
1.1 KiB

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