flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > Fasm.NET ~ A managed wrapper for .NET applications

Author
Thread Post new topic Reply to topic
ZenLulz



Joined: 10 Jul 2013
Posts: 2
Location: Switzerland
ZenLulz 10 Jul 2013, 14:56
Hello FASM community,

I've written a managed wrapper to use FASM compiler from .NET applications.

The goal of this project is the possibility to compile FASM code on the fly from your favorite managed language (C++/CLI, C#, VB.NET).

Here are some features available:

  • Assemble mnemonics on the fly
  • Assemble a file
  • Assemble multiple files
  • Create a instance of the class to assemble your mnemonics code with ease
  • Throw managed and detailed exceptions when compilation errors occur
  • Customize the memory size and the number of pass
  • Get the version of the FASM compiler


Here is an example how Fasm.NET can be used
Code:
string[] mnemonics =
    {
        "use64",
        "mov rax, 1",
        "retn"
    };

byte[] asm = FasmNet.Assemble(mnemonics);
    


The library embeds FASM compiler as a linkable Microsoft COFF object . So, as FASM compiler is built in 32-bit, the managed assembly can only be used within a 32-bit development.

The binaries and the sources are available on my Github repository : https://github.com/ZenLulz/Fasm.NET

I appreciate feedback, idea to improve it or even like on the repo Very Happy

ZenLulz
Post 10 Jul 2013, 14:56
View user's profile Send private message Visit poster's website Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 841
Location: Jakarta, Indonesia
TmX 10 Jul 2013, 18:45
Wow this is so cool Very Happy

BTW, could you provide more samples (esp 32-bit version)?
Post 10 Jul 2013, 18:45
View user's profile Send private message Reply with quote
ZenLulz



Joined: 10 Jul 2013
Posts: 2
Location: Switzerland
ZenLulz 10 Jul 2013, 19:08
There are more samples available in the README on Github. Smile

You can use 32-bit exactly like 64-bit (you need to specify use32).
Post 10 Jul 2013, 19:08
View user's profile Send private message Visit poster's website Reply with quote
upsurt



Joined: 14 Jan 2014
Posts: 51
upsurt 24 Aug 2014, 16:53
really great, thank you!
Post 24 Aug 2014, 16:53
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1150
Location: Russian Federation
comrade 24 Aug 2014, 21:39
Good job. Hosting binaries and object files in your github repository (Release/*.dll and Fasm.NET/Release/* and Fasm.NET/Fasm.obj) is probably against Github policies. Is there a C interface (lowest common denominator) ?
Post 24 Aug 2014, 21:39
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 25 Aug 2014, 00:12
Is FASM ran in memory or on disk?
Post 25 Aug 2014, 00:12
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 12845
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 25 Aug 2014, 14:27
this one is cool!
is that possible for fasm application to call .net dll function?
Post 25 Aug 2014, 14:27
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.