Вопрос Import function from DLL in MemoryStream

namquang93

Новичок
Hi I'm Trying to Extract temporary dll and installer of Exe to TMemoryStream INSTEAD of {tmp} Folder using ExtractTemporaryFileToStream but I do not know How to declare functions in dll Files. Can anyone explain how to do it. For example this declaration:
Код:
 procedure SetTaskBarProgressValue (APP: HWND; Value: Integer); external 'SetTaskBarProgressValue @ {tmp} \ WinTB.dll stdcall delayload';
WinTB.dll was no longer in {tmp} folder but has been extracted to MemoryStream.

Thanks in advanced :D
 

namquang93

Новичок
I understand. But it is weird that some repackers can extract temporary files to some places that I can not touch. For example, this is a repack that I have downloaded from internet. As you can see unarc.exe is running and extracting files, but when I clicked Open File Location, it opened an empty folder.

W02Ar7C.jpg

So I believe that file (and others too, like Isdone.dll, precomp.exe...) has been extracted to MemoryStream. I found that Restool can do this and I have successfully extracted the bmp image file for setup to MemoryStream and load it, like the included example.

procedure InitializeWizard();
var
Logo: TBitmapImage;
MemStream: TMemoryStream;
begin
Logo := TBitmapImage.Create(WizardForm);
Logo.Parent := WizardForm;
MemStream := TMemoryStream.Create;
try
ExtractTemporaryFileToStream('logo.bmp', MemStream);
MemStream.Position := 0;
Logo.Bitmap.LoadFromStream(MemStream);
finally
MemStream.Free;
end;
Logo.SetBounds(30, WizardForm.Bevel.Top+10, Logo.Bitmap.Width, Logo.Bitmap.Height);
end;
But for dll files it is not posible to declair functions. I'm really curious to know how to do this and hope that someone can explain please :drinks:
 
Сверху