Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 17
  1. #1
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,534

    Run DLL From memory

    I seem to recall someone (I think MicroByte) saying that a dll could be read as binary and stored in and run from memory. I've been searching the forums for about a half-hour with no luck finding the post (not that it has the "how" anyway). Does anyone know how this can be done?
    Action Plugins
    AllOn | Box | Class | Code | Cursor | DXML | Error | Frames | GlobalPaths | Group | INIPlus |KeyBind | KeyLock | MathEx | Menu | Name | Project | Resize | StatusBar
    Download

  2. #2
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Quote Originally Posted by Centauri Soldier View Post
    I seem to recall someone (I think MicroByte) saying that a dll could be read as binary and stored in and run from memory. I've been searching the forums for about a half-hour with no luck finding the post (not that it has the "how" anyway). Does anyone know how this can be done?
    I know it's possible, but I don't know if an AMS compatible is available, if you can't find it, I'll be happy to write you one
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  3. #3
    Join Date
    May 2006
    Posts
    5,380
    to call a dll from memory you would need a dll or plugin to make it happen in the first place so i dont really see the point in doing it, plus the target dll would need to be compiled into the calling dll so i cant really see a generic solution

    it is possible to do, just not with AMS, check out the PB-OSL package, it contains a lib that calls a dll from memory and contains examples
    Open your eyes to Narcissism, Don't let her destroy your life!!

  4. #4
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Quote Originally Posted by RizlaUK View Post
    to call a dll from memory you would need a dll or plugin to make it happen in the first place so i dont really see the point in doing it, plus the target dll would need to be compiled into the calling dll so i cant really see a generic solution

    it is possible to do, just not with AMS, check out the PB-OSL package, it contains a lib that calls a dll from memory and contains examples
    Indeed, a nice function in the PBOSL lib ^^
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  5. #5
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,534
    Well then, it seems like a plugin would be the way to go. A Plugin Extension Plugin that would allow the plugin maker to place his dll in the plugin as a string and then load it into memory with the PEP at start-up without writing the included dll to the hard disk. Could that be done?
    Action Plugins
    AllOn | Box | Class | Code | Cursor | DXML | Error | Frames | GlobalPaths | Group | INIPlus |KeyBind | KeyLock | MathEx | Menu | Name | Project | Resize | StatusBar
    Download

  6. #6
    Join Date
    May 2006
    Posts
    5,380
    dunno, sounds like a lot of work, and although it sounds like something i would use, as my plugins are already dll based and this dll needs to be written to disk in order to use then its a waist of time for me to unpack a dll to call another dll from memory, if im unpacking a single dll i might as well unpack several dll's

    if something like this was coded in C++ then id use it for sure
    Open your eyes to Narcissism, Don't let her destroy your life!!

  7. #7
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,534
    Perhaps I misunderstood. I though IP was saying that a plugin built in PB could facilitate loading a dll into and calling it from memory. Would that plugin require a dll to be unpacked?
    Action Plugins
    AllOn | Box | Class | Code | Cursor | DXML | Error | Frames | GlobalPaths | Group | INIPlus |KeyBind | KeyLock | MathEx | Menu | Name | Project | Resize | StatusBar
    Download

  8. #8
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Quote Originally Posted by Centauri Soldier View Post
    Perhaps I misunderstood. I though IP was saying that a plugin built in PB could facilitate loading a dll into and calling it from memory. Would that plugin require a dll to be unpacked?
    No, that plugin could wrap the PBOSL function, but then again you would always need that plugin to load the dll's from memory. (eg from a Base64 string, decrypted and loaded in the plugin)

    Eg: You write a luaplugin, which has a dll included, but you would have to need the plugin to load the plugin from a string, you wouldn't mind?
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  9. #9
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,534
    No, I would not mind at all. Having one plugin that extended the functionality of many other plugins without the need to write anything to disk would be fantastic.

    We could simply create a dependency check for each dependent plugin that would ensure the presence of the PB plugin.
    Action Plugins
    AllOn | Box | Class | Code | Cursor | DXML | Error | Frames | GlobalPaths | Group | INIPlus |KeyBind | KeyLock | MathEx | Menu | Name | Project | Resize | StatusBar
    Download

  10. #10
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Quote Originally Posted by Centauri Soldier View Post
    No, I would not mind at all. Having one plugin that extended the functionality of many other plugins without the need to write anything to disk would be fantastic.

    We could simply create a dependency check for each dependent plugin that would ensure the presence of the PB plugin.
    Okay, I will see what I can do, I'll try to prepare something tonight or tomorrow. (Having a festival tonight hehe)

    You'll probably won't even have to decrypt the string before the call, but it would improve the speed quite much if you'd pass a memorypointer to the string instead of the string itself...

    How would you like to call the dll exactly, open, call, close library, or simply call function and close right after?
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  11. #11
    Join Date
    Jun 2007
    Location
    Delphi II
    Posts
    1,534
    I'm not sure what the difference is amongst all those choices but I think I would prefer speed above all else (or perhaps even having the option selectable by the programmer in case he wants to favor security for one application and speed for another).

    Simply calling a function would probably be easiest but since I don't know much about this procedure I think I would like to leave it to your discretion.

    Enjoy your festival tonight, don't drink too much heh heh....
    Action Plugins
    AllOn | Box | Class | Code | Cursor | DXML | Error | Frames | GlobalPaths | Group | INIPlus |KeyBind | KeyLock | MathEx | Menu | Name | Project | Resize | StatusBar
    Download

  12. #12
    Join Date
    May 2006
    Posts
    5,380
    OPEN, CALL, CLOSE

    its a must for a dll lib, bit tricky for noobs to get the hang of, but a must in my book

    and yes, a pointer would be quicker, but the overhead has to come from somewhere, at some point in the call the string will need to be 'PokeS' and here you have 3 options

    1. poke it in AMS with the memory plugin
    2. poke it with a function in your plugin
    3. send the string and poke it withn the function call

    i dont see how there would be much of a speed difference, it would make the indivdual calls quicker but the overall process would still take the same time (within a few 100's MS)

    get your stopwatch out i guess, only way to tell
    Open your eyes to Narcissism, Don't let her destroy your life!!

  13. #13
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Quote Originally Posted by RizlaUK View Post
    OPEN, CALL, CLOSE

    its a must for a dll lib, bit tricky for noobs to get the hang of, but a must in my book

    and yes, a pointer would be quicker, but the overhead has to come from somewhere, at some point in the call the string will need to be 'PokeS' and here you have 3 options

    1. poke it in AMS with the memory plugin
    2. poke it with a function in your plugin
    3. send the string and poke it withn the function call

    i dont see how there would be much of a speed difference, it would make the indivdual calls quicker but the overall process would still take the same time (within a few 100's MS)

    get your stopwatch out i guess, only way to tell
    Well yes poking it in AMS would be good, just don't declare the base64 as a string variable, but poke it right away is an argument. Then give the pointer as argument to the plugin I'm gonna write, I won't even have to peek it from there, because decrypting and loading can all be done using just the pointer ^^

    This way, the string will only have to be parsed by AMS once, on the moment it gets poked into the Memory plugin's pointer.
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  14. #14
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Last question, when do you need this? I'm still busy with the L-OOP script, I almost finished that one ^^

    That festival sucked by the way, I have 2 groups of friends, group 1 hates group 2 and vice versa... I was caught in the middle lol! And the heaters broke, so it was like -6C over there... waste of time and money.
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  15. #15
    Join Date
    May 2006
    Posts
    1,443
    Hi
    i am following this thread
    but i could not understand what do you want to do by technique

    will this add a dll to another one and then call added dll's functions from host dll
    if so, this is very interesting , there will be dependencies ..?

    is there a step by step explanation

    i am just curious

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts