Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / merging of dlls without source code possible?

Author
Message
jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 20th Nov 2006 02:08
i was wondering if its possible to merge 2 dlls. but, i dont have the source code to one of them, but i want to access the commands from it. i also dont want to have to have 2 seperate dlls. its just nicer having one. for example:

lets say im creating a dll that does X,Y,Z. but in order to do X,Y,Z; i need the second dll because X,Y,Z use A,B,C; which are in the second dll. so, is there a way to include the second dll in the project for the dll that im making without having the source code for the second dll?

hope that made sense


Thread: http://forum.thegamecreators.com/?m=forum_view&t=78971&b=8&p=0
*New Website Coming Soon*
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 20th Nov 2006 09:09 Edited at: 20th Nov 2006 09:11
jason, in your project, you will need to use the LoadLibrary function, and setup function pointers to the entries exposed by the second DLL. Obtaining the function pointers from the second DLL will require you to use the GetProcAddress function.

So for example, to load the DLL into memory, do:



Hope this is useful

Paul.

jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 21st Nov 2006 05:34
ya, this isnt exactly what i was looking for. because this code only loads it for use in the first dll, but i want the second dll to be permanently loaded into the first one so that the first one can be transported to other users' computers without the requirement of the second dll before download.


Thread: http://forum.thegamecreators.com/?m=forum_view&t=78971&b=8&p=0
*New Website Coming Soon*
jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 22nd Nov 2006 07:21
anyone have any ideas?


Thread: http://forum.thegamecreators.com/?m=forum_view&t=78971&b=8&p=0
*New Website Coming Soon*
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Nov 2006 14:20
Aren't you trying to solve a problem that has already been solved by installers and zip files? Just put all of your files together into a single archive.

jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 22nd Nov 2006 16:36
no, because there would be no point since its only 2 dlls. i just wanted to make it easier and less confusing by putting them together to make 1 dll so that i could give it to ppl as just 1 dll. makes things easier on the ppl downloading it.

also, ppl dont like installers much. and whats the point in a zip file if there are going to be 2 dlls coming out of it? this doesnt solve my problem


Thread: http://forum.thegamecreators.com/?m=forum_view&t=78971&b=8&p=0
*New Website Coming Soon*
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 22nd Nov 2006 17:40
I'm beginning to question the reason for this to be honest... I cannot see why it is so difficult just to create an installer or even a self-executable ZIP archive? Also, as you've mentioned that you don't have the source files to rebuild the DLLs. Are the DLLs themselves governed by a licensing restriction or a EULA for redistribution of the DLLs?

You'll have to be careful when dealing with this sort of thing, specially if your combining two separate DLLs belonging to a product together with another, and labelling the new DLL as your own. Don't get me wrong, I'm not saying that this is the case, but this does bring the question to mind.

Paul.

jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 22nd Nov 2006 17:56
no, its just i wanted to create a dll that uses sparky's collision dll. but, if he comes out with a new version, i dont want my dll messing up because of new commands and such. so i wanted the right version to be within my dll. then, i wouldnt have to require that someone has the dll/ the right version of it.

all i want is to merge 2 dlls. i dont have the source for sparky's collsion, so i just wanted to add it to my project another way...


forum.thegamecreators.com/?m=forum_view&t=78971&b=8&p=0
forum.thegamecreators.com/?m=forum_view&t=91115&b=32
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 22nd Nov 2006 18:26
Oh wait, so the DLLs are being used by your DBP program? If your DBP app uses the collision DLL as a plugin, your EXE will automatically contain the correct DLL when the application is compiled. I've not used Sparky's DLL so I'm unsure if this is used as a DBP plugin.

Paul.

jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 22nd Nov 2006 22:14 Edited at: 22nd Nov 2006 22:14
ya, sparky's dll is a plugin. and im not talking about giving out the exe. i never even mentioned exes... reread what i said. im trying to MERGE 2 DLLS so that i can make ONE PLUGIN


forum.thegamecreators.com/?m=forum_view&t=78971&b=8&p=0
forum.thegamecreators.com/?m=forum_view&t=91115&b=32
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 25th Nov 2006 15:30
ok ok... this is a bit of a messy way to do it but find a program that can convert a file into a C/C++ array of hex numbers(there pretty abundant)

and then use it to convert the collision plugin into an array in your dll
then use fopen and create a new writable temp file of some sort
and then write all the data in the array to that file and fclose it(you can get how big the array is by checking the filesize, NOT file size on disk though)

then just use LoadLibrary and friends to use that temp file as a dll

jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 26th Nov 2006 00:27
hmmm... ill try that if no one else comes up with an easier answer


forum.thegamecreators.com/?m=forum_view&t=78971&b=8&p=0
forum.thegamecreators.com/?m=forum_view&t=91115&b=32
jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 26th Nov 2006 01:30
To answer your question, no. That is absolutely not possible in any sort of practical, useable and legal sense. No.

You do not need to do that, it is being done already. Sparky's dll is in the executable image, isn't it? (i.e. You do not have to redistribute it separately, do you?)

Next, your concerns are likely unwarranted in the first place. Backward compatibility is fairly universal unless otherwise stated, and the new commands would be unknown to your application, wouldn't they? How would they interfere? I'm not understanding that part of your question.

imo you should not consider trying to hide this...that is silly, and you are working against the OS, not smart in any case. At any rate, files can be read into byte arrays...I am not sure what the hex reference is all about...it has no bearing on this at all.
jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 26th Nov 2006 02:05
wow, talk about attack...

and the answer to my question is YES if you would have read Three Score's post, its just complicated.

and i do have to redistribute it separately, but its not for the use of the user downloading my dll. its strickly for the use of my dll only. secondly, not the NEW COMMANDS per say... just the new CHANGES to the commands may flaw what is already working. in this way, someone can have the new collision commands, while still having my dll work flawlessly. im just trying to design my dll in this way so that errors dont occur on my part. error checking is a part if programming if you werent aware.

