Jump to content

force unload injected module in Autoit


flashcoder
 Share

Recommended Posts

I have a code example in Delphi and I want "translate" this code to Autoit. Someone can help me please?

Here is Delphi code:

procedure ForceRemove(const ModuleName: string);
var
  hMod: HMODULE;
begin
  hMod := GetModuleHandle(PChar(ModuleName));
  if hMod=0 then 
    exit;
  repeat
  until not FreeLibrary(hMod);
end;

Usage:

ForceRemove('anydll.dll');

 

Link to comment
Share on other sites

Hello. 

#include <WinAPI.au3>


_ForceRemove("anydll.dll")

Func _ForceRemove($sModuleName)
Local $hModule=_winapi_GetModuleHandle($sModuleName)
If Not $hModule then Return
Do
    ;Some sleep if is needed
Until   _winapi_FreeLibrary($hModule)=True
EndFunc

Saludos

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...