All Projects β†’ 3F β†’ Conari

3F / Conari

Licence: mit
🧬 Platform for unmanaged memory, pe-modules, related PInvoke features, and more for: Libraries, Executable Modules, enjoy using of the unmanaged native C/C++ in .NET world, and other raw binary data …

Programming Languages

lua
6591 projects
cpp
1120 projects

Projects that are alternatives of or similar to Conari

hexen-dll-injector
HEX-EN DLL Injector
Stars: ✭ 20 (-85.51%)
Mutual labels:  native, dll, binding
Common
A set of common utils for consuming Web APIs with Angular
Stars: ✭ 259 (+87.68%)
Mutual labels:  api, native
Share Api Polyfill
A polyfill for the sharing that can be used in desktop too, so your users can shere in their twitter, facebook, messenger, linkedin, sms, e-mail, print, telegram or whatsapp.
Stars: ✭ 210 (+52.17%)
Mutual labels:  api, native
Node Postal
NodeJS bindings to libpostal for fast international address parsing/normalization
Stars: ✭ 165 (+19.57%)
Mutual labels:  native, binding
Tosdatabridge
A collection of resources for pulling real-time streaming data off of TDAmeritrade's ThinkOrSwim(TOS) platform; providing C, C++, Java and Python interfaces.
Stars: ✭ 229 (+65.94%)
Mutual labels:  api, dll
imgui-java
JNI based binding for Dear ImGui
Stars: ✭ 270 (+95.65%)
Mutual labels:  native, binding
Slacko
A neat interface for Slack
Stars: ✭ 64 (-53.62%)
Mutual labels:  api, binding
Bandcamp Scraper
A scraper for https://bandcamp.com
Stars: ✭ 137 (-0.72%)
Mutual labels:  api
Poloniex Api Node
Poloniex API client for REST and WebSocket API
Stars: ✭ 138 (+0%)
Mutual labels:  api
Sinesp
🚘 API em PHP para consultar informaçáes de veículos na base de dados do SINESP Cidadão
Stars: ✭ 137 (-0.72%)
Mutual labels:  api
New Eden Social
🌌 New Eden Social πŸš€
Stars: ✭ 136 (-1.45%)
Mutual labels:  api
Mailjet Apiv3 Nodejs
[API v3] Official Mailjet API v3 NodeJS wrapper
Stars: ✭ 137 (-0.72%)
Mutual labels:  api
Pure Http
✨ The simple web framework for Node.js with zero dependencies.
Stars: ✭ 139 (+0.72%)
Mutual labels:  api
Iota Java
IOTA Java API Library. Find documentation on
Stars: ✭ 137 (-0.72%)
Mutual labels:  api
Tastyworks api
An unofficial, reverse-engineered Python API for tastyworks.
Stars: ✭ 138 (+0%)
Mutual labels:  api
Python Twitch Client
Python wrapper for Twitch API
Stars: ✭ 137 (-0.72%)
Mutual labels:  api
Twitter Streaming Api
Easily work with the Twitter Streaming API
Stars: ✭ 139 (+0.72%)
Mutual labels:  api
Stunning Signature
Native Signature Verification For Android (with example)
Stars: ✭ 139 (+0.72%)
Mutual labels:  native
Foxify
The fast, easy to use & typescript ready web framework for Node.js
Stars: ✭ 138 (+0%)
Mutual labels:  api
Laravel Api Explorer
API explorer for laravel applications
Stars: ✭ 138 (+0%)
Mutual labels:  api

Conari

🧬 Conari engine represents powerful platform for work with unmanaged memory, pe-modules, related PInvoke features, and more for: Libraries, Executable Modules, enjoying of the unmanaged native C/C++ in .NET world, and other raw binary data. Even accessing to complex types like structures without their declaration at all.

Build status release-src License NuGet package Tests

Build history

