Jump to content
Tuts 4 You

Archived

This topic is now archived and is closed to further replies.

Ufo-Pu55y

dmex (.net class library)

Recommended Posts

Ufo-Pu55y

First some infos:

http://www.joachim-bauch.de/tutorials/load...ry.html/en/view

I've tried to convert it into a C# class.

Here's an example exe, to see what the class might be used for:

Keygen.rar

The example maps the native ufmod.dll from the resources into

memory and then calls some of its functions to play a chiptune (also from resources).

This way you don't have to save the dll to hard-disk before using it.

And here's the full package:

DMex.rar

It contains:

-the .net class library

-a help file

-2 example projects (vb.net and c#)

As requested.. here's the source of the DMex class only:

class_DMex_source.7z

Have phun and post feedback, if it's useful somehow or if you got improvements ;)

Share this post


Link to post
Share on other sites
Killboy
Entrypoint not valid or not found

:beta:

Uhm I've tried it on a pretty clean XP SP2 install with .NET FX 2.0 SP1...

Maybe it just works with 3.0 ?

Edit:

Even crashes on Vista :o

Haven't installed any .NET stuff so this should be 3.0

Share this post


Link to post
Share on other sites
hitman
Entrypoint not valid or not found

:beta:

Uhm I've tried it on a pretty clean XP SP2 install with .NET FX 2.0 SP1...

Maybe it just works with 3.0 ?

same problem on Vista (.Net FX 3.0). But working on XP sp3 .NET FX 2.0 (VM)

Share this post


Link to post
Share on other sites
TheAnalyzer

Thank's bro :wub::wub:

Your threads are always great.

No Problem run fine in XP SP2

SeeYah

Share this post


Link to post
Share on other sites
Ufo-Pu55y

Sry, I dunno how to trace that down, coz I've tested on several boxes.. XP & Vista.. NET2.0 & 3.0.

All worked ok... :-\

Share this post


Link to post
Share on other sites
Sonny27

Runs fine here on XP SP2 and .NET 2.0 :)

greetz

Share this post


Link to post
Share on other sites
Departure

No problems here XP Pro SP3 release candidate with .net 2.0

Share this post


Link to post
Share on other sites
Ufo-Pu55y

I've updated the 1st post.

The class now comes as dll, but you can simply merge the files with M$ ILMerge or any net packer.

Meanwhile uFMOD is also available as DLL, and it seems to work like a charm with the dll loader.

I've also added 2 example projects (both about using uFMOD) and a help doc.

cheers

Share this post


Link to post
Share on other sites
GEEK

works perfect here with xp sp2 and .net 3.0

Share this post


Link to post
Share on other sites
BrunoMaestro

YEAH, my Search is over ;) thanks

Share this post


Link to post
Share on other sites
akusei

I'm having an issue with this. Mine keeps telling me "Entrypoint not valid or not found". I'm using MS Visual Studio 2010 and I've tried compiling it with the 2.0, 3.0 and 4.0 frameworks... same problem with all of them. I'm also running Windows 7.

Strange thing is, the keygen example and the compiled c# and VB examples run on my system with no problem, but if I try to compile them and then run them, I get the entrypoint error.

Any ideas?

-akusei

Share this post


Link to post
Share on other sites
Ufo-Pu55y

I'm having an issue with this. Mine keeps telling me "Entrypoint not valid or not found". I'm using MS Visual Studio 2010 and I've tried compiling it with the 2.0, 3.0 and 4.0 frameworks... same problem with all of them. I'm also running Windows 7.

Strange thing is, the keygen example and the compiled c# and VB examples run on my system with no problem, but if I try to compile them and then run them, I get the entrypoint error.

Any ideas?

-akusei

I'll take a look.. first idea tho: did you set the target platform to x86?

EDIT/

Ah.. nvm. Just tried on my own. U're right! Will see what's up with it.

Share this post


Link to post
Share on other sites
Ufo-Pu55y

Hah, here's the answer:
/>http://blogs.msdn.com/ed_maurer/archive/2007/12/14/nxcompat-and-the-c-compiler.aspx

So I run something like...

editbin /NXCOMPAT:NO uFMOD.exe

.. and it works again.

Share this post


Link to post
Share on other sites
akusei

Hah, here's the answer:
/>http://blogs.msdn.com/ed_maurer/archive/2007/12/14/nxcompat-and-the-c-compiler.aspx

So I run something like...

editbin /NXCOMPAT:NO uFMOD.exe

.. and it works again.

You're awesome Ufo! I'll test it out tomorrow when I get to work and let you know if it corrects my issue, but since it worked for you, it'll most likely work for me.

Thanks again,

akusei

edit: works great, thanks!

Share this post


Link to post
Share on other sites
akusei

Ok, so now I'm having some more troubles. I used editbin to change the NXCOMPAT flag and that worked great, but now I'm trying to merge dmex.dll with my application using ilmerge. This is the command line I'm using:


ilmerge /target:winexe /closed /out:test.exe /lib:c:\windows\microsoft.net\framework\v4.0.30319 infile.exe dmex.dll

I've tries it with and without the "/closed" option. When I run the merged exe it crashes and doesn't tell me anything useful. Any clue how to fix that?

Thanks,

akusei

edit:

I figured it out, I needed to at /targetplatform


ilmerge /closed /targetplatform:v4,c:\windows\microsoft.net\framework\v4.0.30319 /target:winexe /out:test.exe infile.exe dmex.dll

Share this post


Link to post
Share on other sites
Guest Dipsy

Is it possible to get the .net class source code ?? So with that, we must not merge your dll into the targets exe-file...

Share this post


Link to post
Share on other sites
Walkin

One question, @Ufo... as i've seen in the keygen example you didn't use the Dmex.dll physically.It is possible load it from resources, too?

Share this post


Link to post
Share on other sites
Ufo-Pu55y

@Dipsy & Walkin:

Simply rip the class with reflector or ilspy and

include it in your project.. takes you 1 min

Share this post


Link to post
Share on other sites
Walkin

I get a lotta error "This (int or long) can't be converted to IntPtr" xD

Btw, i wanted to ask about the SetPaused proc, i don't know how to implement it :/

Share this post


Link to post
Share on other sites
Ufo-Pu55y

Forget it.. I know including extra libraries sux.

I'll dig for the source later on..

Share this post


Link to post
Share on other sites
Ufo-Pu55y

Source code of the DMex class attached above now

Share this post


Link to post
Share on other sites
Ahmed18

thx for this DLL. but i have the same problem !!

Entrypoint not valid or not found

and i can't understand the article and this line:


editbin /NXCOMPAT:NO uFMOD.exe

:unsure:

should i make this step every time i compile the source code ??

any help please :flowers:

Share this post


Link to post
Share on other sites
Ufo-Pu55y

simply put something like this into the post build box of the regarding VS project:

editbin /NXCOMPAT:NO $(TargetPath)

Share this post


Link to post
Share on other sites
Walkin

I converted it to vb with a tool, but now i get an OverFlowException when loading the ufmod dll :(

This sh!t is getting me crazy :S

Share this post


Link to post
Share on other sites
Ahmed18

@Ufo-Pu55y thx for your replay but i get this error in the Error List:

'editbin' is not recognized as an internal or external command

MS visual studio 2008

Share this post


Link to post
Share on other sites

×