Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi dll vor dem prorammstart kopieren (https://www.delphipraxis.net/107903-dll-vor-dem-prorammstart-kopieren.html)

k4ni 4. Feb 2008 13:35


dll vor dem prorammstart kopieren
 
Hey,

Ich benütze die DropALlU unit für eine kleine firewall.
also mit InstallFW(localIP) an und RemoveFw() aus Und es benötigt die iphlpapi.dll.
Doch aus irgendeinem grund hooken mehrere gameguards diese dll. Dann hab ich aber rausgefunden, dass wenn ich eine kopie dieser dll mach und diese kopie dann benütz, gehts wieder.
Doch wenn beim programmstart diese dll nicht besteht kommt eine Error-Message das sie nicht da is (ja ne is kla :P).
Jetzt hab ich bei FormCreate das hier drinne:
Delphi-Quellcode:
if not FileExists(GetWinDir+'/system32/iphlpapiRehook.dll')
 then
  begin
    Quelldatei := GetWinDir+'/system32/iphlpapi.dll';
   Zieldatei := GetWinDir+'/system32/iphlpapiRehook.dll';
    if not CopyFile(PChar(Quelldatei), PChar(Zieldatei), true) then
      ShowMessage('Could not copy the dll.');
  end;
Also wie ihr sehen könnt, wenn die kopierte datei noch nich besteht macht das programm schnell eine kopie davon.
Doch das geht nicht, weil es beim programmstart zuerst schaut ob die dll da ist oder nicht, also bevor Form1Create überhaupt gemacht wird.

Wie könnte ich das sonst machen?

Ich dachte schon das beim programmstart erst kurz eine console kommt, die dann schaut ob die dll da ist und wenn nicht...
Und dann das eigentliche programm startet.

Was denkt ihr?

Bernhard Geyer 4. Feb 2008 13:44

Re: dll vor dem prorammstart kopieren
 
Binde die DLL dynamisch und nicht fest. Macht z.B. das Jedi-Project Win32 sehr stark.


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:37 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz