For example, how to use dumpbin.exeto check the information embedded by the compiler, dumpbin.exe Compiler

Source: Internet
Author: User

For example, how to use dumpbin.exeto check the information embedded by the compiler, dumpbin.exe Compiler

  • Enable CMD
  • Run the following command in the dumpbin Directory: D: \ Program Files (x86) \ Microsoft Visual Studio 12.0 \ VC \ bin.
  • Run the command VCVARS32.BAT to configure the environment

    If you do not run vcvars32.bat, the following prompt is displayed:

  • Run the dumpbin command

    D: \ Program Files (x86) \ Microsoft Visual Studio 12.0 \ VC \ bin> dumpbin/exports E :\

    DSTCode \ Web \ DSTWeb \ bin \ DSTWeb. dll

    Microsoft (R) COFF/PE Dumper Version 12.00.21005.1

    Copyright (C) Microsoft Corporation. All rights reserved.

    Dump of file E: \ DSTCode \ Web \ DSTWeb \ bin \ DSTWeb. dll

    File Type: DLL

    Summary

    2000. reloc

    2000. rsrc

    1A0000. text

    D: \ Program Files (x86) \ Microsoft Visual Studio 12.0 \ VC \ bin>

  • Dumpbin command syntax and Option:

    Dumpbin [options] files...

#

Option

Remark

1

/ALL

This option displays all available information except code disassembly. Use/DISASM to display disassembly. You can use/RAWDATA: NONE together with/ALL to omit the original binary details of the file.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

2

/ARCHIVEMEMBERS

This option displays the minimum information about database Member objects.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

3

/CLRHEADER file

Image files generated by/clr.

Remarks

CLRHEADER displays information about. NET headers used in any hosting program. The output shows the. NET header and the position and size of each section (in bytes ).

File Format Spec.doc describes the information in the. NET header. Install File Format Spec.doc in the Tools Developers Guide directory.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

4

/DIRECTIVES

This option dumps the. ctictive section generated by the compiler in the image.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

5

/DEPENDENTS

The name of the DLL from which the dump image is imported. Do not dump the imported function name.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

6

/DISASM

This option displays the disassembly of the code segment. If it appears in a file, it uses a symbol.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

7

/EXPORTS

This option displays all definitions exported from an executable file or DLL.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

8

/FPO

This option displays frame Pointer Optimization (FPO) records.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

9

/HEADERS

This option displays the file header and the header of each section. The header of each member object is displayed when used in the database.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

10

/IMPORTS [: file]

This option displays the DLL list imported to an executable file or DLL (static link and delayed loading) and the various imports of each of the above DLL.

The optional file Specification allows you to specify to display only the import of a DLL.

For example:

Dumpbin/IMPORTS: msvcrt. dll

The output displayed by this option is similar to the/EXPORTS output.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

11

/LINENUMBERS

This option displays the COFF row number. If the object file is compiled in a program database (/Zi), C7 compatible (/Z7), or only by row number (/Zd), it contains the row number. If the executable file or DLL is linked to the generated debugging information (/DEBUG), it contains the COFF line number.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

12

/LINKERMEMBER [: {1 | 2}]

This option displays the public symbols defined in the library. Specify parameter 1 to display the symbols and Their offsets in object order. Specify parameter 2 to display the object offset and index number, and then list these symbols and the object index of each symbol in alphabetical order. To obtain both outputs, specify/LINKERMEMBER without the numeric parameter.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

13

/LOADCONFIG

This option dumps the IMAGE_LOAD_CONFIG_DIRECTORY structure, which is an optional structure that is used by the Windows NT loader and defined in WINNT. H.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

14

/OUT: filename

This option specifies the output filename. By default, DUMPBIN displays the information to the standard output.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

15

/PDBPATH [: VERBOSE] filename

Filename: Find the. dll or. exe file name that matches the. pdb file.

The VERBOSE (optional) report attempts to locate all directories in the. pdb file.

/PDBPATH searches for computers in the same path as the. pdb file searched by the debugger, and reports which. pdb files (if any) correspond to the Files specified in filename.

You may encounter problems when using the Visual Studio debugger because the debugger uses the. pdb file for different versions of the debug file.

/PDBPATH searches for the. pdb file in the following path: Check the location where the executable file resides.

Check the location of the PDB written to the executable file. This is usually the position when the image is linked.

Check the search path configured in Visual Studio IDE.

Check the path in the environment variables _ NT_SYMBOL_PATH and _ NT_ALT_SYMBOL_PATH.

Check in the Windows directory.

/PDATA is only used for the RISC processor.

This option dumps an exception table (. pdata) from an image or object ).

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

16

