I have the following situation:
I have a delphi application {$APPTYPE GUI}
. (APP1
)
If APP1
gets started, it runs the code between
begin
and end.
, just as it should be.
Later, APP1
will be transformed to a DLL (another application will do that - APP2
).
APP2
adds the IMAGE_FILE_DLL
flag to the Characteristics
in the NTFileHeader
of APP1
.
Then APP2
tries to load the DLL (APP1
) with LoadLibrary
(or some other COM Command to load a dll) but it returns the error:
Windows encountered an internal error while initializing COM libraries.
I've done all this with a C
project and used the WinMain
function. However it seems not to work in Delphi (APP1
gets not started as a DLL). How is it possible to convert APP1
to a working DLL?
EDIT:
I'm trying to port this code from C
to Delphi : http://level-23.info/forum/showthread.php?14721-UAC-Bypass-for-Windows-7-RTM-SP1-Windows-8-DP&p=31749
I've ported it correctly and everything works but the CRYPTBASE.dll
(APP1
) doesn't start . (See Error above)
In a nutshell:
Create a delphi application, add the IMAGE_FILE_DLL
characteristics in the file header. Rename it to CRYPTBASE.dll
and copy it to C:\Windows\System32\sysprep. Then start sysprep.exe
INFOS HERE: http://www.pretentiousname.com/misc/W7E_Source/win7_uac_poc_details.html
WinMain
might be conflicting with the host application'sWinMain
... – Joe