r00t
February 28th, 2002, 22:18
Hi all.
The other day someone ask me why the regsvr32.exe cannot register some .dll (say "a.dll".
I've realize that those "a.dll" uses some others dll's (i mean in the import table of "a.dll" there's "c.dll" and "d.dll" and some other dll's).
The point is: regsvr32 fails bcoz i dont have c.dll and d.dll, so i start to program my own regsvr, and i discover that i must make a LoadLibrary, then GetProcAddress of function DllRegisterServer and then execute those function. That's easy.
The proble is LoadLibrary fails if some dll in the import table is missing. So i try to make my own LoadLibrary function.
First OpenFile, then CreateFileMappin, MapViewOfFileEx, the search for the EP and execute the code there, and then i've programmed my GetProcAddress and the execute DllRegisterServer.
All those goes fine, until i've discovered that those shitty DllRegisterServer uses static addresses. (i mean that the MApViewOfFileEx maps from address 82xxxxxx or something like that and the code into the dll expects addresses 10xxxxxx or something).
So, anyone have some ideas to make a successfull LoadLibrary emulation?. i think it could be possible.
Greets and thanks.
The other day someone ask me why the regsvr32.exe cannot register some .dll (say "a.dll".
I've realize that those "a.dll" uses some others dll's (i mean in the import table of "a.dll" there's "c.dll" and "d.dll" and some other dll's).
The point is: regsvr32 fails bcoz i dont have c.dll and d.dll, so i start to program my own regsvr, and i discover that i must make a LoadLibrary, then GetProcAddress of function DllRegisterServer and then execute those function. That's easy.
The proble is LoadLibrary fails if some dll in the import table is missing. So i try to make my own LoadLibrary function.
First OpenFile, then CreateFileMappin, MapViewOfFileEx, the search for the EP and execute the code there, and then i've programmed my GetProcAddress and the execute DllRegisterServer.
All those goes fine, until i've discovered that those shitty DllRegisterServer uses static addresses. (i mean that the MApViewOfFileEx maps from address 82xxxxxx or something like that and the code into the dll expects addresses 10xxxxxx or something).
So, anyone have some ideas to make a successfull LoadLibrary emulation?. i think it could be possible.
Greets and thanks.