From 4f14cecbcea75895a510954c2cd402ee0e9e3521 Mon Sep 17 00:00:00 2001 From: "Denis Kuzmin (reg)" Date: Fri, 27 Jan 2017 23:00:19 +0300 Subject: [PATCH] public release of the Conari engine - v1.3: NEW: Improved speed >80% (DLR) & >90% (Lambda) `*` results for regXwild x64 (Unicode) via snet tester - https://github.com/3F/regXwild NEW: Improved DLR. Automatic detection for ByRef types & null-values for any reference-types that pushed with out/ref modifier. * +UseCallingContext - To use information about types from CallingContext if it's possible. * +UseByRef - To use ByRef& (reference-types) for all sent types. NEW: Added `NullType` as optional way for work with reference-types. And for other purpose to store additional information about basic type for any null values. NEW: Added IProvider.NewProcAddress event - When handling new non-zero ProcAddress. NEW: Started support of Exported-Variables via IExVar & DLR - Issue #7 ``` l.ExVar.DLR.ADDR_SPEC; // 0x00001CE8 l.ExVar.get("ADDR_SPEC"); // 0x00001CE8 l.ExVar.getField(typeof(UInt32).NativeSize(), "ADDR_SPEC"); // Native.Core.Field via raw size l.Svc.native("lpProcName"); // Raw access via NativeData & Native.Core ! ``` NEW: Implemented aliases for Exported-Functions and Variables - Issue #9 ``` l.Aliases["Flag"] = l.Aliases["getFlag"] = l.Aliases["xFunc"]; //Flag() -> getFlag() -> xFunc()->... l.DLR.getFlag(); ``` ``` l.Aliases["gmn"] = new ProcAlias( "GetMagicNum", new AliasCfg() { NoPrefixR = true } // false by default ); ``` NEW: Native.Core improvements - Extensions & new `t` signatures for node (raw alignments via size and managed types) +`t(Type type, string name = null)` +`t(Type[] types, params string[] names)` +`t(int size, string name = null)` NEW: Aliases for 'empty' types: +`Action bindFunc(string lpProcName);` +`Action bind(string func);` NEW: New group of binding via regular arguments: +`Method bindFunc(string lpProcName, Type ret, params Type[] args);` +`Method bindFunc(string lpProcName, Type ret, params Type[] args);` +`Method bind(string func, Type ret, params Type[] args);` +`Method bind(string func, Type ret, params Type[] args);` FIXED: Fixed possible crashes - 'A heap has been corrupted' when use of shared pointer between several UnmanagedStructure. CHANGED: ILoader: minor incompatible changes for PE32/PE32+ features. * New `IPE PE` property for complex work with PE-file. * The `ExportFunctionNames` property has been removed as obsolete. Use same `PE.ExportedProcNamesArray` CHANGED: IProvider minor incompatible changes `funcName()` -> `procName()` `string funcName(string name);` has been renamed to `string procName(string name);` - as a common method for getting full lpProcName with main prefix etc. CHANGED: `TDyn IBinder.bind(MethodInfo mi, bool prefix = false);` removed as a deprecated, because for this can be a lot of misunderstandings. If you need something, use like: `prefix ? l.procName(mi.Name) : mi.Name` etc. for any available methods with MethodInfo. CHANGED: Added User object (+`user`) for Native.Core.Field. To store any additional information that's related for specific field. --- .version | 2 +- Conari.nuspec | 4 +-- Conari/ConariVersion.cs | 6 ++-- Readme.md | 10 ++----- build.bat | 7 ++++- changelog.txt | 65 ++++++++++++++++++++++++++++++++++++++++- 6 files changed, 79 insertions(+), 15 deletions(-) diff --git a/.version b/.version index 867e524..589268e 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -1.2.0 \ No newline at end of file +1.3.0 \ No newline at end of file diff --git a/Conari.nuspec b/Conari.nuspec index 321d11b..25c22f7 100644 --- a/Conari.nuspec +++ b/Conari.nuspec @@ -2,7 +2,7 @@ Conari - 1.2.0 + 1.3.0 [ Conari ] Binder of Unmanaged code for .NET github.com/3F/Conari reg @@ -22,7 +22,7 @@ ~~~~~~~~ Get it via GetNuTool: ========================================== - gnt /p:ngpackages="Conari/1.2.0" + gnt /p:ngpackages="Conari/1.3.0" ========================================== * https://github.com/3F/GetNuTool diff --git a/Conari/ConariVersion.cs b/Conari/ConariVersion.cs index c5778c7..b5fc368 100644 --- a/Conari/ConariVersion.cs +++ b/Conari/ConariVersion.cs @@ -8,12 +8,12 @@ public struct ConariVersion { public static readonly Version number = new Version(S_NUM_REV); - public const string S_NUM = "1.2.0"; - public const string S_REV = "37964"; + public const string S_NUM = "1.3.0"; + public const string S_REV = "39634"; public const string S_NUM_REV = S_NUM + "." + S_REV; - public const string BRANCH_SHA1 = "ce3e8a9"; + public const string BRANCH_SHA1 = "aa4e6b1"; public const string BRANCH_NAME = "master"; public const string BRANCH_REVC = "45"; diff --git a/Readme.md b/Readme.md index f2f60bc..9a46df2 100644 --- a/Readme.md +++ b/Readme.md @@ -7,7 +7,7 @@ Binder of Unmanaged code for .NET The Conari engine represents flexible platform for work with unmanaged code (native C/C++ etc.): Libraries, Executable Modules, other native and binary data. Lightweight and powerful binding with any exported-functions/variables, and much more. -*Did you know: The [LunaRoad](https://github.com/3F/LunaRoad) project works via Conari engine.* +*[List of Projects via Conari engine](https://github.com/3F/Conari/wiki/Projects)* [![Build status](https://ci.appveyor.com/api/projects/status/qc1d3ofsso8fd67t/branch/master?svg=true)](https://ci.appveyor.com/project/3Fs/conari/branch/master) [![release-src](https://img.shields.io/github/release/3F/Conari.svg)](https://github.com/3F/Conari/releases/latest) @@ -149,25 +149,21 @@ l.Svc.native("lpProcName"); // Raw access via NativeData & Native.Core ! ```csharp // v1.3+ -l.Aliases["getFlag"] = l.Aliases["flag"] = l.Aliases["getD_True"]; // getFlag() -> flag() -> getD_True() -> ... +l.Aliases["Flag"] = l.Aliases["getFlag"] = l.Aliases["xFunc"]; //Flag() -> getFlag() -> xFunc()->... // ... l.DLR.getFlag(); ``` **Additional types:** -* BSTR, CharPtr, float_t, int_t, ptrdiff_t, size_t, uint_t, WCharPtr +* BSTR, CharPtr, WCharPtr, float_t, int_t, ptrdiff_t, size_t, uint_t * UnmanagedString - to allocation of new unmanaged strings for your unmanaged code. * ... ```csharp - size_t len; CharPtr name = c.bind>("to")(1, out len); -... string myName += name; // (IntPtr)name; .Raw; .Ansi; .Utf8; ... -... -uint_t v = dll.getU(2); ``` **Events**: diff --git a/build.bat b/build.bat index ddf6497..258da95 100644 --- a/build.bat +++ b/build.bat @@ -1,10 +1,15 @@ @echo off +set reltype=%1 set _msbuild=tools/msbuild +if "%reltype%"=="" ( + set reltype=Release +) + call gnt /p:ngconfig="packages.config" /nologo /v:m /m:4 || goto err -call %_msbuild% -notamd64 "Conari.sln" /v:normal /l:"packages\vsSBE.CI.MSBuild\bin\CI.MSBuild.dll" /m:4 /t:Rebuild /p:Configuration=Release || goto err +call %_msbuild% -notamd64 "Conari.sln" /v:normal /l:"packages\vsSBE.CI.MSBuild\bin\CI.MSBuild.dll" /m:4 /t:Rebuild /p:Configuration=%reltype% || goto err goto exit diff --git a/changelog.txt b/changelog.txt index caa1e83..5c75262 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,12 +1,74 @@ - - - - -Conari +Conari :: https://github.com/3F/Conari _ _ _ _ +[v1.3] + + NEW: Improved speed >80% (DLR) & >90% (Lambda) + `*` results for regXwild x64 (Unicode) via snet tester - https://github.com/3F/regXwild + + NEW: Improved DLR. Automatic detection for ByRef types & null-values for any reference-types that pushed with out/ref modifier. + * +UseCallingContext - To use information about types from CallingContext if it's possible. + * +UseByRef - To use ByRef& (reference-types) for all sent types. + + NEW: Added `NullType` as optional way for work with reference-types. And for other purpose to store additional information about basic type for any null values. + NEW: Added IProvider.NewProcAddress event - When handling new non-zero ProcAddress. + NEW: Started support of Exported-Variables via IExVar & DLR - Issue #7 + ``` + l.ExVar.DLR.ADDR_SPEC; // 0x00001CE8 + l.ExVar.get("ADDR_SPEC"); // 0x00001CE8 + l.ExVar.getField(typeof(UInt32).NativeSize(), "ADDR_SPEC"); // Native.Core.Field via raw size + l.Svc.native("lpProcName"); // Raw access via NativeData & Native.Core ! + ``` + + NEW: Implemented aliases for Exported-Functions and Variables - Issue #9 + ``` + l.Aliases["Flag"] = l.Aliases["getFlag"] = l.Aliases["xFunc"]; //Flag() -> getFlag() -> xFunc()->... + l.DLR.getFlag(); + ``` + ``` + l.Aliases["gmn"] = new ProcAlias( + "GetMagicNum", + new AliasCfg() { NoPrefixR = true } // false by default + ); + ``` + + NEW: Native.Core improvements - Extensions & new `t` signatures for node (raw alignments via size and managed types) + +`t(Type type, string name = null)` + +`t(Type[] types, params string[] names)` + +`t(int size, string name = null)` + + NEW: Aliases for 'empty' types: + +`Action bindFunc(string lpProcName);` + +`Action bind(string func);` + + NEW: New group of binding via regular arguments: + +`Method bindFunc(string lpProcName, Type ret, params Type[] args);` + +`Method bindFunc(string lpProcName, Type ret, params Type[] args);` + +`Method bind(string func, Type ret, params Type[] args);` + +`Method bind(string func, Type ret, params Type[] args);` + + FIXED: Fixed possible crashes - 'A heap has been corrupted' when use of shared pointer between several UnmanagedStructure. + CHANGED: ILoader: minor incompatible changes for PE32/PE32+ features. + * New `IPE PE` property for complex work with PE-file. + * The `ExportFunctionNames` property has been removed as obsolete. Use same `PE.ExportedProcNamesArray` + + CHANGED: IProvider minor incompatible changes `funcName()` -> `procName()` + `string funcName(string name);` has been renamed to `string procName(string name);` + - as a common method for getting full lpProcName with main prefix etc. + + CHANGED: `TDyn IBinder.bind(MethodInfo mi, bool prefix = false);` removed as a deprecated, because for this can be a lot of misunderstandings. + If you need something, use like: `prefix ? l.procName(mi.Name) : mi.Name` etc. for any available methods with MethodInfo. + + CHANGED: Added User object (+`user`) for Native.Core.Field. To store any additional information that's related for specific field. + + [v1.2] FIXED: Incorrect boolean values from unmanaged code #6 NEW: Added type for work with unmanaged structures - UnmanagedStructure + [v1.1] NEW: DLR features for core with caching of dynamic types. @@ -30,6 +92,7 @@ _ _ _ _ CHANGED: Updated CharPtr: +BSTR, +WCharPtr & added new UnmanagedString, that allocates strings for unmanaged code. CHANGED: Other trivial fixes and improvements. + [v1.0] * Initial release.