and, no im not going to hide this. this is a ligitimate question, not something that is breaking any rule or law(at least that i am aware of).

so, stop attacking me, and if you can answer the question, i urge you to do so; if you cant, then just dont post.


forum.thegamecreators.com/?m=forum_view&t=78971&b=8&p=0
forum.thegamecreators.com/?m=forum_view&t=91115&b=32
EddieB
19
Years of Service
User Offline
Joined: 29th Sep 2004
Location: United Kingdom
Posted: 26th Nov 2006 15:48
All I can suggest is like what three score said, write a tool to convert the dlls into byte arrays, store them in separate db files.... Then write them out to a temp file on start up.
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 26th Nov 2006 18:08
I already have a tool that does that..(was included with a gameboy programming e-book)

it's attached..

Attachments

Login to view attachments
jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 26th Nov 2006 19:25 Edited at: 26th Nov 2006 19:32
That was not an attack, just reality. You cannot redistribute someone else's code in a form that is not the one they have provided. That is illegal according to most EUAs.

As far as combining the executable code, no...that will not work, either. A DLL within DLL is not possible. You can ferry the code inside another file, but...what is the point of that? Again, you are violating the EUA in most cases.

Just because you are able to do something...does not give you tacit permission, nor does it make it a good idea. That is true of anything, not just version control.

The bottom line is this: your idea is misguided because DLLs are self-contained entities, and also...you do not own Sparky's DLL. It is not proper use of the DLL. The people using your DLL need to also own Sparky's DLL, which your DLL is dependent upon. Have you talked to Sparky about this?

I am not trying to flame you, or insult you, or any of that...its just that your idea goes well outside acceptable software development practices. When your code is dependent upon third party dlls, you redistribute those dlls in their original form. Period. I know of only one other acceptable way, which is to provide instructions to get it from the original author. Also, DLLs are to be installed, not brought in under cover of darkness.
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 26th Nov 2006 19:44 Edited at: 26th Nov 2006 19:45
lemme see.....
Quote: "That was not an attack, just reality. You cannot redistribute someone else's code in a form that is not the one they have provided. That is illegal according to most EUAs."

I have never seen that in any eua's I've read, but then again I don't read many


Quote: "As far as combining the executable code, no...that will not work, either. A DLL within DLL is not possible. You can ferry the code inside another file, but...what is the point of that? Again, you are violating the EUA in most cases."

hmm not entirely... but I guess that's what you mean by "ferry"



Quote: "The people using your DLL need to also own Sparky's DLL"

what's your reasoning behind that? should that mean that a compiled dbp exe should not be self-contained.. it should have about 12 extra dll's (like for the 3d and such)

Quote: "Also, DLLs are to be installed, not brought in under cover of darkness."

when someone plays a game made in dbp should you have to have admin priviledges to install all the dll's it uses

Quote: "its just that your idea goes well outside acceptable software development practices."

no, and plus if the program works, is fast, and is maintanable then what does it matter
Quote: "
I know of only one other acceptable way, which is to provide instructions to get it from the original author"

hmmm so your putting it onto the end-user, about like how dos did

jinzai
17
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 26th Nov 2006 20:24
I do read EULAs, and they all say it the same way, which is basically...you redistribute the code the way you got it. Be flip all you want, it is a violation.

I mean ferry...to transport something from one place to another. Again, that would violate most EULAs.

My reasoning is that if Sparky's DLL is external to the DBPro application, they would need to have paid sparky for it. That is how that works. What, now you are stupid?

I mean that you would be bringing Sparky's DLL in under cover of darkness, but then again...you know that already too.

No, DOS did not necessarily do that, and neither does Windows...I am putting the responsibility on the person that is providing the install.

Look...do whatever you want...that's cool; I don't care. I have already made it abundantly clear that this is not adviseable, proper, or even clever. It is none of those in my opinion. I have said my bit three times already, so I feel okay about my part in this.
Three Score
20
Years of Service
User Offline
Joined: 18th Jun 2004
Location: behind you
Posted: 26th Nov 2006 21:00
hmmm didn't now sparky's DLL was a paid thing..
how does he keep people from stealing his DLL out of binaries of games people distribute?

jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 26th Nov 2006 22:08
1. its not a paid thing. its FREE

2. IM NOT REDISTRIBUTING IT. it might be on someone elses pc, but its not accessable to them. im still only using for what im making.

Quote: "Look...do whatever you want...that's cool; I don't care."


obviously you do care, looking at the huge posts youve made in my thread...

@three score: thx, ill try that out.


forum.thegamecreators.com/?m=forum_view&t=78971&b=8&p=0
forum.thegamecreators.com/?m=forum_view&t=91115&b=32
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 27th Nov 2006 22:35
First of all, ask sparky if you can do whatever you are trying to do! Even if it is not illegal (Although I'm sure he could sue you if you did that), it is still a nice thing to do

Secondly, you can save functions from dlls using dll export viewer.
Open both of the dlls in it, select the functions you want, and save them out.



jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 28th Nov 2006 05:51 Edited at: 28th Nov 2006 06:01
cool thx. ill ask him, but he changed his name, didnt he? sparky = Paul Johnston right?

EDIT: i got dll export viewer, but it just exports the functions to txt, html, or xml files. am i missing something? because, i thought u ment that i could export the functions to make another dll...


forum.thegamecreators.com/?m=forum_view&t=78971&b=8&p=0
forum.thegamecreators.com/?m=forum_view&t=91115&b=32

Login to post a reply

Server time is: 2024-06-23 03:35:56
Your offset time is: 2024-06-23 03:35:56