flashcoder

force unload injected module in Autoit

3 posts in this topic

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');

 

Share this post


Link to post
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

2 people like this

 

venezuela.png Would you like to say thank to Danyfirex using a warmy way?  offer me a cup of coffee... coffee.png

autoit_scripter_blue_userbar.png

       AutoIt...

 

 

Share this post


Link to post
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