1:[ Quick start ] 2:[ Basic examples for C++ and C# ] 3:[ Complex types and Strings ] -> { Wiki }

Why Conari ?

It was designed to be loyal to your needs on the fly.

πŸ” Easy to start:

using(var l = new ConariL("...")) {
    // ...
}

πŸš€ Awesome speed:

Optional caching of 0x29 opcodes (Calli) and more.

test of regXwild's algorithms [340x10000 Unicode] +icase [x32] +icase [x64] `
regXwild native C++ EXT algorithm ~50ms ~26ms <<
regexp-c++11(regex_search) ~59309ms ~53334ms
regexp-c++11(regex_match with endings .*) ~59503ms ~53817ms
.NET Regex engine [Compiled] ~38310ms ~37242ms
.NET Regex engine ~31565ms ~30975ms
regXwild via Conari v1.3 (Lambda) - EXT ~54ms ~35ms <<
regXwild via Conari v1.3 (DLR) - EXT ~214ms ~226ms

πŸ”¨ Its amazing DLR features:

using(dynamic l = new ConariX("..."))
{
    // just everything is yours ~
    l.curl_easy_setopt(curl, 10002, "http://example.com");
}

πŸ”§ Raw accessibility to any binary data in unmanaged memory:

ptr.Native().align<int>(2, "x", "y")
            .t<IntPtr>("data")
            .Raw;

πŸ„ Most powerful PInvoke and even most convenient use of WinAPI. Our recipe is simple: Just use it!

dynamic user32 = new User32();

    user32.ShowWindow(0x000A0A28, 3);
    user32.MessageBoxA(0, "Conari in action", "Hello!", 0);
dynamic kernel32 = new Kernel32();

    kernel32.GetModuleHandleA<IntPtr>("libcurl-x64");
    kernel32.GetModuleHandleW<IntPtr>((WCharPtr)ustr);

Important note: Conari does not provide anything from above. It will just generate and adapt everything at runtime. Specially for you!

πŸ”– Modern .NET Core

Conari is ready for .NET Core starting from 1.4.

But we have even more, again. Conari also provides support for .NET Standard 2.0 layer which does not cover unmanaged EmitCalli due to missed implementation for System.Private.CoreLib.

🍰 Open and Free:

Conari is available for everyone from 2016 πŸŽ‰ Open Source project; MIT License, Yes! Enjoy!

πŸ—Έ License

The MIT License (MIT)

Copyright (c) 2016-2020  Denis Kuzmin < [email protected] > GitHub/3F

[ β˜• Donate ]

Conari contributors: https://github.com/3F/Conari/graphs/contributors

We're waiting for your awesome contributions!

Take a look closer

Dynamic features (DLR, fully automatic way) when using of unmanaged code:

var ptr     = d.test<IntPtr>(); //lambda ~ bind<Func<IntPtr>>("test")();
var codec   = d.avcodec_find_encoder<IntPtr>(AV_CODEC_ID_MP2); //lambda ~ bind<Func<ulong, IntPtr>>("avcodec_find_encoder")(AV_CODEC_ID_MP2);
              d.push(); //lambda ~ bind<Action>("push")();
              d.create<int>(ref cid, out data); //lambda ~ bind<MyFunc<Guid, object>>("create")(ref cid, out data);

It does not require the any configuration from you, because Conari will do it automatically. Works perfectly for most popular libraries like: Lua, 7-zip, FFmpeg, ...

Custom Lambda expressions (semi-automatic way) when using of unmanaged code:

using(var l = new ConariL("Library.dll"))
{
    l.bind<Action<int, int>>("call")(2, 1); 
    double num = l.bind<Func<IntPtr, int, double>>("tonumber")(L, 4);
}

This also does not require the creation of any additional delegates. Just use bind<> methods with additional types and have fun!

l.bind<...>("function")
// you already may invoke it immediately as above:
l.bind<Action<int, string>>("set")(-1, "Hello from Conari !");

// or later:
var set = l.bind<Action<int, string>>("set");
...
set(-1, "Hello from Conari !");

Lazy loading:

using(var l = new ConariL(
                    new Config("Library.dll") {
                        LazyLoading = true
                    }))
{
    ...
}

Native C/C++ structures without declaration [?]:

// IMAGE_FILE_HEADER: https://msdn.microsoft.com/en-us/library/windows/desktop/ms680313.aspx
dynamic ifh = NativeData
                ._(data)
                .t<WORD, WORD>(null, "NumberOfSections")
                .align<DWORD>(3)
                .t<WORD, WORD>("SizeOfOptionalHeader")
                .Raw.Type;
                
if(ifh.SizeOfOptionalHeader == 0xE0) { // IMAGE_OPTIONAL_HEADER32
    ... 
}

// IMAGE_DATA_DIRECTORY: https://msdn.microsoft.com/en-us/library/windows/desktop/ms680305.aspx
dynamic idd = (new NativeData(data))
                    .t<DWORD>("VirtualAddress") // idd.VirtualAddress
                    .t<DWORD>("Size")           // idd.Size
                    .Raw.Type;
IntPtr ptr ...
Raw mt = ptr.Native()
                .align<int>(2, "a", "b")
                .t<IntPtr>("name")
                .Raw;
            
-     {byte[0x0000000c]} byte[]
        [0]    0x05    byte --
        [1]    0x00    byte   |
        [2]    0x00    byte   |
        [3]    0x00    byte --^ a = 5
        [4]    0x07    byte --
        [5]    0x00    byte   |
        [6]    0x00    byte   |
        [7]    0x00    byte --^ b = 7
        [8]    0x20    byte --
        [9]    0x78    byte   |_ pointer to allocated string: (CharPtr)name
        [10]   0xf0    byte   |
        [11]   0x56    byte --
...

Calling Convention & Name-Decoration [?]:

using(var l = new ConariL("Library.dll", CallingConvention.StdCall))
{
    //...
    l.Mangling = true; // [email protected] <-> get_SevenStdCall
    l.Convention = CallingConvention.Cdecl;
}

Exported Variables & Raw access [?]:

// v1.3+
l.ExVar.DLR.ADDR_SPEC // 0x00001CE8
l.ExVar.get<UInt32>("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 !
//v1.0+: Use Provider or ConariL frontend via your custom wrapper.

Aliases for exported-functions and variables [?]:

// v1.3+
l.Aliases["Flag"] = l.Aliases["getFlag"] = l.Aliases["xFunc"]; //Flag() -> getFlag() -> xFunc()->...
// ...
l.DLR.getFlag<bool>();

Additional types:

  • BSTR, CharPtr, WCharPtr, float_t, int_t, ptrdiff_t, size_t, uint_t
  • UnmanagedString - allocation of the new unmanaged strings.
  • ...
size_t len;
CharPtr name = c.bind<FuncOut3<int, size_t, IntPtr>>("to")(1, out len);
string myName += name; // (IntPtr)name; .Raw; .Ansi; .Utf8; ...

Events:

l.ConventionChanged += (object sender, DataArgs<CallingConvention> e) =>
{
    DLR = newDLR(e.Data);
    LSender.Send(sender, $"DLR has been updated with new CallingConvention: {e.Data}", Message.Level.Info);
};

l.BeforeUnload += (object sender, DataArgs<Link> e) =>
{
    // Do not forget to do something before unloading a library
};

...

and more !

Examples

Sample for DLR

How about to use regXwild (Fast and powerful wildcards on native unmanaged C++) in your C# code ? It's easy:

using(var l = new ConariL("regXwild.dll")) {
...
    if(l.DLR.searchEssC<bool>((WCharPtr)data, (WCharPtr)filter, false)) {
        // ...
    }
}

yes, you don't need to do anything else! Conari will prepare all required operations and binding with native method instead of you:

REGXWILD_API bool searchEssC(const TCHAR* data, const TCHAR* filter, bool ignoreCase);

have fun!

How to get Conari

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].