All Projects → FICTURE7 → unicorn-net

FICTURE7 / unicorn-net

Licence: MIT license
WIP .NET binding/wrapper for the Unicorn engine written in C#

Programming Languages

C#
18002 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to unicorn-net

Qiling
Qiling Advanced Binary Emulation Framework
Stars: ✭ 2,816 (+6300%)
Mutual labels:  unicorn-emulator, unicorn-engine
Witch-Android
View-data binding library for Android.
Stars: ✭ 25 (-43.18%)
Mutual labels:  binding
HackerNews
A .NET MAUI app for displaying the top posts on Hacker News that demonstrates text sentiment analysis gathered using artificial intelligence
Stars: ✭ 184 (+318.18%)
Mutual labels:  net
background-service-lib
Essential classes for reliable background services.
Stars: ✭ 24 (-45.45%)
Mutual labels:  binding
odin-imgui
Odin binding for Dear ImGui
Stars: ✭ 37 (-15.91%)
Mutual labels:  binding
tortuga
A modern game engine built using dot net core
Stars: ✭ 14 (-68.18%)
Mutual labels:  net
backblaze
Backblaze.Agent is a high-performance .NET Core implementation of the Backblaze B2 Cloud Storage API.
Stars: ✭ 32 (-27.27%)
Mutual labels:  net
Muvi
Very simple project to show a collection of Movie from MovieDb with a minimalist design
Stars: ✭ 46 (+4.55%)
Mutual labels:  binding
MQTTnet
MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
Stars: ✭ 3,309 (+7420.45%)
Mutual labels:  net
aliyun-openapi-sdk-net-core
aliyun open api sdk for .net core 2.0
Stars: ✭ 17 (-61.36%)
Mutual labels:  net
profiler-api
The portable version of JetBrains profiler API for .NET Framework / .NET Core / .NET / .NET Standard / Mono
Stars: ✭ 21 (-52.27%)
Mutual labels:  net
dragome-sdk
Dragome is a tool for creating client side web applications in pure Java (JVM) language.
Stars: ✭ 79 (+79.55%)
Mutual labels:  binding
crystal-cassandra
A Cassandra driver for Crystal
Stars: ✭ 20 (-54.55%)
Mutual labels:  binding
wisej-extensions
Extensions to Wisej. See http://wisej.com.
Stars: ✭ 32 (-27.27%)
Mutual labels:  net
netpoll
Package netpoll implements a network poller based on epoll/kqueue.
Stars: ✭ 38 (-13.64%)
Mutual labels:  net
luacc
Lua Code Combine
Stars: ✭ 36 (-18.18%)
Mutual labels:  binding
VB.NET
🌐 In this repository included useful examples of Visual Basic completed on Studio 2017 Enterprise Edition, added diploma work of time since 2013. 👔
Stars: ✭ 35 (-20.45%)
Mutual labels:  net
pybrood
Another BWAPI Python binding made with pybind11
Stars: ✭ 15 (-65.91%)
Mutual labels:  binding
NETProvider
Firebird ADO.NET Data Provider
Stars: ✭ 113 (+156.82%)
Mutual labels:  net
Norm.net
High performance micro-ORM modern Dapper replacement for .NET Standard 2.1 and higher
Stars: ✭ 92 (+109.09%)
Mutual labels:  net

Unicorn.Net

Slightly fancier WIP .NET binding/wrapper for the Unicorn engine.

NOTE

The API is very prone to changes at the moment.

Examples

Here is an example of how to use it. This is also the same example as the official documentation available here but in C# and using Unicorn.Net.

using (var emulator = new X86Emulator(X86Mode.b32))
{
    ulong addr = 0x1000000;
    byte[] x86code =
    {
        0x41, // INC ECX
        0x4a  // DEC EDX
    };

    var ecx = 0x1234;
    var edx = 0x7890;

    // Map 2mb of memory.
    emulator.Memory.Map(addr, 2 * 1024 * 1024, MemoryPermissions.All);

    emulator.Registers.ECX = ecx;
    emulator.Registers.EDX = edx;

    emulator.Memory.Write(addr, x86code, x86code.Length);

    emulator.Start(addr, addr + (ulong)x86code.Length);

    Console.WriteLine(emulator.Registers.ECX);
    Console.WriteLine(emulator.Registers.EDX);
}

Registers

Reading and writing to registers.

NOTE

Currently there is no way to write to registers using register IDs, but this may change.

// Assume emulator is an instance of the X86Emulator type.

// Reading from registers.
var val = emulator.Registers.ECX;
// Writing to registers.
emulator.Registers.ECX = 0x10;

Memory

Mapping, unmapping, reading, writing and changing memory permissions.

var addr = 0x100000;
// Getting memory regions.
var regions = emulator.Memory.Regions;
// Getting memory page size.
var pageSize = emulator.Memory.PageSize;

// Mapping memory.
emulator.Memory.Map(addr, 2 * 1024, 2 * 1024, MemoryPermissions.All);
// Unmapping memory.
emulator.Memory.Unmap(addr + (4 * 1024), 4 * 1024);
// Changing memory permissions.
emulator.Memory.Protect(addr + (4 * 1024), 4 * 1024, MemoryPermissions.Read);

// Code to write to memory.
var code = new byte[]
{
    0x41, // INC ECX
    0x4a  // DEC EDX
}

// Buffer thats going to be the storage for data read from memory.
var buffer = new byte[2];

// Writing to memory.
emulator.Memory.Write(code, 0, code.Length);
// Reading to memory.
emulator.Memory.Read(buffer, 0, buffer.Length);

Hooking

Currently hooking is still under the works and may change.

// Adding a memory read hook.
emulator.Hooks.Memory.Add(MemoryHookType.Read, (emu, type, address, size, val, userData) => {
    Console.WriteLine(" stuff was read from memory.");
}, addr, addr + (ulong)code.Length, null);

Contexts

Capturing and restoring contexts.

// emulator.Context will create a new Context object
// which you will to dispose afterwards. Hence the `using` statement.

// Capturing the context.
using (var ctx = emulator.Context)
{
    ...
    
    // To restore the context simply do this.
    emulator.Context = ctx;
}

Raw Bindings

Unicorn.Net also provide some raw bindings through the Bindings class.

var bindings = new Bindings();
bindings.Open(...);
bindings.MemMap(...);
...

TODO

List of stuff thats needs to be implemented or that has been implemented.

  • Emulator

    • uc_emu_start
    • uc_emu_stop
    • uc_query
  • Context

    • uc_context_alloc
    • uc_context_save
    • uc_context_restore
  • Registers

    • uc_reg_read
    • uc_reg_write
  • Memory

    • uc_mem_write
    • uc_mem_read
    • uc_mem_protect
    • uc_mem_regions
    • uc_mem_map
    • uc_mem_unmap
  • Hooking

    • uc_hook_add
    • uc_hook_del
  • Arches

    • x86
    • arm
    • arm64
    • m68k
    • mips
    • sparc
  • Actual bindings

Licensing

Unicorn.Net is licensed under the permissive MIT License.

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].