我想使用 binplace.exe 从符号文件中删除私有符号,我将以下命令保存到批处理文件 'parse.bat':binplace -a -x -s %_NTTREE%\stripped -n %_NTTREE%\full my-executable-file-name
中。
问题是:当我执行parse.bat
from 命令行时,binplace
可以正确生成剥离符号文件,但如果我parse.bat
通过双击它执行,binplace
则无法生成剥离符号文件,这是 binplace 使用-v
选项的输出消息:
execute by double-click:
BINPLACE : warning GNA0293: Not a response file (-s)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\stripped)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\stripped)
BINPLACE : warning GNA0293: Not a response file (-n)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\full)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\full)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\SystemTool.exe)
BINPLACE : warning BNP0000: Looking at file SystemTool.exe
BINPLACE : warning BNP0000: Class bin Not found in Class Tables
BINPLACE : warning BNP0000: place f:\SymbolServer\SystemTool.exe in f:\SymbolServer\bin\SystemTool.exe
binplace f:\SymbolServer\SystemTool.exe
BINPLACE : warning BNP0000: copy f:\SymbolServer\SystemTool.exe to f:\SymbolServer\bin\SystemTool.exe
BINPLACE : warning BNP0000: No symbols to strip from f:\SymbolServer\bin\SystemTool.exe
BINPLACE : warning BNP1536: Public symbols being copied to f:\SymbolServer\stripped\bin\exe\.
BINPLACE : warning BNP0000: place f:\SymbolServer\SystemTool.pdb in f:\SymbolServer\stripped\bin\exe\SystemTool.pdb
BINPLACE : warning BNP2700: Unable to copy (f:\SymbolServer\SystemTool.pdb,f:\SymbolServer\stripped\bin\exe\SystemTool.pdb) 126
BINPLACE : warning BNP0000: place f:\SymbolServer\SystemTool.pdb in f:\SymbolServer\full\bin\exe\SystemTool.pdb
BINPLACE : warning GNA0127: Command line finished
Press any key to continue . . .
execute from command-line:
F:\SymbolServer>parse.bat
BINPLACE : warning GNA0293: Not a response file (-s)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\stripped)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\stripped)
BINPLACE : warning GNA0293: Not a response file (-n)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\full)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer\full)
BINPLACE : warning GNA0293: Not a response file (f:\SymbolServer SystemTool.exe)
BINPLACE : warning BNP0000: Looking at file SystemTool.exe
BINPLACE : warning BNP0000: Class bin Not found in Class Tables
BINPLACE : warning BNP0000: place f:\SymbolServer\SystemTool.exe in f:\SymbolServer\bin\SystemTool.exe
binplace f:\SymbolServer\SystemTool.exe
BINPLACE : warning BNP0000: copy f:\SymbolServer\SystemTool.exe to f:\SymbolServer\bin\SystemTool.exe
BINPLACE : warning BNP0000: Symbols stripped from f:\SymbolServer\bin\SystemTool.exe into f:\SymbolServer\stripped\bin\exe\SystemTool.dbg
BINPLACE : warning BNP0000: place f:\SymbolServer\SystemTool.pdb in f:\SymbolServer\full\bin\exe\SystemTool.pdb
BINPLACE : warning GNA0127: Command line finished
Press any key to continue . . .
使用symchk
,我确认SystemTool.exe
只有私有符号,输出消息如下:
F:\SymbolServer>symchk /v SystemTool.exe /s .
[SYMCHK] Searching for symbols to F:\SymbolServer\SystemTool.exe in path .
DBGHELP: Symbol Search Path: .
[SYMCHK] Using search path "."
DBGHELP: No header for F:\SymbolServer\SystemTool.exe. Searching for image on d
isk
DBGHELP: F:\SymbolServer\SystemTool.exe - OK
DBGHELP: SystemTool - private symbols & lines
.\SystemTool.pdb
[SYMCHK] MODULE64 Info ----------------------
[SYMCHK] Struct size: 1672 bytes
[SYMCHK] Base: 0x00400000
[SYMCHK] Image size: 10293248 bytes
[SYMCHK] Date: 0x52395664
[SYMCHK] Checksum: 0x009cd39e
[SYMCHK] NumSyms: 0
[SYMCHK] SymType: SymPDB
[SYMCHK] ModName: SystemTool
[SYMCHK] ImageName: F:\SymbolServer\SystemTool.exe
[SYMCHK] LoadedImage: F:\SymbolServer\SystemTool.exe
[SYMCHK] PDB: ".\SystemTool.pdb"
[SYMCHK] CV: RSDS
[SYMCHK] CV DWORD: 0x53445352
[SYMCHK] CV Data: D:\cwork\DriverLoader\Debug\SystemTool.pdb
[SYMCHK] PDB Sig: 0
[SYMCHK] PDB7 Sig: {444090A7-6BE8-4310-BD87-4ABCA3F8E8A9}
[SYMCHK] Age: 1
[SYMCHK] PDB Matched: TRUE
[SYMCHK] DBG Matched: TRUE
[SYMCHK] Line nubmers: TRUE
[SYMCHK] Global syms: TRUE
[SYMCHK] Type Info: TRUE
[SYMCHK] ------------------------------------
SymbolCheckVersion 0x00000002
Result 0x001f0001
DbgFilename
DbgTimeDateStamp 0x52395664
DbgSizeOfImage 0x009d1000
DbgChecksum 0x009cd39e
PdbFilename F:\SymbolServer\SystemTool.pdb
PdbSignature {444090A7-6BE8-4310-BD87-4ABCA3F8E8A9}
PdbDbiAge 0x00000001
[SYMCHK] [ 0x00000000 - 0x001f0001 ] Checked "F:\SymbolServer\SystemTool.exe"
SYMCHK: FAILED files = 0
SYMCHK: PASSED + IGNORED files = 1
谁能告诉我为什么以及如何解决它。