/RAWDATA [: {1 | 2 | 4 | 8 | NONE [, number]

This option displays the original content of each section in the file. The parameter control display format is as follows:

Parameter results

1 default value. The content is displayed in hexadecimal bytes. If the content has a printed representation, it is also displayed as ASCII characters.

2 The content is displayed as a hexadecimal 2-byte value.

The 4 content is displayed as a hexadecimal 4-byte value.

The 8-byte value is displayed as the hexadecimal value.

NONE. This parameter is useful for controlling/ALL output.

The row displayed by Number is set to the width of each row with a number value.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

17

/RELOCATIONS

This option displays any relocation of an object or image.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

18

/SECTION: section

This option limits the output of information related to the specified section.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

19

/SUMMARY

This option displays the minimum information (including the total size) with joints ). If no other options are specified, this option is the default value.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

20

/SYMBOLS

This option displays the COFF symbol table. Symbol tables exist in all object files. For an image file, it only contains the COFF symbol table when it is linked to/DEBUG.

The following is a description of/SYMBOLS output. You can find additional information about the/SYMBOLS output meaning by reading winnt. h (IMAGE_SYMBOL and IMAGE_AUX_SYMBOL) or COFF documents.

Assume that the following sample dump is available:

Dump of file main. obj

File Type: COFF OBJECT

COFF SYMBOL TABLE

000 00000000 DEBUG notype Filename |. file

Main. cpp

002 000B1FDB ABS notype Static | @ comp. id

003 00000000 SECT1 notype Static |. drectve

Section length 26, # relocs 0, # linenums 0, checksum 722C964F

005 00000000 SECT2 notype Static |. text

Section length 23, # relocs 1, # linenums 0, checksum 459FF65F, selection 1 (pick no duplicates)

007 00000000 SECT2 notype () External | _ main

008 00000000 UNDEF notype () External |? MyDump @ YAXXZ (void _ cdecl MyDump (void ))

String Table Size = 0x10 bytes

Summary

26. drectve

23. text

For rows starting with a symbolic number, the following describes the columns containing user-related information:

The three digits at the beginning are symbol indexes/numbers.

If the third column contains SECTx, the symbol is defined in the section of the object file. However, if UNDEF appears, it is not defined in that object and must be parsed elsewhere.

The Fifth Column (Static, External) indicates whether the symbol is only visible inside the object, or whether it is public (externally visible ). The static symbol _ sym is not linked to the public symbol _ sym. These symbols are two different instances of the function named _ sym.

The last column in the number row is the symbol name (modifier name and unmodifyed name ).

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

21

/UNWINDINFO

Dump the expansion descriptor of the structured exception processing (SEH) table in the program image (such as exe and dll. /UNWINDINFO is only applicable to IA64 images.

Only the/headers dumpbin option can be used for files generated by the/GL compiler option.

 


How to view the compiled assembly language of C program?

Ms vc ++ with DUMPBIN. EXE can try to see if you can meet your needs.

Usage: DUMPBIN [Option] [file]

Option:

/ALL
/ARCHIVEMEMBERS
/DIRECTIVES
/DISASM
/EXPORTS
/FPO
/HEADERS
/IMPORTS
/LINENUMBERS
/LINKERMEMBER [: {1 | 2}]
/OUT: filename
/PDATA
/RAWDATA [: {NONE | BYTES | SHORTS | LONGS} [, #]
/RELOCATIONS
/SECTION: name
/SUMMARY
/SYMBOLS

Example: DUMPBIN/DISASM abc.exe

Which of the following classes is a special class for Automatically Generating objects by the compiler and is used for class operations?

Microsoft. NET Framework is an internal Windows component that supports generating and running next-generation applications and XML Web Services .. NET Framework is designed to achieve the following goals: provide a consistent object-oriented programming environment, whether the object code is stored and executed locally or locally but distributed on the Internet, or remote execution.
Provides a code execution environment that minimizes software deployment and version control conflicts.
Provides a code execution environment that improves code execution security (including Code created by unknown or not fully trusted third parties.
Provides a code execution environment that can eliminate the script environment or explain the performance problems of the environment.
Ensure that the experience of developers is consistent with that of applications of different types (such as Windows-based and Web-based applications.
Generate all communications according to industrial standards to ensure that code based on. NET Framework can be integrated with any other code.
Microsoft. NET Framework has two main components: the public Language Runtime Library and the. NET Framework class library. The public Language Runtime Library is the basis of the. NET Framework. You can regard the Runtime Library as a proxy for managing code during execution. It provides core services such as memory management, thread management, and remote processing, strict type security and other forms of code accuracy that can improve security and reliability are also enforced. In fact, the concept of code management is the basic principle of the Runtime Library. Code with the Runtime Library as the target is called managed code, and code with the Runtime Library as the target is called unmanaged code .. Another major component of the. NET Framework is the class library, which is a comprehensive collection of reusable object-oriented types. You can use it to develop a variety of applications, these applications include traditional command line or graphical user interface (GUI) applications, and also include ASP-based. NET provides the latest innovative applications (such as Web forms and XML Web Services ).
Microsoft. the. NET Framework can be carried by unmanaged components that Load Common Language Runtime libraries to their processes and start the execution of managed code, in this way, you can create a software environment that can take advantage of both managed and unmanaged functions .. NET Framework not only provides several runtime database hosts, but also supports the development of third-party runtime database hosts.
For example, ASP. NET hosts the runtime to provide a Scalable Server Environment for hosted code. ASP. NET directly uses the Runtime Library to enable ASP. NET applications and XML Web Services (this topic will discuss the two later ).
Internet Explorer is an example of an unmanaged application that hosts the Runtime Library (in the form of MIME-type extensions. Using Internet Explorer to host the runtime allows you to embed a management component or a Windows Form Control in HTML documents. In this way, the runtime enables Mobile Code hosting (similar to Microsoft? ActiveX? Control) is possible, but it requires significant improvements (such as not fully trusted execution and independent file storage), which can only be provided by managed code.
The following illustration shows the relationship between the Common Language Runtime Library and the class library and the application and the entire system. The illustration also shows how managed code runs in a larger structure.
Microsoft. NET Framework environment:
The following sections describe the main components and functions of Microsoft. NET Framework in more detail.
Functions of the Common Language Runtime Library. Common Language Runtime libraries manage memory, thread execution, code execution, code security verification, compilation, and other system services. These functions are inherent in the managed code that runs on the common language runtime. As for security, depending on factors such as the source of managed components (such as the Internet, enterprise network, or local computer), managed components are granted .... The full text is available>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.