# [DllExport](https://github.com/3F/DllExport)
*.NET DllExport*
```
Copyright (c) 2009-2015 Robert Giesecke
Copyright (c) 2016-2018 Denis Kuzmin <entry.reg@gmail.com> :: github.com/3F
```
[![Build status](https://ci.appveyor.com/api/projects/status/yh1pnuhaqk8h334h/branch/master?svg=true)](https://ci.appveyor.com/project/3Fs/dllexport/branch/master)
[![Latest-Release](https://img.shields.io/github/release/3F/DllExport.svg)](https://github.com/3F/DllExport/releases/latest)
[![License](https://img.shields.io/badge/License-MIT-74A5C2.svg)](https://github.com/3F/DllExport/blob/master/LICENSE)
[![NuGet package](https://img.shields.io/nuget/v/DllExport.svg)](https://www.nuget.org/packages/DllExport/)
[![coreclr_ILAsm](https://img.shields.io/badge/coreclr_ILAsm-v4.5.1-C8597A.svg)](https://www.nuget.org/packages/ILAsm/)
[![GetNuTool core](https://img.shields.io/badge/GetNuTool-v1.6.2-93C10B.svg)](https://github.com/3F/GetNuTool)
[![MvsSln](https://img.shields.io/badge/MvsSln-v2.1.0-865FC5.svg)](https://github.com/3F/MvsSln)
[![Conari](https://img.shields.io/badge/Conari-v1.3.0-8AA875.svg)](https://github.com/3F/Conari)
[`DllExport`](https://3f.github.io/DllExport/releases/latest/manager/)` -action Configure` [[?](#how-to-get-dllexport)]
> 1:[ ***[Quick start](https://www.youtube.com/watch?v=sBWt-KdQtoc)*** ] 2:[ [Basic examples for C++ and C#](https://www.youtube.com/watch?v=9Hyg3_WE9Ks) ] 3:[ [Complex types and Strings](https://www.youtube.com/watch?v=QXMj9-8XJnY) ]
> -> { **[Wiki](https://github.com/3F/DllExport/wiki)** }
`~~~---~~~`
```csharp
[DllExport("Init", CallingConvention.Cdecl)]
public static int entrypoint(IntPtr l)
{
// ... it will be called from Lua script
lua_pushcclosure(l, onProc, 0);
lua_setglobal(l, "onKeyDown");
return 0;
}
```
* **For work with Unmanaged code/libraries (binding between .NET and unmanaged native C/C++ etc.), see [Conari](https://github.com/3F/Conari)**
* If you need convenient work with Lua (5.1, 5.2, 5.3, ...), see [LunaRoad](https://github.com/3F/LunaRoad)
```csharp
[DllExport("Init", CallingConvention.Cdecl)]
// __cdecl is the default calling convention for our library as and for C and C++ programs
[DllExport(CallingConvention.StdCall)]
[DllExport("MyFunc")]
[DllExport]
```
Support of Modules: Library (**.dll**) and Executable (**.exe**) [[?](https://github.com/3F/DllExport/issues/18)]
Where to look ? v1.2+ provides dynamic definitions of namespaces (ddNS feature), thus you can use what you need - details **[here](https://github.com/3F/DllExport/issues/2)**
```cpp
Via Cecil or direct modification:
000005B0 00 C4 7B 01 00 00 00 2F 00 12 05 .Д{..../...
000005C0 00 00 02 00 00 00 00 00 00 00 00 00 00 00 26 00 ..............&.
000005D0 20 02 00 00 00 00 00 00 00 49 2E 77 61 6E 74 2E ........I.want. <<<-
000005E0 74 6F 2E 66 6C 79 00 00 00 00 00 00 00 00 00 00 to.fly.......... <<<-
```
[![](https://raw.githubusercontent.com/3F/DllExport/master/Resources/img/DllExport.png)](#)
[![](https://raw.githubusercontent.com/3F/DllExport/master/Resources/img/DllExport_ordinals.png)](https://github.com/3F/DllExport/issues/11#issuecomment-250907940)
Our Wizard and embeddable manager:
[![DllExport.bat](https://raw.githubusercontent.com/3F/DllExport/master/Resources/img/DllExport_manager.png)](https://3f.github.io/DllExport/releases/latest/manager/)
[![youtube.com/watch?v=sBWt-KdQtoc](https://raw.githubusercontent.com/3F/DllExport/master/Resources/img/DllExport_Wizard_overview_youtube.jpg)](https://www.youtube.com/watch?v=sBWt-KdQtoc)
[![PeViewer](https://raw.githubusercontent.com/3F/DllExport/master/Resources/img/DllExport_PeViewer.png)](https://github.com/3F/DllExport/issues/55)
----
[Initially](https://github.com/3F/DllExport/issues/3) the original tool `UnmanagedExports` was distributed by Robert Giesecke as an closed-source tool **under the [MIT License](https://opensource.org/licenses/mit-license.php)**:
* [Official page](https://sites.google.com/site/robertgiesecke/Home/uploads/unmanagedexports) - *posted Jul 9, 2009 [ updated Dec 19, 2012 ]*
* [Official NuGet Packages](https://www.nuget.org/packages/UnmanagedExports)
Now, we will be more open ! all details [here](https://github.com/3F/DllExport/issues/3)
## License
The [MIT License (MIT)](https://github.com/3F/DllExport/blob/master/LICENSE)
## &_
### How does it work
Current features has been implemented through [ILDasm](https://github.com/3F/coreclr/tree/master/src/ildasm) & [ILAsm](https://github.com/3F/coreclr/tree/master/src/ilasm) that makes the all required steps via `.export` directive ([it's specific directive for ILAsm compiler only](https://github.com/3F/DllExport/issues/45#issuecomment-317802099)).
**What inside ? or how does work the .export directive ?**
Read about format PE32/PE32+, start with grammar from asmparse and move to writer:
```cpp
...
//yacc
if(PASM->m_pCurMethod->m_dwExportOrdinal == 0xFFFFFFFF)
{
PASM->m_pCurMethod->m_dwExportOrdinal = $3;
PASM->m_pCurMethod->m_szExportAlias = $6;
if(PASM->m_pCurMethod->m_wVTEntry == 0) PASM->m_pCurMethod->m_wVTEntry = 1;
if(PASM->m_pCurMethod->m_wVTSlot == 0) PASM->m_pCurMethod->m_wVTSlot = $3 + 0x8000;
}
...
EATEntry* pEATE = new EATEntry;
pEATE->dwOrdinal = pMD->m_dwExportOrdinal;
pEATE->szAlias = pMD->m_szExportAlias ? pMD->m_szExportAlias : pMD->m_szName;
pEATE->dwStubRVA = EmitExportStub(pGlobalLabel->m_GlobalOffset+dwDelta);
m_EATList.PUSH(pEATE);
...
// logic of definition of records into EXPORT_DIRECTORY (see details from PE format)
HRESULT Assembler::CreateExportDirectory()
{
...
IMAGE_EXPORT_DIRECTORY exportDirIDD;
DWORD exportDirDataSize;
BYTE *exportDirData;
EATEntry *pEATE;
unsigned i, L, ordBase = 0xFFFFFFFF, Ldllname;
...
~ now we're ready to miracles ~
```
Read also my explanations from here: [about mscoree](https://github.com/3F/DllExport/issues/45#issuecomment-317802099); [DllMain & the export-table](https://github.com/3F/DllExport/issues/5#issuecomment-240697109); [DllExport.dll](https://github.com/3F/DllExport/issues/28#issuecomment-281957212); [.exp & .lib](https://github.com/3F/DllExport/issues/9#issuecomment-246189220); [ordinals](https://github.com/3F/DllExport/issues/8#issuecomment-245228065) ...
### How to get DllExport
**v1.6+** have no official support of any standard NuGet clients. [[?](https://github.com/3F/DllExport/wiki/DllExport-Manager-Q-A)]
* [New Wizard and embeddable manager](https://www.youtube.com/watch?v=sBWt-KdQtoc)
* Wiki. [Quick start](https://github.com/3F/DllExport/wiki/Quick-start)
Get [DllExport.bat](https://3F.github.io/DllExport/releases/latest/manager/) from any place. For example, you can still get it from packages via NuGet server ([how to](https://youtu.be/okPThdWDZMM?t=1m1s)) or it also can be embedded inside any other your scripts/project files/etc.
*DllExport.bat was based on [GetNuTool core](https://github.com/3F/GetNuTool) that's Cross-Platform Embeddable Package Manager that requires only MSBuild. Finally it just aggregates calling to Wizard that was based on [MvsSln](https://github.com/3F/MvsSln). [[?](https://github.com/3F/DllExport/wiki/DllExport-Manager-Q-A#is-this-cross-platform-solution-)]*
**Please note**: You do not need to call manually DllExport.bat after initial configuration. It will be **automatically** restored by any Build operation for your configured projects.
* To install/uninstall or to reconfigure your projects:
```
DllExport -action Configure
```
[Please read the documentation.](https://github.com/3F/DllExport/wiki/DllExport-Manager)
Other variants:
* `gnt /p:ngpackages="DllExport"` [[?](https://github.com/3F/GetNuTool)]
* [GetNuTool](https://github.com/3F/
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
核心部分由 Visual Basic 语言编写的 QQ机器人 插件SDK (326个子文件)
Fody.targets~origin_master-4.5 4KB
Fody.targets~origin_master-4.5 4KB
Fody.targets~master-4.5 4KB
Fody.targets~master-4.5 4KB
DllExport.bat 20KB
DllExport.bat 20KB
hMSBuild.bat 18KB
hMSBuild.bat 18KB
gnt.bat 11KB
DllExport_Configure.bat 30B
SQLiteCommand.bmp 246B
SQLiteDataAdapter.bmp 246B
SQLiteConnection.bmp 246B
System.Data.SQLite.dll.config 12KB
packages.config 431B
SQLiteModule.cs 298KB
SQLiteConnection.cs 273KB
UnsafeNativeMethods.cs 195KB
SQLiteSession.cs 188KB
SQLite3.cs 133KB
SQLiteConvert.cs 102KB
ISQLiteNativeModule.cs 78KB
SQLiteDataReader.cs 75KB
SQLiteFunction.cs 67KB
SQLiteBase.cs 66KB
SQLiteModuleEnumerable.cs 42KB
SQLiteConnectionPool.cs 37KB
SQLiteCommand.cs 36KB
HttpWebClient.cs 36KB
SQLiteException.cs 28KB
IniValue.cs 27KB
SQLiteModuleNoop.cs 27KB
CqApi.cs 26KB
SQLiteConnectionStringBuilder.cs 25KB
SQLiteKeyReader.cs 25KB
SQLiteLog.cs 22KB
SQLiteStatement.cs 18KB
SQLiteParameter.cs 16KB
SQLiteParameterCollection.cs 14KB
SQLiteBlob.cs 14KB
SQLite3_UTF16.cs 13KB
SQLiteCommandBuilder.cs 12KB
SQLiteDataAdapter.cs 12KB
IniSection.cs 11KB
IniObject.cs 10KB
SQLiteModuleCommon.cs 10KB
SQLiteTransaction2.cs 9KB
SQLiteEnlistment.cs 9KB
SQLiteTransactionBase.cs 7KB
BinaryReaderExpand.cs 7KB
SR.Designer.cs 6KB
CQP.cs 6KB
SQLiteTransaction.cs 6KB
SQLiteFactory.cs 5KB
SQLiteBackup.cs 5KB
SQLiteFunctionAttribute.cs 4KB
SQLiteFactory_Linq.cs 4KB
SQLiteDefineConstants.cs 4KB
BinaryWriterExpand.cs 3KB
OtherExpand.cs 2KB
NativeConvert.cs 2KB
CqMsg.cs 2KB
Face.cs 2KB
GroupMember.cs 2KB
SQLiteMetaDataCollectionNames.cs 2KB
HttpTool.cs 1KB
AssemblySourceTimeStampAttribute.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblySourceIdAttribute.cs 1KB
CqCodeType.cs 1KB
CqCode.cs 833B
AudioOutFormat.cs 777B
LogerLevel.cs 734B
SQLiteConnection_Linq.cs 616B
FloatWindowColors.cs 582B
SQLitePatchLevel.cs 546B
QQ.cs 545B
GroupFile.cs 530B
FloatWindow.cs 499B
GroupAnonymous.cs 469B
Sex.cs 391B
PermitType.cs 387B
Group.cs 368B
RequestType.cs 361B
MessageHanding.cs 358B
ResponseType.cs 336B
Native.Csharp.Tool.csproj 6KB
Native.Csharp.Sdk.csproj 3KB
DllExport.dll.ddNSi 220B
DllExport.dll.ddNSi 219B
coreclr.dll 3.56MB
mscordaccore.dll 1.22MB
mscordbi.dll 990KB
Microsoft.Build.dll 439KB
Conari.dll 361KB
System.Management.Automation.dll 352KB
Mono.Cecil.dll 328KB
Mono.Cecil.dll 263KB
Unity.Interception.dll 121KB
共 326 条
- 1
- 2
- 3
- 4
资源评论
电网论文源程序
- 粉丝: 1w+
- 资源: 265
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功