flat assembler
Message board for the users of flat assembler.

Index > Windows > link .net dll with fasm?

Author
Thread Post new topic Reply to topic
sleepsleep



Joined: 05 Oct 2006
Posts: 13034
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 05 Feb 2010, 12:58
yeah, it is possible for god sake,
but how?

any simple hello world example?

i was thinking baking the web browser control in .net (or GUI in .net)
but the logic stuff in asm..

possible?
Post 05 Feb 2010, 12:58
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 05 Feb 2010, 13:47
I think .NET stuff would be well out of the realm of a small assembly proggy. From what I have seen you would need to set up a managed-code environment (i.e. a VM environment) and a .NET byte code decoder.
Post 05 Feb 2010, 13:47
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 05 Feb 2010, 18:26
Even mscorlib.dll is actually MSIL code (I was very surprised about this as I assumed they used native code for the framework).

However, I also think it is possible, but you're very likely to need to run in unmanaged mode so you could callback your assembly code (not sure if it is feasible the other way around).
Post 05 Feb 2010, 18:26
View user's profile Send private message Reply with quote
Yardman



Joined: 12 Apr 2005
Posts: 244
Location: US
Yardman 05 Feb 2010, 21:12
[ Post removed by author. ]


Last edited by Yardman on 04 Apr 2012, 03:30; edited 1 time in total
Post 05 Feb 2010, 21:12
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 05 Feb 2010, 22:07
sleepsleep wrote:
yeah, it is possible for god sake,
but how?

any simple hello world example?

i was thinking baking the web browser control in .net (or GUI in .net)
but the logic stuff in asm..

possible?


Maybe what you want is to make an assembly .dll using fasm and calling the assembly code from within .NET?

_________________
Gimme a sledge hammer! I'LL FIX IT!
Post 05 Feb 2010, 22:07
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 13034
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 06 Feb 2010, 08:45
i was kinda a bit confused lately... 3 pending projects. i gonna die...
life is a big joke, yeah, but when customer keep asking u... when u gonna finish them,, damn... headache
Post 06 Feb 2010, 08:45
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 13034
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 06 Feb 2010, 08:47
Quote:

Maybe what you want is to make an assembly .dll using fasm and calling the assembly code from within .NET?

yeah, dll in fasm... calling from .net application.

and function in .net application, and call from fasm dll.
Post 06 Feb 2010, 08:47
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 06 Feb 2010, 09:42
sleepsleep wrote:
yeah, dll in fasm... call[ed] from .net application.
Maybe possible. But doesn't that break the managed code paradigm? What is the calling standard anyway?
sleepsleep wrote:
and function in .net application, and call from fasm dll.
This would be where it all goes haywire. Wouldn't you have to set up protected objects and other things in asm before doing the call?
Post 06 Feb 2010, 09:42
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 06 Feb 2010, 17:12
Quote:

Maybe possible. But doesn't that break the managed code paradigm? What is the calling standard anyway?

Possible and yes, you need to run unmanaged. http://msdn.microsoft.com/en-us/magazine/cc164123.aspx

Passing callback, which would allow you to call managed code from the native dll is not so clear how possible and stable is, I found this (I've not read it thoroughly): http://www.beefycode.com/post/Delegates-and-Native-API-Callbacks-Answer.aspx
Post 06 Feb 2010, 17:12
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 06 Feb 2010, 22:14
Well SleepSleep,
I made a simple C# example here that calls a .dll function made with fasm from within .NET code. Going in reverse, Calling a .NET dll function from assembly, I haven't had any experience with though.


Description: CSharp Example calling assembly .dll function
Download
Filename: LearningProject1.rar
Filesize: 26.55 KB
Downloaded: 314 Time(s)


_________________
Gimme a sledge hammer! I'LL FIX IT!
Post 06 Feb 2010, 22:14
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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.