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

echo off
@if NOT defined HOST_PROCESSOR_ARCHITECTURE set HOST_PROCESSOR_ARCHITECTURE=%PROCESSOR_ARCHITECTURE%
if NOT "%_echo%" == "" echo on
if "%1" == "" goto Usage
if "%2" == "" goto Usage
setlocal
set PdbToClean=%1
set SymbolsToRemove=%2
set __tmp1=%temp%\RSS_%RANDOM%
set __tmp2=%temp%\RSS_%RANDOM%
set __tmp3=%temp%\RSS_%RANDOM%
del %__tmp1% >nul 2>&1
del %__tmp2% >nul 2>&1
del %__tmp3% >nul 2>&1
REM Dump all the publics
%RazzleToolPath%\%HOST_PROCESSOR_ARCHITECTURE%\cvdump.exe -p %PdbToClean% > %__tmp1%
REM Filter out the ones we really want
for /f %%i in (%SymbolsToRemove%) do @findstr %%i %__tmp1% >> %__tmp2%
REM Put them in a palatable format
for /f "tokens=5" %%i in (%__tmp2%) do @echo %%i>>%__tmp3%
REM Remove them from the pdb.
%RazzleToolPath%\%HOST_PROCESSOR_ARCHITECTURE%\removesym.exe -d:%RazzleToolPath%\%HOST_PROCESSOR_ARCHITECTURE% -p:%PdbToClean% -f:%__tmp3%
REM Finally cleanup
del %__tmp1% >nul 2>&1
del %__tmp2% >nul 2>&1
del %__tmp3% >nul 2>&1
endlocal
goto :eof
:Usage
echo RemoveSecretSymbols <PdbToRemoveFrom (public version)> <File containing symbol names>