News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Load DLL from .exe

Started by hfheatherfox07, July 14, 2011, 11:29:02 PM

Previous topic - Next topic

hfheatherfox07

Hi, I was wondering if there is away NOT to include a .DLL ...and instead load it from the resources in the .exe.... I figured I can achive this by writting the .dll to "temp" and then deleting it when the program closes, Is there a way to do it without writing it to temp? 

bomz


hfheatherfox07


bomz


bomz

this for ex. application to auto change TOR identity. it save the setting but find there it.

hfheatherfox07

A little different then Loading a .dll from memory , I can just write the .dll to "temp" and make it's attribute hidden??
I am looking for a way with out writing it to the computer....

bomz

why not 'put dll in memory' by including it code to main code

hfheatherfox07

The whole idea is to learn how to use a .dll from memory

bomz

you want copy to memory some data, and than use it like LOADDLL?
the deal is that 'this data' is already in memory

qWord

using streams, requires that the file system support it - also they get quickly lost by packing, moving/copy,...
About the DLL: goggle for it - there are several code examples flying around on the net. However, this not a normal program behaviour.
FPU in a trice: SmplMath
It's that simple!

hfheatherfox07

Quote from: qWord on July 15, 2011, 02:28:19 AM
using streams, requires that the file system support it - also they get quickly lost by packing, moving/copy,...
About the DLL: goggle for it - there are several code examples flying around on the net. However, this not a normal program behaviour.


I saw http://win32assembly.online.fr/tut26.html and I like the idea to mess around with I just hate that I have to always member to have the .dll with it ...

it might be easier to include the .dll asm in the main code ... I just thought it would be neat to mess with this , the only way that I can think off is to write the .dll to temp than delete it when the program closes ... I found nothing on the net about it

hutch--

A friend of mine from long ago Jeremy Collake wrote a tool that would handle many different DLL layouts but it is never a truly reliable technique as the system is not designed to run a pre-compiled binary in that form. If you have to use a DLL that you did not write I would be inclined to store it as BYTE data, write it to disk then whenever the app is started it just tests for the DLL and writes it to disk if its not there. The idea is to always write it to the same directory that the app is in so it can always be found. With your app you use LoadLibrary(), GetProcAddress() and eventually FreeLibrary() for the DLL.

This technique is reliable where the other is always problematic.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

bomz

#12
Quote from: qWord on July 15, 2011, 02:28:19 AM
using streams, requires that the file system support it - also they get quickly lost by packing, moving/copy,...
About the DLL: goggle for it - there are several code examples flying around on the net. However, this not a normal program behaviour.
Using registry you also may lost setting. moving/copy not cause settings lost. only RAR/UNRAR-ZIP/UNZIP or COPY to FAT32 FAT16, or copy by copy utilities.
the main part of program prefer leave some KB in registry after uninstall. the absolutely record - Macrovision Install Shield, it's leave only in registry more than 10 mb data (for ex my hole registry 25 mb, with more than 130 program)* . This call registry fragmentation and it's real problem not NTFS stream. reading DAT file quicker than registry Indexes.
it's the same that save setting in dat file near application

* so I always use Registry clean utilities, registry defragmentation, Ashampoo Uninstaller - which make system snapshot before and after program Install, which allow to full clean it after uninstall, and Acronis Restore to the point 'Windows Just Install' - this need the same time as full clean system.
And for ex I prefer Foxit Reader instead Adobe Reader, which put to registry 1 mb (and need disk place 230 mb - Foxit 5 mb only).
Every day your registry becomes biger and biger and one day (when your registry reach 100 mb) you say 'what's happen with my windows, may be ReInstall it?'. But really you only need clean Registry and defargmented it


http://www.regvac.com/fregvac.htm RegVac The Only realy working good program for registry (defragmentation), most of registry utilities only destroy your windows
Microsoft RegClean - the mystery program which clean something and this don't destroy windows
Norton Windoctor - it's clean and check dll problems
Win Tools Pro - good for quick clean
add to this it's good to clean Icon Tray Cashe + Directory's size in registry. This possible to do with CCleaner, but realy it clean Tray cache if you restart explorer after cleaning.
after cleaning defragmentate registry. when I made this first I delete 50 mb from registry. but it was impossible to clean it full so I reinstall windows and make acronis copy

Vortex

Loading and running EXEs and DLLs from memory

I modified GetProcAddr to replace linear search with binary search. I didn't post the latest release of PEmem but it will be available after some tweaks.

Twister

You want a binder? I hope you are not trying to plant viruses and the likes.