.dll과 .exe의 차이점은 무엇입니까?
dll과 exe 파일의 정확한 차이점을 알고 싶습니다.
EXE :
- 실행 파일입니다
- 실행 파일을로드 할 때 내보내기가 호출되지 않고 모듈 진입 점 만 호출됩니다.
- 시스템이 새 실행 파일을 시작하면 새 프로세스가 생성됩니다.
- 진입 스레드는 해당 프로세스의 기본 스레드 컨텍스트에서 호출됩니다.
DLL :
- 동적 링크 라이브러리입니다.
- 내 보낸 기호가 여러 개 있습니다.
- 시스템은 DLL을 기존 프로세스의 컨텍스트로로드합니다.
자세한 내용 : http://www.c-sharpcorner.com/Interviews/Answer/Answers.aspxQuestionId=1431&MajorCategoryId=1&MinorCategoryId=1 http://wiki.answers.com/Q/What_is_the_difference_between_an_EXE_and_a_DLL
참조 : http://www.dotnetspider.com/forum/34260-What-difference-between-dll-exe.aspx
나는 왜 모든 사람들이 .NET의 맥락에서이 질문에 대답하는지 모르겠습니다. 질문은 일반적인 질문이었고 어디에서도 .NET을 언급하지 않았습니다.
음, 주요 차이점은 다음과 같습니다.
EXE
- exe는 항상 자체 주소 공간에서 실행됩니다. 즉, 별도의 프로세스입니다.
- EXE의 목적은 자체적으로 별도의 응용 프로그램을 시작하는 것입니다.
DLL
- dll을 실행하려면 항상 호스트 exe가 필요합니다. 즉, 자체 주소 공간에서 실행될 수 없습니다.
- DLL의 목적은 다른 응용 프로그램에서 재사용 할 수있는 메서드 / 클래스 모음을 갖는 것입니다.
- DLL은 Microsoft의 공유 라이브러리 구현입니다.
DLL과 exe의 파일 형식은 본질적으로 동일합니다. Windows는 파일의 PE 헤더를 통해 DLL과 EXE의 차이점을 인식합니다. PE 헤더에 대한 자세한 내용은 MSDN의이 문서를 참조하십시오.
차이점은 EXE에는 실행시 실행되는 "주"메서드 인 진입 점이 있다는 것입니다.
DLL 내의 코드는 다른 응용 프로그램에서 호출해야합니다.
언급 할 수있는 구조와 관련하여 몇 가지 차이점이 더 있습니다.
- DLL과 EXE는 모두 동일한 파일 구조 (Portable Executable 또는 PE)를 공유합니다. 둘을 구별하기 위해 inside 의
Characteristics
멤버를 살펴볼 수 있습니다 . DLL의 경우 (0x2000) 플래그가 켜져 있습니다. EXE의 경우 (0x2) 플래그입니다.IMAGE_FILE_HEADER
IMAGE_NT_HEADERS
IMAGE_FILE_DLL
IMAGE_FILE_EXECUTABLE_IMAGE
- PE 파일은 일부 헤더와 여러 섹션으로 구성됩니다. 일반적으로 코드 섹션, 데이터 섹션, 가져온 함수를 나열하는 섹션 및 리소스 섹션이 있습니다. 일부 섹션에는 둘 이상의 항목이 포함될 수 있습니다. 헤더는 섹션에있는 데이터 디렉토리 목록도 설명합니다. 이러한 데이터 디렉터리는 Windows가 PE에서 필요한 것을 찾을 수 있도록합니다. 그러나 EXE가 절대 가질 수없는 데이터 디렉토리 유형 중 하나는 (frankenstein EXE를 빌드하지 않는 한) 내보내기 디렉토리입니다. DLL 파일에는 내보내는 기능 목록이 있으며 다른 EXE 또는 DLL 파일에서 사용할 수 있습니다. 반면에 각 DLL과 EXE에는 실행에 필요한 함수와 DLL 파일을 나열하는 가져 오기 디렉터리가 있습니다.
- 또한 PE 헤더 (
IMAGE_OPTIONAL_HEADER
)에는ImageBase
구성원이 있습니다. PE가로드 될 것으로 가정하는 가상 주소를 지정합니다. 다른 주소에서로드되면 일부 포인터가 잘못된 메모리를 가리킬 수 있습니다. EXE 파일은 새 주소 공간에 가장 먼저로드되기 때문에 Windows 로더는 일정한로드 주소를 보장 할 수 있으며 일반적으로 0x00400000입니다. DLL에는 그러한 사치가 존재하지 않습니다. 동일한 프로세스에로드 된 두 개의 DLL 파일은 동일한 주소를 요청할 수 있습니다. 이것이 DLL에 일반적으로 자체 섹션에 상주하는 Base Relocation Directory라는 다른 데이터 디렉토리가있는 이유.reloc
입니다. 이 디렉터리에는 올바른 메모리를 가리 키도록 다시 기반 / 패치해야하는 DLL의 위치 목록이 포함되어 있습니다. 대부분의 EXE 파일에는이 디렉토리가 없지만 일부 오래된 컴파일러에서 생성합니다.
이 주제 @ MSDN 에 대한 자세한 내용을 읽을 수 있습니다 .
이 대답은 내가 생각했던 것보다 조금 더 자세했지만 자세히 읽었습니다.
DLL :
대부분의 경우 DLL 파일은 라이브러리 입니다. 두 가지 유형의 라이브러리, 동적 및 정적- 차이점에 대해 읽습니다 . DLL은 프로그램 의 일부 이지만 전체가 아니라는 것을 알려주는 동적 링크 라이브러리 를 의미합니다 . 하나 이상의 프로그램에 사용할 수있는 재사용 가능한 소프트웨어 구성 요소 ( 라이브러리 ) 로 만들어졌습니다 . 복사-붙여 넣기를 사용하여 많은 애플리케이션에서 라이브러리 소스 코드를 항상 사용할 수 있지만 DLL / 정적 라이브러리의 개념은 라이브러리의 코드를 업데이트하는 동시에 모든 애플리케이션을 다음을 사용하여 업데이트 할 수 있다는 것입니다. 그것은-컴파일하지 않고.
For example:
Imagine you're creating a Windows GUI component like a Button. In most cases you'd want to re-use the code you've written because it's a complex but a common component - You want many applications to use it but you don't want to give them the source code You can't copy-paste the code for the button in every program, so you decide you want to create a DL-Library (DLL).
This "button" library is required by EXEcutables to run, and without it they will not run because they don't know how to create the button, only how to talk to it.
Likewise, a DLL cannot be executed - run, because it's only a part of the program but doesn't have the information required to create a "process".
EXE:
An executable is the program. It knows how to create a process and how to talk to the DLL. It needs the DLL to create a button, and without it the application doesn't run - ERROR.
hope this helps....
Both DLL and EXE are Portable Executable(PE) Formats
A Dynamic-link library (DLL) is a library and therefore can not be executed directly. If you try to run it you will get an error about a missing entry point. It needs an entry point (main function) to get executed, that entry point can be any application or exe. DLL binding occurs at run-time. That is why its called "Dynamic Link" library.
An Executable (EXE) is a program that can be executed. It has its own entry point. A flag inside the PE header indicates which type of file it is (irrelevant of file extension). The PE header has a field where the entry point for the program resides. In DLLs it isn't used (or at least not as an entry point).
There are many software available to check header information. The only difference causing both to work differently is the bit in header as shown in below diagram.
EXE file has only single main entry means it is isolated application, when a system launches exe, a new process is created while DLLs have many entry points so when application use it no new process started, DLL can be reused and versioned. DLL reduces storage space as different programs can use the same dll.
Dll v/s Exe
1)DLL file is a dynamic link library which can be used in exe files and other dll files.
EXE file is a executable file which runs in a separate process which is managed by OS.
2)DLLs are not directly executable . They are separate files containing functions that can be called by programs and other DLLs to perform computations and functions.
An EXE is a program that can be executed . Ex :Windows program
3)Reusability
DLL: They can be reused for some other application. As long as the coder knows the names and parameters of the functions and procedures in the DLL file .
EXE: Only for specific purpose .
4)A DLL would share the same process and memory space of the calling application while an
EXE creates its separate process and memory space.
5)Uses
DLL: You want many applications to use it but you don't want to give them the source code You can't copy-paste the code for the button in every program, so you decide you want to create a DL-Library (DLL).
EXE: When we work with project templates like Windows Forms Applications, Console Applications, WPF Applications and Windows Services they generate an exe assembly when compiled.
6)Similarities :
Both DLL and EXE are binary files have a complex nested structure defined by the Portable Executable format, and they are not intended to be editable by users.
Two things: the extension and the header flag stored in the file.
Both files are PE files. Both contain the exact same layout. A DLL is a library and therefore can not be executed. If you try to run it you'll get an error about a missing entry point. An EXE is a program that can be executed. It has an entry point. A flag inside the PE header indicates which file type it is (irrelevant of file extension). The PE header has a field where the entry point for the program resides. In DLLs it isn't used (or at least not as an entry point).
One minor difference is that in most cases DLLs have an export section where symbols are exported. EXEs should never have an export section since they aren't libraries but nothing prevents that from happening. The Win32 loader doesn't care either way.
Other than that they are identical. So, in summary, EXEs are executable programs while DLLs are libraries loaded into a process and contain some sort of useful functionality like security, database access or something.
An EXE is visible to the system as a regular Win32 executable. Its entry point refers to a small loader which initializes the .NET runtime and tells it to load and execute the assembly contained in the EXE. A DLL is visible to the system as a Win32 DLL but most likely without any entry points. The .NET runtime stores information about the contained assembly in its own header.
dll is a collection of reusable functions where as an .exe is an executable which may call these functions
The .exe is the program. The .dll is a library that a .exe (or another .dll) may call into.
What sakthivignesh says can be true in that one .exe can use another as if it were a library, and this is done (for example) with some COM components. In this case, the "slave" .exe is a separate program (strictly speaking, a separate process - perhaps running on a separate machine), but one that accepts and handles requests from other programs/components/whatever.
However, if you just pick a random .exe and .dll from a folder in your Program Files, odds are that COM isn't relevant - they are just a program and its dynamically-linked libraries.
Using Win32 APIs, a program can load and use a DLL using the LoadLibrary and GetProcAddress API functions, IIRC. There were similar functions in Win16.
COM is in many ways an evolution of the DLL idea, originally concieved as the basis for OLE2, whereas .NET is the descendant of COM. DLLs have been around since Windows 1, IIRC. They were originally a way of sharing binary code (particularly system APIs) between multiple running programs in order to minimise memory use.
● .exe and dll are the compiled version of c# code which are also called as assemblies.
● .exe is a stand alone executable file, which means it can executed directly.
● .dll is a reusable component which cannot be executed directly and it requires other programs to execute it.
An exe is an executible program whereas A DLL is a file that can be loaded and executed by programs dynamically.
Difference in DLL and EXE:
1) DLL is an In-Process Component which means running in the same memory space as the client process. EXE is an Out-Process Component which means it runs in its own separate memory space.
2) The DLL contains functions and procedures that other programs can use (promotes reuability) while EXE cannot be shared with other programs.
3) DLL cannot be directly executed as they're designed to be loaded and run by other programs. EXE is a program that is executed directly.
The major exact difference between DLL and EXE that DLL hasn't got an entry point and EXE does. If you are familiar with c++ you can see that build EXE has main() entry function and DLL doesn't :)
참고URL : https://stackoverflow.com/questions/1210873/difference-between-dll-and-exe
'developer tip' 카테고리의 다른 글
Rails에서 rake db : seed를 실행할 때 US-ASCII (Argument Error)의 잘못된 바이트 시퀀스 (0) | 2020.09.15 |
---|---|
스낵바의 배경색을 변경하는 방법은 무엇입니까? (0) | 2020.09.15 |
파일 내용 내에서 문자열 바꾸기 (0) | 2020.09.15 |
AJAX로 부트 스트랩 팝 오버 콘텐츠를로드합니다. (0) | 2020.09.15 |
Gulp 오류 : 감시 작업은 함수 여야합니다. (0) | 2020.09.15 |